From b6799d4f2f35902eaf2244d510d696dee3a2bdc3 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Mon, 28 Oct 2013 11:57:27 +0100 Subject: [PATCH] [*] BO : download attachments directly from the list --- controllers/admin/AdminAttachmentsController.php | 11 +++++++++++ index.php | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminAttachmentsController.php b/controllers/admin/AdminAttachmentsController.php index 4a84892ae..89cdc3ece 100644 --- a/controllers/admin/AdminAttachmentsController.php +++ b/controllers/admin/AdminAttachmentsController.php @@ -37,6 +37,7 @@ class AdminAttachmentsControllerCore extends AdminController $this->lang = true; $this->addRowAction('edit'); + $this->addRowAction('view'); $this->addRowAction('delete'); $this->_select = 'IFNULL(virtual.products, 0) as products'; @@ -76,6 +77,16 @@ class AdminAttachmentsControllerCore extends AdminController parent::initPageHeaderToolbar(); } + public function renderView() + { + if (($obj = $this->loadObject(true)) && Validate::isLoadedObject($obj)) + { + $link = $this->context->link->getPageLink('attachment', true, NULL, 'id_attachment='.$obj->id); + Tools::redirectLink($link); + } + return $this->displayWarning($this->l('File not found')); + } + public function renderForm() { if (($obj = $this->loadObject(true)) && Validate::isLoadedObject($obj)) diff --git a/index.php b/index.php index 752254a40..fcef8576a 100644 --- a/index.php +++ b/index.php @@ -26,4 +26,3 @@ require(dirname(__FILE__).'/config/config.inc.php'); Dispatcher::getInstance()->dispatch(); -