Merge branch 'ticket-simplemulti_invoice' into develop

This commit is contained in:
Marion Muszynski 2016-06-22 11:48:50 +02:00
commit 94dc4f3b40

View File

@ -156,7 +156,7 @@ class AdminInvoices extends AdminTab
<img src="../img/admin/pdf.gif" alt=""> <img src="../img/admin/pdf.gif" alt="">
</a> </a>
</td>*/ </td>*/
echo '<td align="center"><input id="multi_'. $sale['id_sale'].'" type="checkbox" name="multi2[]" value="'.$sale['id_sale'].'" /></td> echo '<td align="center"><input id="multi_'. $sale['id_sale'].'" type="checkbox" name="multi2[]" value="'.$sale['id_sale'].'" '.(isset($_COOKIE['checked_sale_'.(int)$sale['id_sale']])?'checked':'').'/></td>
<td align="center"> <td align="center">
<a onclick="this.target=\'_blank\'" href="'.$currentIndex.'&printAll=1&id_sale='. $sale['id_sale'] .'&token='.$this->token.'"> <a onclick="this.target=\'_blank\'" href="'.$currentIndex.'&printAll=1&id_sale='. $sale['id_sale'] .'&token='.$this->token.'">
<img src="../img/admin/pdf.gif" alt=""> <img src="../img/admin/pdf.gif" alt="">
@ -467,6 +467,12 @@ class AdminInvoices extends AdminTab
elseif (Tools::isSubmit('submitPrintM2Plus')) { elseif (Tools::isSubmit('submitPrintM2Plus')) {
include_once(dirname(__FILE__).'/../../modules/privatesales/Sale.php'); include_once(dirname(__FILE__).'/../../modules/privatesales/Sale.php');
$id_sales = Tools::getValue('multi2'); $id_sales = Tools::getValue('multi2');
// Save Sales as checked
foreach ($id_sales as $id) {
setcookie('checked_sale_'.(int)$id, (int)$id, time()+(60*60*24*360));
}
if (empty($id_sales) || (count($id_sales) < 2) ) { if (empty($id_sales) || (count($id_sales) < 2) ) {
$this->_errors[] = $this->l('You must select 2 sales minimum for print M2+'); $this->_errors[] = $this->l('You must select 2 sales minimum for print M2+');
} else { } else {