diff --git a/admin-dev/themes/default/template/controllers/slip/_print_pdf_icon.tpl b/admin-dev/themes/default/template/controllers/slip/_print_pdf_icon.tpl new file mode 100755 index 000000000..3d5e614a6 --- /dev/null +++ b/admin-dev/themes/default/template/controllers/slip/_print_pdf_icon.tpl @@ -0,0 +1,30 @@ +{* +* 2007-2012 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 9589 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{* Generate HTML code for printing OrderSlip Icon with link *} + +order_slip + diff --git a/controllers/admin/AdminSlipController.php b/controllers/admin/AdminSlipController.php index 77e517c33..4b77d88ca 100644 --- a/controllers/admin/AdminSlipController.php +++ b/controllers/admin/AdminSlipController.php @@ -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(); + } }