[-] BO: OrderSlips should not be deleted && add icon to download pdfs on admin order slips
This commit is contained in:
1 parent
27014e8417
commit
21ae8e8538
2 files changed
+55
-5
No files matched your search
@@ -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 <contact@prestashop.com>
|
||||||
|
* @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 *}
|
||||||
|
<span style="width:20px; margin-right:5px;">
|
||||||
|
<a target="_blank" href="{$link->getAdminLink('AdminPdf')|escape:'htmlall':'UTF-8'}&submitAction=generateOrderSlipPDF&id_order_slip={$order_slip->id}"><img src="../img/admin/tab-invoice.gif" alt="order_slip" /></a>
|
||||||
|
</span>
|
||||||
@@ -31,8 +31,6 @@ class AdminSlipControllerCore extends AdminController
|
|||||||
{
|
{
|
||||||
$this->table = 'order_slip';
|
$this->table = 'order_slip';
|
||||||
$this->className = 'OrderSlip';
|
$this->className = 'OrderSlip';
|
||||||
$this->addRowAction('delete');
|
|
||||||
|
|
||||||
$this->fields_list = array(
|
$this->fields_list = array(
|
||||||
'id_order_slip' => array(
|
'id_order_slip' => array(
|
||||||
'title' => $this->l('ID'),
|
'title' => $this->l('ID'),
|
||||||
@@ -48,10 +46,18 @@ class AdminSlipControllerCore extends AdminController
|
|||||||
'width' => 150,
|
'width' => 150,
|
||||||
'type' => 'date',
|
'type' => 'date',
|
||||||
'align' => 'right'
|
'align' => 'right'
|
||||||
)
|
),
|
||||||
);
|
'id_pdf' => array(
|
||||||
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
'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');
|
$this->optionTitle = $this->l('Slip');
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
@@ -139,5 +145,19 @@ class AdminSlipControllerCore extends AdminController
|
|||||||
'desc' => $this->l('Generate PDF file')
|
'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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user