[*] BO : Added the number of associated products in the product attachments list

This commit is contained in:
Damien Metzger committed 2013-10-25 18:04:27 +02:00
1 parent aa322e4777
commit e9a802cf23
3 files changed
+11 -3

No files matched your search

@@ -39,6 +39,9 @@ class AdminAttachmentsControllerCore extends AdminController
$this->addRowAction('edit'); $this->addRowAction('edit');
$this->addRowAction('delete'); $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( $this->fields_list = array(
'id_attachment' => array( 'id_attachment' => array(
'title' => $this->l('ID'), 'title' => $this->l('ID'),
@@ -50,7 +53,12 @@ class AdminAttachmentsControllerCore extends AdminController
), ),
'file' => array( 'file' => array(
'title' => $this->l('File') 'title' => $this->l('File')
) ),
'products' => array(
'title' => $this->l('Associated to'),
'suffix' => $this->l('product(s)'),
'filter_key' => 'virtual!products',
),
); );
parent::__construct(); parent::__construct();
@@ -29,7 +29,7 @@ define ('TEXTAREA_SIZED', 70);
class AdminTranslationsControllerCore extends AdminController class AdminTranslationsControllerCore extends AdminController
{ {
/** Name of theme by default */ /** 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 */ /** @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'; protected $link_lang_pack = 'http://www.prestashop.com/download/lang_packs/get_each_language_pack.php';
+1 -1
View File
@@ -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)))); 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_')) 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.inc.php');
require_once(dirname(_PS_INSTALL_PATH_).'/config/defines_uri.inc.php'); require_once(dirname(_PS_INSTALL_PATH_).'/config/defines_uri.inc.php');