Merge branch 'fix-ticket-10169' into develop

This commit is contained in:
Marion Muszynski 2016-09-01 11:18:03 +02:00
commit 90a847db2b

View File

@ -225,12 +225,12 @@ class AdminLogistics extends AdminTab {
Tools::redirectLink('http://'.$_SERVER['SERVER_NAME'].'/adm/index.php?tab=AdminLogistics&token='.Tools::getAdminTokenLite('AdminLogistics').'&id_order='.(int) Tools::getValue('id_order').'&mode='.Tools::getValue('mode', '').'#'.Tools::getValue('mode', ''));
}
if( (Tools::isSubmit('submitReprintShip') || Tools::isSubmit('submitReprintShip2'))
&& ((int) $cookie->profile == 1 || (int) $cookie->profile == 9 || (int) $cookie->profile == 7)
if( (Tools::isSubmit('submitReprintShip'))
&& ((int) $cookie->profile == 1 || (int) $cookie->profile == 9 || (int) $cookie->profile == 7)
&& (
($id_order = Tools::getValue('id_order'))
&& ($products = Tools::getValue('products'))
&& ($parcel_carrier = Tools::getValue('carrier'))
($id_order = Tools::getValue('id_order_reprint'))
&& ($products = Tools::getValue('products_reprint'))
&& ($parcel_carrier = Tools::getValue('carrier_reprint'))
)
) {
$weight = 0.24;
@ -673,9 +673,9 @@ class AdminLogistics extends AdminTab {
<td class="center"><input type="checkbox" name="product_ids[]" value="\' + loaded.products[i].product_id + \'" \' + (loaded.products[i].is_pending>0? \'checked disabled\':\'\') + \'/></td>\
<td class="shipped">\';
if (loaded.products[i].id_shipping != 2
|| (loaded.products[i].id_shipping == 2
&& '.( ($cookie->profile == 1 || $cookie->profile == 7) ? 'true': 'false').') )
if (loaded.products[i].id_shipping != 2
|| (loaded.products[i].id_shipping == 2
&& '.( ($cookie->profile == 1 || $cookie->profile == 7) ? 'true': 'false').') )
{
content += \'<input readonly="true" onchange="checkParcelCarrier($(this));" name="shipped[\' + loaded.products[i].id_order_detail + \']" type="text" value="\' + /*(loaded.products[i].id_shipping == 2? \'0\': ($.inArray(loaded.products[i].product_id, locked_products) != -1? \'0\': (loaded.products[i].product_quantity - (loaded.products[i].product_quantity_refunded > 0? loaded.products[i].product_quantity_refunded: loaded.products[i].product_quantity_return) - loaded.products[i].product_quantity_sent > 0? loaded.products[i].product_quantity - (loaded.products[i].product_quantity_refunded > 0? loaded.products[i].product_quantity_refunded: loaded.products[i].product_quantity_return) - loaded.products[i].product_quantity_sent: \'0\'))) +*/ \'0" autocomplete="off" /><span class="qtyblock"><a onclick="qtyUp($(this), \' + ($.inArray(loaded.products[i].product_id, locked_products) != -1? 0: Math.max((loaded.products[i].product_quantity - (loaded.products[i].product_quantity_refunded > 0? loaded.products[i].product_quantity_refunded: loaded.products[i].product_quantity_return) - loaded.products[i].product_quantity_sent), 0)) + \'); return false;">+</a><a onclick="qtyDown($(this)); return false;">-</a></span>\';
}
@ -740,59 +740,17 @@ class AdminLogistics extends AdminTab {
content += \'\
<div id="form-reprint-label">\
<form id="form_reprint" method="POST" action="'.str_replace(array('&mode=&mode=', '&mode=0&mode=0', '&mode=1&mode=1'), array('&mode=', '&mode=0', '&mode=1'), preg_replace('/\&id_order=[0-9]+/', '', $_SERVER['REQUEST_URI'])).'&mode=\' + window.location.hash.replace(\'#\', \'\') + \'&id_order=\' + loaded.order.id + window.location.hash + \'">\
<fieldset style="margin-top:30px;">\
<legend>'.$this->l('Print another Label').'</legend>\
<p> <label>'.$this->l('Product:').'</label> <span id="product-name"></span></p>\
<p> <label>'.$this->l('Ref:').'</label> <span id="product-ref"></span></p>\
<p> <label for="products">'.$this->l('Quantity:').'</label> <input type="text" value="\' + \'1\' + \'" name="products[]" id="quantity-reprint" /></p>\
<input type="hidden" value="laposte" name="carrier" id="carrier-reprint" />\
<input type="hidden" value="0" name="id_order" id="id_order-reprint" />\
<p style="padding-left: 200px;"> <input id="button5" type="submit" class="button" name="submitReprintShip" value="'.addslashes($this->l('Register the parcel and print the label')).'"> </p>\
</fieldset>\
</form>\
<fieldset style="margin-top:30px;">\
<legend>'.$this->l('Print another Label').'</legend>\
<p> <label>'.$this->l('Product:').'</label> <span id="product-name"></span></p>\
<p> <label>'.$this->l('Ref:').'</label> <span id="product-ref"></span></p>\
<p> <label for="products">'.$this->l('Quantity:').'</label> <input type="text" value="\' + \'1\' + \'" name="products_reprint[]" id="quantity-reprint" /></p>\
<input type="hidden" value="laposte" name="carrier_reprint" id="carrier-reprint" />\
<input type="hidden" value="0" name="id_order_reprint" id="id_order-reprint" />\
<p style="padding-left: 200px;"> <input id="button5" type="submit" class="button" name="submitReprintShip" value="'.addslashes($this->l('Register the parcel and print the label')).'"> </p>\
</fieldset>\
\
</div>\';
content += \'\
'.(((int) $cookie->profile == 1 || (int) $cookie->profile == 9 || (int) $cookie->profile == 7)?
'<!--a id="reprint_label2" class="button" data-id_order="\' + loaded.order.id + \'">'.$this->l('Print another Label (multi products)').'</a-->': '').'\';
content += \'\
<!--div id="form-reprint-labels">\
<form id="form_reprint2" method="POST" action="'.str_replace(array('&mode=&mode=', '&mode=0&mode=0', '&mode=1&mode=1'), array('&mode=', '&mode=0', '&mode=1'), preg_replace('/\&id_order=[0-9]+/', '', $_SERVER['REQUEST_URI'])).'&mode=\' + window.location.hash.replace(\'#\', \'\') + \'&id_order=\' + loaded.order.id + window.location.hash + \'">\
<fieldset>\
<legend>'.$this->l('Print another Label - choose your products').'</legend>\
<table class="logs">\
<thead>\
<tr>\
<th>'.$this->l('Product').'</th>\
<th>'.$this->l('Reference').'</th>\
<th>'.$this->l('Quantity sent').'</th>\
<th>'.$this->l('Carrier').'</th>\
<th>'.$this->l('Quantity to send').'</th>\
</tr>\
</thead>\
<tbody>\';
for(var i=0; i < loaded.products.length; i++) {
content += \'<tr>\
<td>\' + loaded.products[i].product_name.replace(" - ", "<br />") + \'</td>\
<td>\' + loaded.products[i].product_reference + \'</td>\
<td>\' + loaded.products[i].quantity + \'</td>\
<td>\' + carriers[loaded.products[i].carrier] + \'</td>\
<td><input name="products[\' + loaded.products[i].id_order_detail + \']" type="text" value="0" autocomplete="off" /></td>\
</tr>\';
}
content += \'\
</tbody></table>\
<p> <label for="weight">'.$this->l('Weight:').'</label> <input type="text" value="\' + \'0\' + \'" name="weight" id="weight-reprint2" /> kg </p>\
<input type="hidden" value="laposte" name="carrier" id="carrier-reprint2" />\
<input type="hidden" value="0" name="id_order" id="id_order-reprint2" />\
<p style="padding-left: 200px;"> <input id="button6" type="submit" class="button" name="submitReprintShip2" value="'.addslashes($this->l('Register the parcel and print the label')).'"> </p>\
</fieldset>\
</form>\
\
</div-->\';
}
';
@ -838,7 +796,7 @@ class AdminLogistics extends AdminTab {
$("span#product-ref").text($(this).data("ref"));
$("#carrier-reprint").val($(this).data("carrier"));
$("#id_order-reprint").val($(this).data("id_order"));
$("#quantity-reprint").attr("name","products["+$(this).data("id_order_detail")+"]");
$("#quantity-reprint").attr("name","products_reprint["+$(this).data("id_order_detail")+"]");
/*$("#form-reprint-labels").hide();*/
$("#form-reprint-label").show();