From 0e4b7fbd7240ff69cc25267e2afd362109ffdc3c Mon Sep 17 00:00:00 2001 From: rMalie Date: Thu, 11 Aug 2011 15:14:38 +0000 Subject: [PATCH] // Fix PDF controllers + order-detail template git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8039 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/PDF.php | 2 +- controllers/PdfInvoiceController.php | 7 +++++++ controllers/pdfOrderReturnController.php | 7 +++++++ controllers/pdfOrderSlipController.php | 7 +++++++ themes/prestashop/order-detail.tpl | 4 ++-- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/classes/PDF.php b/classes/PDF.php index 3cb9c399c..769479b5e 100644 --- a/classes/PDF.php +++ b/classes/PDF.php @@ -487,7 +487,7 @@ class PDFCore extends PDF_PageGroupCore if (!$context) $context = Context::getContext(); - if (!Validate::isLoadedObject($order) OR ((isset($context->employee) && !$context->employee->id) AND (!OrderState::invoiceAvailable($order->getCurrentState()) AND !$order->invoice_number))) + if (!Validate::isLoadedObject($order) OR (!Validate::isLoadedObject($context->employee) AND (!OrderState::invoiceAvailable($order->getCurrentState()) AND !$order->invoice_number))) die('Invalid order or invalid order state'); self::$order = $order; self::$orderSlip = $slip; diff --git a/controllers/PdfInvoiceController.php b/controllers/PdfInvoiceController.php index 39968dafb..2843e350c 100644 --- a/controllers/PdfInvoiceController.php +++ b/controllers/PdfInvoiceController.php @@ -27,6 +27,13 @@ class PdfInvoiceControllerCore extends FrontController { + public function run() + { + $this->init(); + $this->preProcess(); + $this->process(); + } + public function process() { parent::process(); diff --git a/controllers/pdfOrderReturnController.php b/controllers/pdfOrderReturnController.php index 5bfdbc6cf..ee559363f 100644 --- a/controllers/pdfOrderReturnController.php +++ b/controllers/pdfOrderReturnController.php @@ -27,6 +27,13 @@ class PdfOrderReturnControllerCore extends FrontController { + public function run() + { + $this->init(); + $this->preProcess(); + $this->process(); + } + public function process() { parent::process(); diff --git a/controllers/pdfOrderSlipController.php b/controllers/pdfOrderSlipController.php index 7b22590c8..0265dd3cb 100644 --- a/controllers/pdfOrderSlipController.php +++ b/controllers/pdfOrderSlipController.php @@ -27,6 +27,13 @@ class PdfOrderSlipControllerCore extends FrontController { + public function run() + { + $this->init(); + $this->preProcess(); + $this->process(); + } + public function process() { parent::process(); diff --git a/themes/prestashop/order-detail.tpl b/themes/prestashop/order-detail.tpl index 0a0eabede..1cd103e9e 100644 --- a/themes/prestashop/order-detail.tpl +++ b/themes/prestashop/order-detail.tpl @@ -77,9 +77,9 @@

{if $is_guest} - id&secure_key=$order->secure_key")}" >{l s='Download your invoice as a .PDF file'} + id}&secure_key=$order->secure_key")}" >{l s='Download your invoice as a .PDF file'} {else} - id")}" >{l s='Download your invoice as a .PDF file'} + id}")}" >{l s='Download your invoice as a .PDF file'} {/if}

{/if}