Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop
This commit is contained in:
commit
5488ea8d7b
@ -63,7 +63,7 @@ if (isset($_GET['getSales'])){
|
||||
$export = true;
|
||||
foreach($sales as $key => $sale) {
|
||||
$delay = SaleDelay::getDelaySmallName($sale->delivery_delay,2);
|
||||
echo '<tr id="item_'.$sale->id. '">
|
||||
echo '<tr id="item_'.$sale->id. '" class="">
|
||||
<td>'.$sale->id.'</td>
|
||||
<td>'.$sale->id_category.'</td>
|
||||
<td><strong>'.$sale->title[intval($cookie->id_lang)].'</strong><br/><span style="color:#666; font-style:italic; font-size:11px;">'.$extrafields[$sale->id][1].'</span></td>
|
||||
@ -87,11 +87,15 @@ if (isset($_GET['getSales'])){
|
||||
<td align="center">'.$delay.'</td>
|
||||
<td align="center">'.(isset($sale_shipping[(int) $sale->id])? ($sale_shipping[(int) $sale->id] == 1? 'Philea': ''): '').'</td>
|
||||
<td align="center" class="position">';
|
||||
if($key != 0){
|
||||
echo '<a href="#" onclick="updatePositionVP(0,'. $sale->position .'); return false;" class="updatePosition" data-way="0" data-position='. $sale->position .'><img title="Haut" alt="Haut" src="../img/admin/up.gif"></a>';
|
||||
}
|
||||
if($key + 1 != count($sales)){
|
||||
echo ' <a href="#" class="updatePosition" onclick="updatePositionVP(1,'. $sale->position .'); return false;" data-way="1" data-position='. $sale->position .'><img title="Bas" alt="Bas" src="../img/admin/down.gif"></a>';
|
||||
if($sale->lock_position == 1){
|
||||
echo '<span class="anticon anticon-lock"></span>';
|
||||
} else {
|
||||
if($key != 0){
|
||||
echo '<a href="#" onclick="updatePositionVP(0,'. $sale->position .'); return false;" class="updatePosition" data-way="0" data-position='. $sale->position .'><img title="Haut" alt="Haut" src="../img/admin/up.gif"></a>';
|
||||
}
|
||||
if($key + 1 != count($sales)){
|
||||
echo ' <a href="#" class="updatePosition" onclick="updatePositionVP(1,'. $sale->position .'); return false;" data-way="1" data-position='. $sale->position .'><img title="Bas" alt="Bas" src="../img/admin/down.gif"></a>';
|
||||
}
|
||||
}
|
||||
|
||||
$category_link = Link::getCategoryLink($sale->id_category);
|
||||
@ -121,6 +125,11 @@ if (isset($_GET['getSales'])){
|
||||
<i class="glyphicon glyphicon-eye-open"></i> Voir Catégorie BO
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a style="cursor: pointer;" onclick="'.($sale->lock_position?'itemUnLockPosition('.$sale->id.')':'itemLockPosition('.$sale->id.')').'">
|
||||
<span class="anticon anticon-lock"></span> '.($sale->lock_position?'Défixer':'Fixer').' position
|
||||
</a>
|
||||
</li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<a style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')">
|
||||
@ -183,6 +192,10 @@ function updateSalePosition($position, $new_position){
|
||||
$sale = Sale::getByPosition($position);
|
||||
$last_sale = Sale::getByPosition($new_position);
|
||||
|
||||
if($sale->lock_position || $last_sale->lock_position){
|
||||
return true;
|
||||
}
|
||||
|
||||
// // update lactuelle new position
|
||||
Db::getInstance()->autoExecute( _DB_PREFIX_.'privatesale', array(
|
||||
'position' => $position),
|
||||
@ -204,25 +217,68 @@ if (isset($_GET['updatePositionDrag'])){
|
||||
$id_sale = str_replace("item_", "", $_GET['id_sale']);
|
||||
$position = $_GET['position'];
|
||||
|
||||
$sql = 'SELECT position FROM '._DB_PREFIX_.'privatesale WHERE id_sale =' . $id_sale;
|
||||
$position_initial = Db::getInstance()->getValue($sql);
|
||||
$sql = 'SELECT position, lock_position FROM '._DB_PREFIX_.'privatesale WHERE id_sale =' . $id_sale;
|
||||
$query = Db::getInstance()->getRow($sql);
|
||||
if((int)$query['lock_position']==1){
|
||||
die();
|
||||
}
|
||||
|
||||
$position_initial = (int)$query['position'];
|
||||
$new_position = $position_initial + $position;
|
||||
|
||||
$sql = 'SELECT lock_position FROM '._DB_PREFIX_.'privatesale WHERE position =' . $new_position;
|
||||
$is_lock = Db::getInstance()->getValue($sql);
|
||||
if($is_lock==1){
|
||||
die();
|
||||
}
|
||||
|
||||
$lock_positions = array();
|
||||
foreach(Db::getInstance()->executeS('SELECT position FROM '._DB_PREFIX_.'privatesale WHERE lock_position = 1') as $lock){
|
||||
$lock_positions[] = (int)$lock['position'];
|
||||
}
|
||||
|
||||
$_positions = array();
|
||||
if($position > 0){
|
||||
$sales_sql = "SELECT id_sale, position FROM "._DB_PREFIX_."privatesale WHERE position BETWEEN ". ($position_initial +1) .' AND ' .$new_position;
|
||||
$sales_sql = "SELECT id_sale, position FROM "._DB_PREFIX_."privatesale WHERE position BETWEEN ". ($position_initial +1) .' AND ' .$new_position.' AND lock_position = 0 ORDER BY position DESC';
|
||||
$sales = Db::getInstance()->ExecuteS($sales_sql);
|
||||
foreach ($sales as $key => $sale){
|
||||
Db::getInstance()->ExecuteS( 'UPDATE '._DB_PREFIX_.'privatesale SET position = (position -1) WHERE id_sale = '. $sale['id_sale']);
|
||||
$pos = (int)$sale['position']-1;
|
||||
while(in_array($pos, $lock_positions)){
|
||||
$pos = $pos - 1;
|
||||
}
|
||||
$_positions[(int)$sale['id_sale']] = array(
|
||||
'initial' => (int)$sale['position'],
|
||||
'new' => $pos,
|
||||
);
|
||||
//Db::getInstance()->ExecuteS( 'UPDATE '._DB_PREFIX_.'privatesale SET position = '.$pos.' WHERE id_sale = '. $sale['id_sale']);
|
||||
}
|
||||
}else{
|
||||
$sales_sql = "SELECT id_sale, position FROM "._DB_PREFIX_."privatesale WHERE position BETWEEN ". $new_position . ' AND ' . ($position_initial - 1);
|
||||
} else {
|
||||
$sales_sql = "SELECT id_sale, position FROM "._DB_PREFIX_."privatesale WHERE position BETWEEN ". $new_position . ' AND ' . ($position_initial - 1).' AND lock_position = 0 ORDER BY position DESC';
|
||||
$sales = Db::getInstance()->ExecuteS($sales_sql);
|
||||
foreach ($sales as $key => $sale){
|
||||
Db::getInstance()->ExecuteS( 'UPDATE '._DB_PREFIX_.'privatesale SET position = (position + 1) WHERE id_sale = '. $sale['id_sale']);
|
||||
$pos = (int)$sale['position']+1;
|
||||
while(in_array($pos, $lock_positions)){
|
||||
$pos = $pos + 1;
|
||||
}
|
||||
$_positions[(int)$sale['id_sale']] = array(
|
||||
'initial' => (int)$sale['position'],
|
||||
'new' => $pos,
|
||||
);
|
||||
|
||||
//Db::getInstance()->ExecuteS( 'UPDATE '._DB_PREFIX_.'privatesale SET position = '.$position.' WHERE id_sale = '. $sale['id_sale']);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($_positions as $id => $value) {
|
||||
Db::getInstance()->ExecuteS( 'UPDATE '._DB_PREFIX_.'privatesale SET position = '. (int)$value['new'].' WHERE id_sale = '. $id);
|
||||
}
|
||||
// die(json_encode(array(
|
||||
// "position" => $position,
|
||||
// "position_initial" => $position_initial,
|
||||
// "new_position" => $new_position,
|
||||
// "sale_positions" => $_positions,
|
||||
// )));
|
||||
|
||||
Db::getInstance()->ExecuteS( 'UPDATE '._DB_PREFIX_.'privatesale SET position = '. (int)$new_position.' WHERE id_sale = '. $id_sale);
|
||||
|
||||
die();
|
||||
|
@ -7,8 +7,8 @@ $_MODULE['<{blockmyaccount}prestashop>blockmyaccount_0b9bc7f3bb601ef8959509352ae
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mi cuenta';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_74ecd9234b2a42ca13e775193f391833'] = 'Mis pedidos';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_89080f0eedbd5491a93157930f1e45fc'] = 'Mi mercancía devuelta';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_9132bc7bac91dd4e1c453d4e96edf219'] = 'Mis vales descuento';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_9132bc7bac91dd4e1c453d4e96edf219'] = 'Mis devoluciones';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_e45be0a0d4a0b62b15694c1a631e6e62'] = 'Mis direcciones';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_63b1ba91576576e6cf2da6fab7617e58'] = 'Mis datos personales';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_95d2137c196c7f84df5753ed78f18332'] = 'Mis vales';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_95d2137c196c7f84df5753ed78f18332'] = 'Mis devoluciones';
|
||||
$_MODULE['<{blockmyaccount}prestashop>blockmyaccount_c87aacf5673fada1108c9f809d354311'] = 'Cerrar sesión';
|
||||
|
@ -32,7 +32,7 @@ if(($sponsor = Tools::getValue('sponsor')) && strlen($sponsor) > 12) {
|
||||
}
|
||||
|
||||
if(!class_exists('AntTrackingTag')){
|
||||
include_once(_PS_MODULE_DIR_.'/ant_trackingtag/models/AntTrackingTag.php');
|
||||
require_once(_PS_MODULE_DIR_.'/ant_trackingtag/models/AntTrackingTag.php');
|
||||
}
|
||||
$tags = AntTrackingTag::getTags();
|
||||
$url_tag ='';
|
||||
|
@ -54,7 +54,7 @@ function phone_format($phone, $id_country = 8){
|
||||
// if (($i+1)%2==0)
|
||||
// $_phone .= ' ';
|
||||
// }
|
||||
$phone = $_phone;
|
||||
// $phone = $_phone;
|
||||
|
||||
// set format
|
||||
$phone = $prefix . substr($phone, 1);
|
||||
@ -112,8 +112,8 @@ $sql = '
|
||||
ON d.`id_order` = o.`id_order`
|
||||
LEFT JOIN `'._DB_PREFIX_.'customer` c
|
||||
ON c.`id_customer` = o.`id_customer`
|
||||
WHERE -- p.`date_add` > "'.pSQL($last_sync).'"
|
||||
d.`id_order_detail` IS NOT NULL
|
||||
WHERE p.`date_add` > "'.pSQL($last_sync).'"
|
||||
AND d.`id_order_detail` IS NOT NULL
|
||||
AND o.`id_order` IS NOT NULL
|
||||
GROUP BY p.`shipping_number`
|
||||
';
|
||||
@ -560,28 +560,28 @@ $mr_ftp_conf = Configuration::getMultiple(array(
|
||||
'MONDIALRELAYWS_FTP_PASSWORD'
|
||||
));
|
||||
|
||||
// $id_ftp = ftp_connect($mr_ftp_conf['MONDIALRELAYWS_FTP_HOST']);
|
||||
$id_ftp = ftp_connect($mr_ftp_conf['MONDIALRELAYWS_FTP_HOST']);
|
||||
|
||||
// if (!ftp_login($id_ftp, $mr_ftp_conf['MONDIALRELAYWS_FTP_LOGIN'], $mr_ftp_conf['MONDIALRELAYWS_FTP_PASSWORD']))
|
||||
// die('erreur lors de l\'identification FTP'.chr(10).chr(10));
|
||||
if (!ftp_login($id_ftp, $mr_ftp_conf['MONDIALRELAYWS_FTP_LOGIN'], $mr_ftp_conf['MONDIALRELAYWS_FTP_PASSWORD']))
|
||||
die('erreur lors de l\'identification FTP'.chr(10).chr(10));
|
||||
|
||||
// //activation du mode passif
|
||||
// // if (!ftp_pasv($id_ftp, true))
|
||||
// // die('erreur lors de l\'activation du mode passif'.chr(10).chr(10));
|
||||
|
||||
// $repo_dpc = dirname(__FILE__) . '/dpc/';
|
||||
// $mr_repo_in = 'versmrelay/';
|
||||
// //envoie du fichier
|
||||
// $list = scandir($repo_dpc);
|
||||
// foreach($list as $file)
|
||||
// {
|
||||
// if (!preg_match('/^dpc\..+\.txt$/', $file))
|
||||
// continue;
|
||||
// if ($file == '.' || $file == '..')
|
||||
// continue;
|
||||
// if (!ftp_put ($id_ftp, $mr_repo_in . $file, $repo_dpc . $file, FTP_BINARY))
|
||||
// print('erreur lors de l\'ouverture du fichier : ' . $file . chr(10));
|
||||
// else
|
||||
// unlink($repo_dpc . $file);
|
||||
// }
|
||||
// ftp_close($id_ftp);
|
||||
$repo_dpc = dirname(__FILE__) . '/dpc/';
|
||||
$mr_repo_in = 'versmrelay/';
|
||||
//envoie du fichier
|
||||
$list = scandir($repo_dpc);
|
||||
foreach($list as $file)
|
||||
{
|
||||
if (!preg_match('/^dpc\..+\.txt$/', $file))
|
||||
continue;
|
||||
if ($file == '.' || $file == '..')
|
||||
continue;
|
||||
if (!ftp_put ($id_ftp, $mr_repo_in . $file, $repo_dpc . $file, FTP_BINARY))
|
||||
print('erreur lors de l\'ouverture du fichier : ' . $file . chr(10));
|
||||
else
|
||||
unlink($repo_dpc . $file);
|
||||
}
|
||||
ftp_close($id_ftp);
|
@ -85,7 +85,7 @@ foreach ($iterator as $fileinfo) {
|
||||
LEFT JOIN `' . _DB_PREFIX_ . 'order_state_current` osc
|
||||
ON osc.`id_order` = d.`id_order`
|
||||
WHERE s.`expedition_number` IN (' . implode(', ', $expeditions) . ')
|
||||
AND osc.`id_order_state` IN (2, 3, 12, 13, 17, 25)
|
||||
AND osc.`id_order_state` IN (2, 3, 12, 13, 17)
|
||||
') as $row) {
|
||||
$expedition_shipping[$row['expedition_number']] = $row['shipping_number'];
|
||||
$expedition_orders[$row['expedition_number']] = (int) $row['id_order'];
|
||||
@ -173,6 +173,23 @@ foreach ($iterator as $fileinfo) {
|
||||
}
|
||||
}
|
||||
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT d.`id_order_detail`, IF(
|
||||
(d.`product_quantity` - IF(
|
||||
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
||||
) - IFNULL(SUM(s.`quantity`), 0)) > 0, 1, 0
|
||||
) AS `remain`
|
||||
FROM `'._DB_PREFIX_.'order_detail` d
|
||||
LEFT OUTER JOIN `'._DB_PREFIX_.'philea_parcel` s
|
||||
ON s.`id_order_detail` = d.`id_order_detail`
|
||||
WHERE d.`id_order` = '.(int) $order->id.'
|
||||
GROUP BY d.`id_order_detail`
|
||||
') as $quantity_remain) {
|
||||
if((int) $quantity_remain['remain'] == 0) {
|
||||
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
||||
}
|
||||
}
|
||||
|
||||
$remaining = array();
|
||||
foreach($order_details as $d) {
|
||||
if(!in_array($d, $products_sent)) {
|
||||
@ -243,8 +260,14 @@ foreach ($iterator as $fileinfo) {
|
||||
$content_txt = 'Contenu du colis :';
|
||||
}
|
||||
|
||||
if((int) $order->id_lang == 3) {
|
||||
$url = 'http://www.puntopack.es/seguir-mi-envio/?numeroExpedition='.$shipping_number;
|
||||
} else {
|
||||
$url = 'http://www.mondialrelay.fr/suivi-de-colis/?numeroExpedition='.$shipping_number;
|
||||
}
|
||||
|
||||
$templateVars = array(
|
||||
'{followup}' => str_replace('@', $shipping_number, $carrier->url),
|
||||
'{followup}' => $url,
|
||||
'{firstname}' => $customer->firstname,
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{id_order}' => (int) $order->id,
|
||||
|
@ -217,6 +217,11 @@ $_MODULE['<{mondialrelay}prestashop>settings_d02bbc3cb147c272b0445ac5ca7d1a36']
|
||||
$_MODULE['<{mondialrelay}prestashop>settings_ca57625685f058f54d82c6e05876a131'] = 'Choississez le statut pour la génération d\'étiquette.';
|
||||
$_MODULE['<{mondialrelay}prestashop>settings_c9cc8cce247e49bae79f15173ce97354'] = 'Sauvegarder';
|
||||
$_MODULE['<{mondialrelay}prestashop>settings_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
|
||||
$_MODULE['<{mondialrelay}prestashop>checkout_process_e0626222614bdee31951d84c64e5e9ff'] = 'Choisir';
|
||||
$_MODULE['<{mondialrelay}prestashop>checkout_process_91b442d385b54e1418d81adc34871053'] = 'Sélectionné';
|
||||
$_MODULE['<{mondialrelay}prestashop>checkout_process_ef2a1f426c2c289ed5986c7636a5d696'] = 'Veuillez choisir un point relais';
|
||||
$_MODULE['<{mondialrelay}prestashop>checkout_process_80a0c205cd57b22fca7f174253870300'] = 'Heures d\'ouvertures';
|
||||
$_MODULE['<{mondialrelay}prestashop>checkout_process_2b56b60f878922093facd42284848a0c'] = 'Infos';
|
||||
$_MODULE['<{mondialrelay}prestashop>checkout_process_836f6c949a2f2d61489bf410def82111'] = 'Mondialrelay ne peut récupérer les points relais du à une erreur de Prestashop';
|
||||
$_MODULE['<{mondialrelay}prestashop>checkout_process_widget_ad3d06d03d94223fa652babc913de686'] = 'Valider votre Point Relais®';
|
||||
$_MODULE['<{mondialrelay}prestashop>checkout_process_widget_b5cdf9b63fda35c33bb5e35cc3716b95'] = 'Point Relais® sélectionné :';
|
||||
|
@ -43,7 +43,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
|
||||
// List the marker liable to the relay pint
|
||||
var markerList = new Object();
|
||||
|
||||
|
||||
var selected = false;
|
||||
|
||||
/**
|
||||
@ -168,7 +168,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
$('#PS_MRLineOrderInformation-' + id_order).remove();
|
||||
$('#successCreatingTicket_' + id_order).fadeIn('slow');
|
||||
detailedExpeditionList.push({'id_order':id_order, 'expeditionNumber':json.success[id_order].expeditionNumber});
|
||||
|
||||
|
||||
if (!$('#detailHistory_' + id_order).length)
|
||||
{
|
||||
$('#PS_MRHistoriqueTableList').append('\
|
||||
@ -190,7 +190,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
}
|
||||
$('#successCreatingTicket_' + id_order).fadeOut('slow');
|
||||
}
|
||||
|
||||
|
||||
$('.PS_MRSubmitButton').css('display', 'block');
|
||||
}
|
||||
if(detailedExpeditionList.length)
|
||||
@ -256,7 +256,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
|
||||
checkErrorGeneratedTickets(json);
|
||||
detailedExpeditionList = checkSucceedGenerateTickets(json);
|
||||
|
||||
|
||||
if (detailedExpeditionList.length)
|
||||
getTickets(detailedExpeditionList);
|
||||
else
|
||||
@ -351,19 +351,19 @@ var PS_MRObject = (function($, undefined) {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function PS_MRSubmitButtonPrintSelected(format) {
|
||||
var history_id_list = new Array();
|
||||
var history_id_list_str = '';
|
||||
var history_id_list_str = '';
|
||||
$('input[name="history_id_list[]"]:checked').each(function()
|
||||
{
|
||||
var id_order = $.trim($(this).parent().next().html());
|
||||
var expeditionNumber = $.trim($(this).parent().next().next().html());
|
||||
history_id_list.push({'id_order':id_order, 'expeditionNumber':expeditionNumber});
|
||||
expeditionNumber = strPad(expeditionNumber,8,0);
|
||||
expeditionNumber = strPad(expeditionNumber,8,0);
|
||||
history_id_list_str += expeditionNumber+';';
|
||||
});
|
||||
|
||||
|
||||
if(history_id_list.length) {
|
||||
history_id_list_str = history_id_list_str.substr(0,(history_id_list_str.length-1));
|
||||
$.ajax(
|
||||
@ -377,17 +377,17 @@ var PS_MRObject = (function($, undefined) {
|
||||
'mrtoken' : mrtoken},
|
||||
dataType: 'json',
|
||||
success: function(json)
|
||||
{
|
||||
{
|
||||
var url = json.success[0];
|
||||
if(format == 4 && url!=null) {
|
||||
document.location.href= url.URL_PDF_A4;
|
||||
}
|
||||
if(format == 5 && url!=null) {
|
||||
document.location.href= url.URL_PDF_A5;
|
||||
}
|
||||
}
|
||||
if(format == '10x15' && url!=null) {
|
||||
document.location.href= url.URL_PDF_10x15;
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError)
|
||||
{
|
||||
@ -396,7 +396,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function strPad(input, length, string) {
|
||||
string = string || '0'; input = input + '';
|
||||
return input.length >= length ? input : new Array(length - input.length + 1).join(string) + input;
|
||||
@ -649,7 +649,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
* @param carrier_id
|
||||
*/
|
||||
function PS_MRDisplayRelayPoint(json, blockContent, carrier_id)
|
||||
{
|
||||
{
|
||||
if (typeof json != 'undefined' && typeof blockContent != 'undefined')
|
||||
{
|
||||
numberDisplayed = 0;
|
||||
@ -694,7 +694,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
PS_MROpenPopupDetail(json.success[relayPoint].permaLinkDetail);
|
||||
});*/
|
||||
}
|
||||
}
|
||||
}
|
||||
PS_MRHandleSelectedRelayPoint();
|
||||
$(this).fadeIn('fast');
|
||||
});
|
||||
@ -728,7 +728,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
*/
|
||||
function PS_MRFetchRelayPoint(carrierSelected)
|
||||
{
|
||||
carrier_id = carrierSelected.val().replace(',', '');
|
||||
carrier_id = carrierSelected.val().replace(',', '');
|
||||
// Block is an input, we need the 'tr' element
|
||||
blockTR =$('#MR_PR_list_'+carrier_id+' tr');
|
||||
// Add a new line to the table after the clicked parent element
|
||||
@ -811,6 +811,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
// present everytime in the page. Body is the only one sure.
|
||||
// It's an hidden block which will be put in the right block when user select his
|
||||
// own carrier
|
||||
return;
|
||||
$('body').prepend('\
|
||||
<tr id="PS_MRGmapDefaultPosition_' + id_carrier + '" class="PS_MRGmapDefaultPosition">\
|
||||
<td colspan="4"> \
|
||||
@ -1087,25 +1088,25 @@ var PS_MRObject = (function($, undefined) {
|
||||
if ($('#' + block_form_id).length == 0)
|
||||
$('#MR_error_account').fadeIn('fast');
|
||||
}
|
||||
|
||||
|
||||
function checkToDisplayRelayList()
|
||||
{
|
||||
{
|
||||
if (typeof PS_MRData != 'undefined')
|
||||
{
|
||||
PS_MRSelectedRelayPoint['relayPointNum'] = PS_MRData.pre_selected_relay;
|
||||
|
||||
PS_MRSelectedRelayPoint['relayPointNum'] = PS_MRData.pre_selected_relay;
|
||||
|
||||
if (PS_MRData.PS_VERSION < '1.5') {
|
||||
$('input[name="id_carrier"]').each(function(i, e){
|
||||
var parent_element = $(e).closest('tr');
|
||||
var new_element = 'MR_PR_list_'+$(e).val().replace(',', '');
|
||||
var MR_idcarrier = $(e).val().replace(',', '');
|
||||
MR_carrier = isMRCarrier(MR_idcarrier);
|
||||
|
||||
|
||||
if($('#'+new_element).length > 0) {
|
||||
$('#'+new_element).remove();
|
||||
$('#'+new_element).parent().parent().parent().remove();
|
||||
if( isMRCarrier(MR_idcarrier)!=false && typeof(MR_carrier) != "undefined" && (MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM')) {
|
||||
$(parent_element).after(
|
||||
'<tr><td colspan="10" style="border:0;"><div><table width="98%" id="'+new_element+'" class="trMRSelected" style="display:none;"><tr>'
|
||||
'<tr><td colspan="10" style="border:0;height: auto;"><div><table width="98%" id="'+new_element+'" class="trMRSelected" style="display:none;"><tr>'
|
||||
+ '<td style="border:0;"></td>'
|
||||
+'</tr></table></div>'
|
||||
+'</td></tr>'
|
||||
@ -1117,7 +1118,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
if(typeof(MR_carrier) != "undefined" && (MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM'))
|
||||
{
|
||||
$(parent_element).after(
|
||||
'<tr><td colspan="10" style="border:0;"><div><table width="98%" id="'+new_element+'" class="trMRSelected" style="display:none;"><tr>'
|
||||
'<tr><td colspan="10" style="border:0;height: auto;"><div><table width="98%" id="'+new_element+'" class="trMRSelected" style="display:none;"><tr>'
|
||||
+ '<td style="border:0;"></td>'
|
||||
+'</tr></table></div>'
|
||||
+'</td></tr>'
|
||||
@ -1125,23 +1126,23 @@ var PS_MRObject = (function($, undefined) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if($(e).attr('checked') == 'checked' || $(e).attr('checked')) {
|
||||
if(MR_carrier != false) {
|
||||
PS_MRCarrierMethodList[MR_idcarrier] = MR_carrier.id_mr_method;
|
||||
PS_MRSelectedRelayPoint['carrier_id'] = MR_idcarrier;
|
||||
PS_MRSelectedRelayPoint['carrier_id'] = MR_idcarrier;
|
||||
var new_element = 'MR_PR_list_'+MR_idcarrier;
|
||||
|
||||
|
||||
PS_MRCarrierSelectedProcess($(this), MR_idcarrier, MR_carrier.dlv_mode);
|
||||
|
||||
|
||||
if(MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM')
|
||||
$('.trMRSelected').fadeIn('fast');
|
||||
else
|
||||
$('.trMRSelected').fadeOut('fast');
|
||||
}
|
||||
else {
|
||||
PS_MRHideLastRelayPointList();
|
||||
else {
|
||||
PS_MRHideLastRelayPointList();
|
||||
PS_MRSelectedRelayPoint['relayPointNum'] = -1;
|
||||
$('.trMRSelected').fadeOut('fast');
|
||||
}
|
||||
@ -1172,24 +1173,24 @@ var PS_MRObject = (function($, undefined) {
|
||||
+'</tr></table></div>');
|
||||
}
|
||||
}
|
||||
|
||||
// Hide MR input if one of them is not selected
|
||||
|
||||
// Hide MR input if one of them is not selected
|
||||
if($(e).val() == carrier_selected)
|
||||
{
|
||||
if(MR_carrier != false) {
|
||||
PS_MRCarrierMethodList[MR_idcarrier] = MR_carrier.id_mr_method;
|
||||
PS_MRSelectedRelayPoint['carrier_id'] = MR_idcarrier;
|
||||
PS_MRSelectedRelayPoint['carrier_id'] = MR_idcarrier;
|
||||
var new_element = 'MR_PR_list_'+MR_idcarrier;
|
||||
|
||||
|
||||
PS_MRCarrierSelectedProcess($(this), MR_idcarrier, MR_carrier.dlv_mode);
|
||||
|
||||
|
||||
if(MR_carrier.dlv_mode!='LD1' && MR_carrier.dlv_mode!='LDS' && MR_carrier.dlv_mode!='HOM')
|
||||
$('.trMRSelected').fadeIn('fast');
|
||||
else
|
||||
$('.trMRSelected').fadeOut('fast');
|
||||
}
|
||||
else {
|
||||
PS_MRHideLastRelayPointList();
|
||||
else {
|
||||
PS_MRHideLastRelayPointList();
|
||||
PS_MRSelectedRelayPoint['relayPointNum'] = -1;
|
||||
$('.trMRSelected').fadeOut('fast');
|
||||
}
|
||||
@ -1198,7 +1199,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isMRCarrier(id_carrier){
|
||||
var carrier_list = PS_MRData.carrier_list;
|
||||
for(i in carrier_list){
|
||||
@ -1279,7 +1280,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
width = ((width - ul_width) / 2);
|
||||
$('#MR_config_menu').children('ul').css('margin-left', width + 'px');
|
||||
}
|
||||
|
||||
|
||||
// 1.5 OPC Validation - Warn user to select a relay point
|
||||
$('.payment_module a').live('click', function() {
|
||||
if (typeof PS_MRData != 'undefined')
|
||||
@ -1293,16 +1294,16 @@ var PS_MRObject = (function($, undefined) {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// If MR carrier selected, check MR relay point is selected too
|
||||
$('input[name=processCarrier], button[name=processCarrier]').click(function(){
|
||||
$('input[name=processCarrier], button[name=processCarrier]').click(function(){
|
||||
var _return = !(PS_MRSelectedRelayPoint['carrier_id'] && !PS_MRSelectedRelayPoint['relayPointNum']);
|
||||
if (!_return)
|
||||
alert(PS_MRTranslationList['errorSelection']);
|
||||
|
||||
|
||||
return _return;
|
||||
});
|
||||
|
||||
|
||||
if (typeof PS_MRData != 'undefined')
|
||||
{
|
||||
if (PS_MRData.PS_VERSION < '1.5') {
|
||||
@ -1311,7 +1312,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Handle input click of the other input to hide the previous relay point list displayed
|
||||
});
|
||||
|
||||
@ -1331,7 +1332,7 @@ var PS_MRObject = (function($, undefined) {
|
||||
|
||||
|
||||
/**
|
||||
* Check connexion to webservice *
|
||||
* Check connexion to webservice *
|
||||
*/
|
||||
function mr_checkConnexion() {
|
||||
var enseigne = $("#MR_enseigne_webservice").val();
|
||||
@ -1355,6 +1356,6 @@ function mr_checkConnexion() {
|
||||
else
|
||||
alert("Service Indisponible");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
@ -658,7 +658,7 @@ class MondialRelay extends Module
|
||||
));
|
||||
|
||||
|
||||
return $this->fetchTemplate('/views/templates/front/', 'header_widget');
|
||||
//return $this->fetchTemplate('/views/templates/front/', 'header_widget');
|
||||
|
||||
if (Configuration::get('MONDIAL_RELAY_MODE') == 'widget' && !_PS_MOBILE_)
|
||||
return $this->fetchTemplate('/views/templates/front/', 'header_widget');
|
||||
|
@ -24,7 +24,97 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
<style>
|
||||
#carrierTable table.trMRSelected td {
|
||||
background: #f1f1f1;
|
||||
}
|
||||
#carrierTable table.trMRSelected tr:first-child td, #carrierTable table.trMRSelected tr:first-child {
|
||||
display: none !important;
|
||||
}
|
||||
#carrierTable table.trMRSelected .PS_MRRelayPointInfo {
|
||||
margin-top: 10px;
|
||||
background: #ffffff;
|
||||
padding: 10px;
|
||||
}
|
||||
#carrierTable table.trMRSelected .PS_MRRelayPointInfo img {
|
||||
max-width: 10%;
|
||||
margin-right: 10%;
|
||||
display: block;
|
||||
float: left;
|
||||
padding:0px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#carrierTable table.trMRSelected .PS_MRRelayPointInfo p {
|
||||
width: 80%;
|
||||
float: left;
|
||||
text-align: justify;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
#carrierTable table.trMRSelected .PS_MRRelayPointInfo div:before {
|
||||
display: table;
|
||||
clear: both;
|
||||
content: " ";
|
||||
}
|
||||
#carrierTable table.trMRSelected .PS_MRRelayPointInfo div {
|
||||
text-align: center;
|
||||
}
|
||||
#carrierTable table.trMRSelected .PS_MRRelayPointInfo div a,
|
||||
#carrierTable table.trMRSelected .PS_MRRelayPointInfo div a.PS_MRSelectRelayPointButton {
|
||||
display: inline-block;
|
||||
color: #ffffff;
|
||||
background: #42b82f;
|
||||
font-size: 14px;
|
||||
padding: 10px 20px;
|
||||
text-decoration: none;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-ms-border-radius: 3px;
|
||||
-o-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
font-weight: bold;
|
||||
float: none;
|
||||
height: auto;
|
||||
width:auto;
|
||||
line-height: initial;
|
||||
margin-top:0;
|
||||
}
|
||||
.PS_MRRelayPointInfo .PS_MRFloatRelayPointSelected{
|
||||
background: none!important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
// Global JS Value
|
||||
var _PS_MR_MODULE_DIR_ = "{$new_base_dir|escape:'htmlall':'UTF-8'}";
|
||||
var mrtoken = "{$MRToken|escape:'htmlall':'UTF-8'}";
|
||||
var PS_MRMODE = "{$MR_MONDIAL_RELAY_MODE|escape:'htmlall':'UTF-8'}";
|
||||
var PS_MROPC = {$one_page_checkout|escape:'htmlall':'UTF-8'};
|
||||
var PS_MRTranslationList = [];
|
||||
var PS_MRCarrierMethodList = [];
|
||||
var PS_MRSelectedRelayPoint = {literal}{{/literal}'carrier_id': 0, 'relayPointNum': 0{literal}}{/literal};
|
||||
|
||||
PS_MRTranslationList['Select'] = "{l s='Select' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['Selected'] = "{l s='Selected' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['errorSelection'] = "{l s='Please choose a relay point' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['openingRelay'] = "{l s='Opening hours' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['moreDetails'] = "{l s='More details' mod='mondialrelay'}";
|
||||
</script>
|
||||
|
||||
{if isset($addJsInTemplate)}
|
||||
<!--On charge Google Map API-->
|
||||
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
|
||||
{/if}
|
||||
|
||||
|
||||
<!--On charge le widget mondial relay depuis leurs serveurs-->
|
||||
{if isset($page_name) && $page_name != 'module-mondialrelay-selection'}
|
||||
<script type="text/javascript" src="{$new_base_dir|escape:'htmlall':'UTF-8'}js/mondialrelay.js"></script>
|
||||
{/if}
|
||||
<script type="text/javascript" src="{$new_base_dir|escape:'htmlall':'UTF-8'}js/gmap.js"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
// Global JS Value
|
||||
var PS_MRData = {$MR_Data};
|
||||
{assign var=MR_Data value=$MR_Data|json_decode:1}
|
||||
|
@ -34,7 +34,7 @@
|
||||
var PS_MRTranslationList = [];
|
||||
var PS_MRCarrierMethodList = [];
|
||||
var PS_MRSelectedRelayPoint = {literal}{{/literal}'carrier_id': 0, 'relayPointNum': 0{literal}}{/literal};
|
||||
|
||||
|
||||
PS_MRTranslationList['Select'] = "{l s='Select' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['Selected'] = "{l s='Selected' mod='mondialrelay'}";
|
||||
PS_MRTranslationList['errorSelection'] = "{l s='Please choose a relay point' mod='mondialrelay'}";
|
||||
@ -43,12 +43,12 @@
|
||||
</script>
|
||||
|
||||
{if isset($addJsInTemplate)}
|
||||
<!--On charge Google Map API-->
|
||||
<!--On charge Google Map API-->
|
||||
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
|
||||
{/if}
|
||||
|
||||
|
||||
<!--On charge le widget mondial relay depuis leurs serveurs-->
|
||||
<!--On charge le widget mondial relay depuis leurs serveurs-->
|
||||
{if isset($page_name) && $page_name != 'module-mondialrelay-selection'}
|
||||
<script type="text/javascript" src="{$new_base_dir|escape:'htmlall':'UTF-8'}js/mondialrelay.js"></script>
|
||||
{/if}
|
||||
|
@ -23,13 +23,99 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<style>
|
||||
#fancybox-content {
|
||||
border: 0px;
|
||||
padding: 20px 10px;
|
||||
}
|
||||
#fancybox-content .MR-Widget {
|
||||
width: auto;
|
||||
height: 500px;
|
||||
margin: 0;
|
||||
border: 0 !important;
|
||||
background: none;
|
||||
}
|
||||
#fancybox-content .MRW-Title {
|
||||
font-size: 1.8em;
|
||||
position: absolute;
|
||||
top: -4px;
|
||||
left: 0;
|
||||
font-family: sans-serif !important;
|
||||
background: none;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
color: #777777;
|
||||
}
|
||||
#fancybox-content .MRW-Errors {
|
||||
position: absolute;
|
||||
top: 72px;
|
||||
width: 888px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
height: 20px !important;
|
||||
color: rgb(255, 51, 51);
|
||||
border: 1px solid rgb(255, 204, 204);
|
||||
background: rgb(255, 238, 238);
|
||||
}
|
||||
#fancybox-content .MR-Widget .MRW-Search {
|
||||
background-position: top right;
|
||||
margin: 0px 30px 0px 0px;
|
||||
padding: 25px 0px 0px 0px;
|
||||
text-align: left;
|
||||
height: 47px;
|
||||
}
|
||||
#fancybox-content .MRW-Results {
|
||||
padding: 0px;
|
||||
height: 493px !important;
|
||||
}
|
||||
#fancybox-content #MRW-Map {
|
||||
width: 400px !important;
|
||||
height: 400px !important;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-ms-border-radius: 3px;
|
||||
-o-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
border: 1px solid gainsboro;
|
||||
}
|
||||
#fancybox-content .MRW-RList {
|
||||
width: 280px !important;
|
||||
overflow: auto;
|
||||
background: #ffffff;
|
||||
border: 1px solid gainsboro;
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
-ms-border-radius: 3px;
|
||||
-o-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
max-height: 400px !important;
|
||||
font-family: sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
#fancybox-content .MRW-RList div {
|
||||
padding-left: 10px;
|
||||
}
|
||||
#fancybox-content .MRW-RList .PR-List-Item {
|
||||
border-bottom: 1px solid gainsboro;
|
||||
margin: 0;
|
||||
}
|
||||
#fancybox-content .MRW-RList .PR-Name {
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
</style>
|
||||
{if isset($addJsInTemplate)}
|
||||
<!--On charge Google Map API-->
|
||||
<!--On charge Google Map API-->
|
||||
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"></script>
|
||||
{/if}
|
||||
|
||||
<!--On charge le widget mondial relay depuis leurs serveurs-->
|
||||
<script type="text/javascript" src="{$new_base_dir|escape:'htmlall':'UTF-8'}js/jquery.plugin.mondialrelay.parcelshoppicker.2.0.0.js"></script>
|
||||
<!--On charge le widget mondial relay depuis leurs serveurs-->
|
||||
<script type="text/javascript" src="{$new_base_dir|escape:'htmlall':'UTF-8'}js/jquery.plugin.mondialrelay.parcelshoppicker.2.0.0.js"></script>
|
||||
<script type="text/javascript" src="{$new_base_dir|escape:'htmlall':'UTF-8'}js/mondialrelay_widget.js"></script>
|
||||
|
||||
|
||||
@ -42,7 +128,7 @@
|
||||
var PS_MRTranslationList = [];
|
||||
var PS_MRCarrierMethodList = [];
|
||||
var PS_MRSelectedRelayPoint = {literal}{{/literal}'carrier_id': 0, 'relayPointNum': 0{literal}}{/literal};
|
||||
|
||||
|
||||
PS_MRTranslationList['Select'] = "{l s='Select' mod='mondialrelay' js=1}";
|
||||
PS_MRTranslationList['Selected'] = "{l s='Selected' mod='mondialrelay' js=1}";
|
||||
PS_MRTranslationList['errorSelection'] = "{l s='Please choose a relay point' mod='mondialrelay' js=1}";
|
||||
|
@ -825,6 +825,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
success: function(html) {
|
||||
$('.list_vente').empty();
|
||||
$('.list_vente').html(html);
|
||||
sortable_active();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -852,6 +853,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
success: function(html) {
|
||||
$('.list_vente').empty();
|
||||
$('.list_vente').html(html);
|
||||
sortable_active();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -875,6 +877,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
success: function(html) {
|
||||
$('.list_vente').empty();
|
||||
$('.list_vente').html(html);
|
||||
sortable_active();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -911,6 +914,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
$("#saleActive").sortable({
|
||||
axis : "y",
|
||||
opacity : 0.6,
|
||||
cancel: ".not-sortable",
|
||||
start: function(event, ui) {
|
||||
initial_position = ui.item.index();
|
||||
},
|
||||
@ -927,6 +931,7 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
success: function(html) {
|
||||
var loader = "<p style=\"text-align:center\"><img style=\"display:inline-block;\" src=\"../img/loader_payment.gif\" /></p>";
|
||||
$(".list_vente").html(loader);
|
||||
|
||||
ajax_query();
|
||||
}
|
||||
});
|
||||
@ -1013,11 +1018,15 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
<td align="center">'. $sale->forward_news .'</td>
|
||||
|
||||
<td align="center" class="position">';
|
||||
if($key != 0){
|
||||
echo '<a href="" class="updatePosition" data-way="0" data-position='. $sale->position .'><img title="Haut" alt="Haut" src="../img/admin/up.gif"></a>';
|
||||
}
|
||||
if($key + 1 != count($sales)){
|
||||
echo ' <a href="" class="updatePosition" data-way="1" data-position='. $sale->position .'><img title="Bas" alt="Bas" src="../img/admin/down.gif"></a>';
|
||||
if($sale->lock_position == 1){
|
||||
echo '<span class="anticon anticon-lock"></span>';
|
||||
} else {
|
||||
if($key != 0){
|
||||
echo '<a href="" class="updatePosition" data-way="0" data-position='. $sale->position .'><img title="Haut" alt="Haut" src="../img/admin/up.gif"></a>';
|
||||
}
|
||||
if($key + 1 != count($sales)){
|
||||
echo ' <a href="" class="updatePosition" data-way="1" data-position='. $sale->position .'><img title="Bas" alt="Bas" src="../img/admin/down.gif"></a>';
|
||||
}
|
||||
}
|
||||
$category_link = Link::getCategoryLink($sale->id_category);
|
||||
$category_link_bo = '?tab=AdminCatalog&viewcategory&id_category='.$sale->id_category.'&token='.Tools::getAdminToken('AdminCatalog'.(int)(Tab::getIdFromClassName('AdminCatalog')).(int)($cookie->id_employee));
|
||||
@ -1046,6 +1055,11 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
<i class="glyphicon glyphicon-eye-open"></i> Voir Catégorie BO
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a style="cursor: pointer;" onclick="'.($sale->lock_position?'itemUnLockPosition('.$sale->id.')':'itemLockPosition('.$sale->id.')').'">
|
||||
<span class="anticon anticon-lock"></span> '.($sale->lock_position?'Défixer':'Fixer').' position
|
||||
</a>
|
||||
</li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<a style="cursor: pointer;" onclick="itemDeletion('.$sale->id.')">
|
||||
@ -1270,6 +1284,12 @@ class AdminPrivateSalesSales extends AdminTab {
|
||||
} elseif(isset($_GET['delete']) && $id_sale = Tools::getValue('id')) {
|
||||
Sale::deleteSale($id_sale);
|
||||
Tools::redirectAdmin($currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesSales'));
|
||||
} elseif(isset($_GET['lock_position']) && $id_sale = Tools::getValue('id')) {
|
||||
Sale::lockPosition($id_sale);
|
||||
Tools::redirectAdmin($currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesSales'));
|
||||
} elseif(isset($_GET['unlock_position']) && $id_sale = Tools::getValue('id')) {
|
||||
Sale::unlockPosition($id_sale);
|
||||
Tools::redirectAdmin($currentIndex.'&token='.Tools::getAdminTokenLite('AdminPrivateSalesSales'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ class Sale {
|
||||
var $new = 0;
|
||||
var $braderie = 0;
|
||||
var $forward_news = 0;
|
||||
var $lock_position = 0;
|
||||
var $id_category;
|
||||
var $id_employee = 0;
|
||||
var $shipping_fr = 0;
|
||||
@ -53,6 +54,7 @@ class Sale {
|
||||
$this->timelaps = $sale['timelaps'];
|
||||
$this->sale_type = $sale['sale_type'];
|
||||
$this->position = $sale['position'];
|
||||
$this->lock_position = $sale['lock_position'];
|
||||
$this->delivery_delay = $sale['delivery_delay'];
|
||||
$this->versions = $sale['versions'];
|
||||
}
|
||||
@ -98,6 +100,7 @@ class Sale {
|
||||
`id_employee` = '.(int) $this->id_employee.',
|
||||
`shipping_fr` = '.(int) $this->shipping_fr.',
|
||||
`delivery_delay` = '.(int) $this->delivery_delay.',
|
||||
`lock_position` = '.(int) $this->lock_position.',
|
||||
`date_upd` = NOW()
|
||||
WHERE `id_sale` = '.(int) $this->id.'
|
||||
');
|
||||
@ -112,7 +115,7 @@ class Sale {
|
||||
// ');
|
||||
// }
|
||||
|
||||
Db::getInstance()->ExecuteS('DELETE FROM `'._DB_PREFIX_.'privatesale_site_version`WHERE `id_sale` = '.(int) $this->id.'');
|
||||
Db::getInstance()->ExecuteS('DELETE FROM `'._DB_PREFIX_.'privatesale_site_version` WHERE `id_sale` = '.(int) $this->id.'');
|
||||
foreach($this->versions as $version) {
|
||||
Db::getInstance()->Execute('
|
||||
INSERT INTO `'._DB_PREFIX_.'privatesale_site_version` VALUES (
|
||||
@ -195,7 +198,8 @@ class Sale {
|
||||
NOW(),
|
||||
'.(int) $this->sale_type.',
|
||||
'.(int) $this->delivery_delay.',
|
||||
'.($position+1).'
|
||||
'.($position+1).',
|
||||
0
|
||||
)
|
||||
');
|
||||
$this->id = Db::getInstance()->Insert_ID();
|
||||
@ -281,6 +285,18 @@ class Sale {
|
||||
}
|
||||
}
|
||||
|
||||
public static function lockPosition($id) {
|
||||
if($sale = Sale::getSale($id)) {
|
||||
Db::getInstance()->ExecuteS( 'UPDATE '._DB_PREFIX_.'privatesale SET lock_position = 1 WHERE id_sale = '. $id);
|
||||
}
|
||||
}
|
||||
|
||||
public static function unlockPosition($id) {
|
||||
if($sale = Sale::getSale($id)) {
|
||||
Db::getInstance()->ExecuteS( 'UPDATE '._DB_PREFIX_.'privatesale SET lock_position = 0 WHERE id_sale = '. $id);
|
||||
}
|
||||
}
|
||||
|
||||
public static function rrmdir($dir) {
|
||||
if(is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
@ -326,6 +342,7 @@ class Sale {
|
||||
'braderie' => $ps[0]['braderie'],
|
||||
'forward_news' => $ps[0]['forward_news'],
|
||||
'position' => $ps[0]['position'],
|
||||
'lock_position' => $ps[0]['lock_position'],
|
||||
'id_category' => $ps[0]['id_category'],
|
||||
'id_employee' => $ps[0]['id_employee'],
|
||||
'shipping_fr' => $ps[0]['shipping_fr'],
|
||||
|
@ -15,3 +15,9 @@ function ImgDeletion(linkId, ImgId) {
|
||||
document.location.href = current_location + "&deleteImg=1&image=" + ImgId + "&id=" + linkId;
|
||||
}
|
||||
}
|
||||
function itemLockPosition(linkId) {
|
||||
document.location.href = current_location + "&id=" + linkId + "&lock_position=1";
|
||||
}
|
||||
function itemUnLockPosition(linkId) {
|
||||
document.location.href = current_location + "&id=" + linkId + "&unlock_position=1";
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ class AdminPrivateSalesLogistique extends AdminTab {
|
||||
WHERE l.`id_lang` = '.(int) $cookie->id_lang.'
|
||||
AND c.`id_parent` = 1
|
||||
ORDER BY c.id_category DESC
|
||||
LIMIT 500
|
||||
LIMIT 3000
|
||||
');
|
||||
$ids = array();
|
||||
foreach ($categories as $key => $category) {
|
||||
|
Loading…
Reference in New Issue
Block a user