[-] BO: OrderSlips should not be deleted && add icon to download pdfs on admin order slips

This commit is contained in:
rGaillard
2012-11-07 10:31:37 +00:00
parent 27014e8417
commit 21ae8e8538
2 changed files with 55 additions and 5 deletions
+25 -5
View File
@@ -31,8 +31,6 @@ class AdminSlipControllerCore extends AdminController
{
$this->table = 'order_slip';
$this->className = 'OrderSlip';
$this->addRowAction('delete');
$this->fields_list = array(
'id_order_slip' => array(
'title' => $this->l('ID'),
@@ -48,10 +46,18 @@ class AdminSlipControllerCore extends AdminController
'width' => 150,
'type' => 'date',
'align' => 'right'
)
);
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
),
'id_pdf' => array(
'title' => $this->l('PDF'),
'width' => 35,
'align' => 'center',
'callback' => 'printPDFIcons',
'orderby' => false,
'search' => false,
'remove_onclick' => true)
);
$this->_select = 'a.id_order_slip AS id_pdf';
$this->optionTitle = $this->l('Slip');
parent::__construct();
@@ -139,5 +145,19 @@ class AdminSlipControllerCore extends AdminController
'desc' => $this->l('Generate PDF file')
);
}
public function printPDFIcons($id_order_slip, $tr)
{
$order_slip = new OrderSlip((int)$id_order_slip);
if (!Validate::isLoadedObject($order_slip))
return '';
$this->context->smarty->assign(array(
'order_slip' => $order_slip,
'tr' => $tr
));
return $this->createTemplate('_print_pdf_icon.tpl')->fetch();
}
}