Skip to content

Commit

Permalink
[-] BO : Fix bug #PSCSX-2120, manufacturers orderby
Browse files Browse the repository at this point in the history
  • Loading branch information
gRoussac committed May 22, 2014
1 parent 1e2de2e commit c0c4831
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion classes/controller/AdminController.php
Expand Up @@ -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});
Expand Down
15 changes: 11 additions & 4 deletions controllers/admin/AdminManufacturersController.php
Expand Up @@ -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(
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -244,14 +250,15 @@ 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'));

// call postProcess() for take care about actions and filters
$this->postProcess();

$this->initToolbar();

$this->content .= parent::renderList();

}
Expand Down

0 comments on commit c0c4831

Please sign in to comment.