[*] PDF : PDF is now rendered by TCPDF throught HTML template

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10231 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fBrignoli
2011-11-17 17:15:23 +00:00
parent ab22eaf449
commit e5f3c3ca2a
33 changed files with 1917 additions and 213 deletions
+14 -10
View File
@@ -30,25 +30,29 @@ class PdfOrderSlipControllerCore extends FrontController
protected $display_header = false;
protected $display_footer = false;
protected $order_slip;
public function postProcess()
{
if (!$this->context->customer->isLogged())
Tools::redirect('index.php?controller=authentication&back=order-follow');
if (isset($_GET['id_order_slip']) && Validate::isUnsignedId($_GET['id_order_slip']))
$orderSlip = new OrderSlip($_GET['id_order_slip']);
$this->order_slip = new OrderSlip($_GET['id_order_slip']);
if (!isset($orderSlip) || !Validate::isLoadedObject($orderSlip))
die(Tools::displayError('Order return not found'));
else if ($orderSlip->id_customer != $this->context->customer->id)
if (!isset($this->order_slip) || !Validate::isLoadedObject($this->order_slip))
die(Tools::displayError('Order return not found'));
$order = new Order($orderSlip->id_order);
if (!Validate::isLoadedObject($order))
die(Tools::displayError('Order not found'));
else if ($this->order_slip->id_customer != $this->context->customer->id)
die(Tools::displayError('Order return not found'));
$order->products = OrderSlip::getOrdersSlipProducts((int)$orderSlip->id, $order);
$ref = null;
PDF::invoice($order, 'D', false, $ref, $orderSlip);
}
public function display()
{
$pdf = new PDF($this->order_slip, PDF::TEMPLATE_ORDER_SLIP, $this->context->smarty);
$pdf->render();
}
}