[-] Classes : fixed bug #PSTEST-549 - Clean useless code

[-] BO : fixed bug on sorting feature on AdminOrdersController
// Clean code
This commit is contained in:
aFolletete
2012-01-31 14:34:59 +00:00
parent 3d119fb9dd
commit 4e4d2829fe
2 changed files with 20 additions and 7 deletions

View File

@@ -1956,9 +1956,23 @@ class AdminControllerCore extends Controller
throw new PrestaShopException(sprintf('Table name %s is invalid:', $this->table));
if (empty($order_by))
$order_by = $this->context->cookie->__get($this->table.'Orderby') ? $this->context->cookie->__get($this->table.'Orderby') : $this->_defaultOrderBy;
{
if ($this->context->cookie->{$this->table.'Orderby'})
$order_by = $this->context->cookie->{$this->table.'Orderby'};
elseif ($this->_orderBy)
$order_by = $this->_orderBy;
else
$order_by = $this->_defaultOrderBy;
}
if (empty($order_way))
$order_way = $this->context->cookie->__get($this->table.'Orderway') ? $this->context->cookie->__get($this->table.'Orderway') : $this->_defaultOrderWay;
{
if ($this->context->cookie->{$this->table.'Orderway'})
$order_way = $this->context->cookie->{$this->table.'Orderway'};
elseif ($this->_orderWay)
$order_way = $this->_orderWay;
else
$order_way = $this->_defaultOrderWay;
}
$limit = (int)Tools::getValue('pagination', $limit);
$this->context->cookie->{$this->table.'_pagination'} = $limit;