Add cookie as global

This commit is contained in:
Michael RICOIS 2018-01-30 10:53:00 +01:00
parent 807fc023f3
commit 04399b0f6b
3 changed files with 12 additions and 8 deletions

View File

@ -44,7 +44,10 @@ $laposte_carriers = array_map('intval',explode(',', Configuration::get('ANT_CARR
$ooh = array_map('intval',explode(',', Configuration::get('ANT_CARRIERS_OOH')));
if(($id_order = (int) Tools::getValue('id_order'))
&& (Tools::getValue('token') === Tools::getAdminToken('AdminAntLogistic'.(int) Tab::getIdFromClassName('AdminAntLogistic').(int) Tools::getValue('id_employee')))) {
&& (Tools::getValue('token') === Tools::getAdminToken('AdminAntLogistic'.(int) Tab::getIdFromClassName('AdminAntLogistic').(int) Tools::getValue('id_employee')))) {
global $cookie;
$order = new Order($id_order);
$profile = Tools::getValue('id_profil');
if(Validate::isLoadedObject($order)) {

View File

@ -235,13 +235,13 @@ function checkEAN() {
ean_timeout = setTimeout(function() {
var eanval = $("#eaninput").val();
if (eanval != "") {
var eanval_item = $("#button_form tbody tr").filter(function() {
/* Select simple product */
var eanval_item = $("#button_form tbody tr").filter(function() {
if ($(this).attr("rel") != eanval) {
return $(this).attr("rel") == '0'+eanval;
}
return $(this).attr("rel") == eanval;
});
if (eanval_item.length > 0) {
$(eanval_item).each(function(id, el) {
var current_val = parseInt($(el).find(".shipped input").val());
@ -270,7 +270,9 @@ function checkEAN() {
}
}
});
} else {
}
/* Select pack product */
else {
var eanval_item_pack = $("#button_form tbody tr").filter(function() {
if ($(this).attr("rel") != eanval+'_pack') {
return $(this).attr("rel") == '0'+eanval+'_pack';
@ -278,12 +280,10 @@ function checkEAN() {
return $(this).attr("rel") == eanval+'_pack';
});
if (eanval_item_pack.length > 0) {
console.log(eanval_item_pack);
$(eanval_item_pack).each(function(id_pack, el_pack) {
var current_val = parseInt($(el_pack).find(".shipped input").val());
var max_val = parseInt($(el_pack).find(".toship strong").text());
if (current_val < max_val) {
console.log('qtyUp');
qtyUp($(el_pack).find(".shipped a")[0], max_val);
} else {
confirm("Quantité à envoyer déjà atteinte pour ce produit");

View File

@ -42,8 +42,9 @@ function stripaccents($str) {
$mr_carriers = array_map('intval',explode(',', Configuration::get('ANT_CARRIERS_MR')));
if(($id_order = (int) Tools::getValue('id_order'))
&& (Tools::getValue('token') === Tools::getAdminToken('AdminLogistics'.(int) Tab::getIdFromClassName('AdminLogistics').(int) Tools::getValue('id_employee')))) {
$order = new Order($id_order);
&& (Tools::getValue('token') === Tools::getAdminToken('AdminLogistics'.(int) Tab::getIdFromClassName('AdminLogistics').(int) Tools::getValue('id_employee')))) {
$order = new Order($id_order);
if(Validate::isLoadedObject($order)) {
$customer = Db::getInstance()->getRow('