From e9a802cf239f1467673432d5535f0ade73366a92 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 25 Oct 2013 18:04:27 +0200 Subject: [PATCH] [*] BO : Added the number of associated products in the product attachments list --- controllers/admin/AdminAttachmentsController.php | 10 +++++++++- controllers/admin/AdminTranslationsController.php | 2 +- install-dev/init.php | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminAttachmentsController.php b/controllers/admin/AdminAttachmentsController.php index 204da8649..f003bb303 100644 --- a/controllers/admin/AdminAttachmentsController.php +++ b/controllers/admin/AdminAttachmentsController.php @@ -39,6 +39,9 @@ class AdminAttachmentsControllerCore extends AdminController $this->addRowAction('edit'); $this->addRowAction('delete'); + $this->_select = 'IFNULL(virtual.products, 0) as products'; + $this->_join = 'LEFT JOIN (SELECT id_attachment, COUNT(*) as products FROM '._DB_PREFIX_.'product_attachment GROUP BY id_attachment) virtual ON a.id_attachment = virtual.id_attachment'; + $this->fields_list = array( 'id_attachment' => array( 'title' => $this->l('ID'), @@ -50,7 +53,12 @@ class AdminAttachmentsControllerCore extends AdminController ), 'file' => array( 'title' => $this->l('File') - ) + ), + 'products' => array( + 'title' => $this->l('Associated to'), + 'suffix' => $this->l('product(s)'), + 'filter_key' => 'virtual!products', + ), ); parent::__construct(); diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index dac578579..1eb5f34a0 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -29,7 +29,7 @@ define ('TEXTAREA_SIZED', 70); class AdminTranslationsControllerCore extends AdminController { /** Name of theme by default */ - const DEFAULT_THEME_NAME = 'default'; + const DEFAULT_THEME_NAME = 'default-bootstrap'; /** @var string : Link which list all pack of language */ protected $link_lang_pack = 'http://www.prestashop.com/download/lang_packs/get_each_language_pack.php'; diff --git a/install-dev/init.php b/install-dev/init.php index d55d22b87..32a325c7c 100644 --- a/install-dev/init.php +++ b/install-dev/init.php @@ -47,7 +47,7 @@ if (!defined('__PS_BASE_URI__')) define('__PS_BASE_URI__', substr($_SERVER['REQUEST_URI'], 0, -1 * (strlen($_SERVER['REQUEST_URI']) - strrpos($_SERVER['REQUEST_URI'], '/')) - strlen(substr(dirname($_SERVER['REQUEST_URI']), strrpos(dirname($_SERVER['REQUEST_URI']), '/') + 1)))); if (!defined('_THEME_NAME_')) - define('_THEME_NAME_', 'default'); + define('_THEME_NAME_', 'default-bootstrap'); require_once(dirname(_PS_INSTALL_PATH_).'/config/defines.inc.php'); require_once(dirname(_PS_INSTALL_PATH_).'/config/defines_uri.inc.php');