Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap
Conflicts: admin-dev/themes/default/template/controllers/customers/helpers/view/view.tpl admin-dev/themes/default/template/controllers/modules_positions/form.tpl admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl admin-dev/themes/default/template/controllers/products/input_text_lang.tpl admin-dev/themes/default/template/controllers/products/shipping.tpl admin-dev/themes/default/template/controllers/shipping/content.tpl admin-dev/themes/default/template/helpers/form/form.tpl admin-dev/themes/default/template/helpers/list/list_header.tpl admin-dev/themes/default/template/toolbar.tpl classes/helper/HelperList.php controllers/admin/AdminCategoriesController.php controllers/admin/AdminManufacturersController.php controllers/admin/AdminModulesPositionsController.php controllers/admin/AdminPerformanceController.php controllers/admin/AdminStockInstantStateController.php css/admin.css js/admin-products.js js/admin.js
This commit is contained in:
@@ -486,18 +486,21 @@ class HelperListCore extends Helper
|
||||
*/
|
||||
public function displayListHeader()
|
||||
{
|
||||
if (!isset($this->list_id))
|
||||
$this->list_id = $this->table;
|
||||
|
||||
$id_cat = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category');
|
||||
|
||||
if (!isset($token) || empty($token))
|
||||
$token = $this->token;
|
||||
|
||||
/* Determine total page number */
|
||||
if (isset($this->context->cookie->{$this->table.'_pagination'}) && $this->context->cookie->{$this->table.'_pagination'})
|
||||
$default_pagination = $this->context->cookie->{$this->table.'_pagination'};
|
||||
if (isset($this->context->cookie->{$this->list_id.'_pagination'}) && $this->context->cookie->{$this->list_id.'_pagination'})
|
||||
$default_pagination = $this->context->cookie->{$this->list_id.'_pagination'};
|
||||
else
|
||||
$default_pagination = $this->_pagination[0];
|
||||
|
||||
$total_pages = ceil($this->listTotal / Tools::getValue('pagination', ($default_pagination)));
|
||||
$total_pages = ceil($this->listTotal / Tools::getValue($this->list_id.'_pagination', ($default_pagination)));
|
||||
|
||||
if (!$total_pages)
|
||||
$total_pages = 1;
|
||||
@@ -510,14 +513,13 @@ class HelperListCore extends Helper
|
||||
$action = $this->currentIndex.$identifier.'&token='.$token.$order.'#'.$this->table;
|
||||
|
||||
/* Determine current page number */
|
||||
$page = (int)Tools::getValue('submitFilter'.$this->table);
|
||||
$page = (int)Tools::getValue('submitFilter'.$this->list_id);
|
||||
if (!$page)
|
||||
$page = 1;
|
||||
|
||||
/* Choose number of results per page */
|
||||
$selected_pagination = Tools::getValue(
|
||||
'pagination',
|
||||
isset($this->context->cookie->{$this->table.'_pagination'}) ? $this->context->cookie->{$this->table.'_pagination'} : null
|
||||
$selected_pagination = Tools::getValue($this->list_id.'_pagination',
|
||||
isset($this->context->cookie->{$this->list_id.'_pagination'}) ? $this->context->cookie->{$this->list_id.'_pagination'} : null
|
||||
);
|
||||
|
||||
// Cleaning links
|
||||
@@ -535,7 +537,7 @@ class HelperListCore extends Helper
|
||||
{
|
||||
if (!isset($params['type']))
|
||||
$params['type'] = 'text';
|
||||
$value = Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.(array_key_exists('filter_key', $params) && $key != 'active' ? $params['filter_key'] : $key)};
|
||||
$value = Context::getContext()->cookie->{$prefix.$this->list_id.'Filter_'.(array_key_exists('filter_key', $params) && $key != 'active' ? $params['filter_key'] : $key)};
|
||||
switch ($params['type'])
|
||||
{
|
||||
case 'bool':
|
||||
@@ -547,7 +549,7 @@ class HelperListCore extends Helper
|
||||
$value = Tools::unSerialize($value);
|
||||
if (!Validate::isCleanHtml($value[0]) || !Validate::isCleanHtml($value[1]))
|
||||
$value = '';
|
||||
$name = $this->table.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key);
|
||||
$name = $this->list_id.'Filter_'.(isset($params['filter_key']) ? $params['filter_key'] : $key);
|
||||
$name_id = str_replace('!', '__', $name);
|
||||
|
||||
$params['id_date'] = $name_id;
|
||||
@@ -559,9 +561,9 @@ class HelperListCore extends Helper
|
||||
case 'select':
|
||||
foreach ($params['list'] as $option_value => $option_display)
|
||||
{
|
||||
if (isset(Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']})
|
||||
&& Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']} == $option_value
|
||||
&& Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']} != '')
|
||||
if (isset(Context::getContext()->cookie->{$prefix.$this->list_id.'Filter_'.$params['filter_key']})
|
||||
&& Context::getContext()->cookie->{$prefix.$this->list_id.'Filter_'.$params['filter_key']} == $option_value
|
||||
&& Context::getContext()->cookie->{$prefix.$this->list_id.'Filter_'.$params['filter_key']} != '')
|
||||
$this->fields_list[$key]['select'][$option_value]['selected'] = 'selected';
|
||||
}
|
||||
break;
|
||||
@@ -620,7 +622,8 @@ class HelperListCore extends Helper
|
||||
'table_dnd' => isset($table_dnd) ? $table_dnd : null,
|
||||
'name' => isset($name) ? $name : null,
|
||||
'name_id' => isset($name_id) ? $name_id : null,
|
||||
'row_hover' => $this->row_hover
|
||||
'row_hover' => $this->row_hover,
|
||||
'list_id' => isset($this->list_id) ? $this->list_id : $this->table
|
||||
)));
|
||||
|
||||
return $this->header_tpl->fetch();
|
||||
|
||||
Reference in New Issue
Block a user