fix page redirect when using filter in admin groups coustomer list

This commit is contained in:
shreesh arora
2021-01-21 16:33:51 +05:30
parent 6b7ef21e3a
commit 9dcbc64d6f

View File

@@ -53,40 +53,6 @@ class AdminGroupsControllerCore extends AdminController
Configuration::get('PS_CUSTOMER_GROUP')
);
$this->fields_list = array(
'id_group' => array(
'title' => $this->l('ID'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'name' => array(
'title' => $this->l('Group name'),
'filter_key' => 'b!name'
),
'reduction' => array(
'title' => $this->l('Discount (%)'),
'align' => 'right',
'type' => 'percent'
),
'nb' => array(
'title' => $this->l('Members'),
'align' => 'center',
'havingFilter' => true,
),
'show_prices' => array(
'title' => $this->l('Show prices'),
'align' => 'center',
'type' => 'bool',
'callback' => 'printShowPricesIcon',
'orderby' => false
),
'date_add' => array(
'title' => $this->l('Creation date'),
'type' => 'date',
'align' => 'right'
)
);
$this->addRowActionSkipList('delete', $groups_to_keep);
parent::__construct();
@@ -179,19 +145,17 @@ class AdminGroupsControllerCore extends AdminController
$this->action = 'change_show_prices_val';
}
if (Tools::getIsset('viewgroup')) {
$this->list_id = 'customer_group';
if (isset($_POST['submitReset'.$this->list_id])) {
$this->processResetFilters();
}
} else {
$this->list_id = 'group';
}
parent::initProcess();
}
public function postProcess()
{
if (isset($_POST['submitResetcustomer_group'])) {
$this->processResetFilters('customer_group');
}
return parent::postProcess();
}
public function renderView()
{
$this->context = Context::getContext();
@@ -598,6 +562,43 @@ class AdminGroupsControllerCore extends AdminController
$this->displayInformation($unidentified_group_information);
$this->displayInformation($guest_group_information);
$this->displayInformation($default_group_information);
$this->fields_list = array(
'id_group' => array(
'title' => $this->l('ID'),
'align' => 'center',
'class' => 'fixed-width-xs'
),
'name' => array(
'title' => $this->l('Group name'),
'filter_key' => 'b!name'
),
'reduction' => array(
'title' => $this->l('Discount (%)'),
'align' => 'right',
'type' => 'percent'
),
'nb' => array(
'title' => $this->l('Members'),
'align' => 'center',
'havingFilter' => true,
),
'show_prices' => array(
'title' => $this->l('Show prices'),
'align' => 'center',
'type' => 'bool',
'callback' => 'printShowPricesIcon',
'orderby' => false
),
'date_add' => array(
'title' => $this->l('Creation date'),
'type' => 'date',
'align' => 'right'
)
);
$this->processFilter();
return parent::renderList();
}