From c0c4831eb0a90ea7bcb1ed798cc7fe093988a5b9 Mon Sep 17 00:00:00 2001 From: gRoussac Date: Thu, 22 May 2014 16:31:55 +0200 Subject: [PATCH] [-] BO : Fix bug #PSCSX-2120, manufacturers orderby --- classes/controller/AdminController.php | 2 +- .../admin/AdminManufacturersController.php | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index a736a90c55e8b..1c8f320ff3db7 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -580,7 +580,7 @@ public function processFilter() } foreach ($_GET as $key => $value) - if (stripos($key, $this->list_id.'OrderBy') === 0 && Validate::isOrderBy($value)) + if (stripos($key, $this->list_id.'Orderby') === 0 && Validate::isOrderBy($value)) { if ($value === '' || $value == $this->_defaultOrderBy) unset($this->context->cookie->{$prefix.$key}); diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index d28ff177d960b..8959fb9d05957 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -37,8 +37,10 @@ public function __construct() $this->lang = false; $this->deleted = false; $this->allow_export = true; - $this->_orderBy = 'name'; - $this->_orderWay = 'ASC'; + $this->list_id = 'manufacturer'; + $this->identifier = 'id_manufacturer'; + $this->_defaultOrderBy = 'name'; + $this->_defaultOrderWay = 'ASC'; $this->bulk_actions = array( 'delete' => array( @@ -172,7 +174,7 @@ protected function getAddressFieldsList() 'manufacturer_name' => array( 'title' => $this->l('Manufacturer'), 'width' => 'auto', - 'filter_key' => 'm!name' + 'filter_key' => 'manufacturer_name' ), 'firstname' => array( 'title' => $this->l('First name') @@ -216,6 +218,10 @@ public function initListManufacturerAddresses() $this->list_id = 'address'; $this->identifier = 'id_address'; $this->deleted = true; + + $this->_defaultOrderBy = 'id_address'; + $this->_defaultOrderWay = 'ASC'; + $this->_orderBy = null; $this->addRowAction('editaddresses'); @@ -244,7 +250,7 @@ public function initListManufacturerAddresses() $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (a.`id_manufacturer` = m.`id_manufacturer`)'; - $this->_where = 'AND a.`id_customer` = 0 AND a.`id_supplier` = 0 AND a.`id_warehouse` = 0 AND a.`deleted`=0'; + $this->_where = 'AND a.`id_customer` = 0 AND a.`id_supplier` = 0 AND a.`id_warehouse` = 0 AND a.`deleted`= 0'; $this->context->smarty->assign('title_list', $this->l('Manufacturers addresses')); @@ -252,6 +258,7 @@ public function initListManufacturerAddresses() $this->postProcess(); $this->initToolbar(); + $this->content .= parent::renderList(); }