diff --git a/admin-dev/themes/template/modules/filters.tpl b/admin-dev/themes/template/modules/filters.tpl index 0d717c9e1..7a4dae8be 100644 --- a/admin-dev/themes/template/modules/filters.tpl +++ b/admin-dev/themes/template/modules/filters.tpl @@ -37,7 +37,7 @@
- @@ -49,19 +49,19 @@   -   -   - diff --git a/admin-dev/themes/template/modules/js.tpl b/admin-dev/themes/template/modules/js.tpl index fb5738d33..259ea5ab8 100644 --- a/admin-dev/themes/template/modules/js.tpl +++ b/admin-dev/themes/template/modules/js.tpl @@ -231,6 +231,52 @@ + // Method to set filter on modules + function setFilter() + { + var module_type = $("#module_type_filter").val(); + var module_install = $("#module_install_filter").val(); + var module_status = $("#module_status_filter").val(); + var country_module_value = $("#country_module_value_filter").val(); + try + { + resAjax = $.ajax({ + type:"POST", + url : ajaxCurrentIndex, + async: true, + data : { + ajax : "1", + token : token, + controller : "AdminModules", + action : "setFilter", + module_type : module_type, + module_install : module_install, + module_status : module_status, + country_module_value : country_module_value, + filterModules : 'Filter' + }, + success : function(data) + { + // res.status = cache or refresh + if (data == 'OK') + window.location.href = window.location.href; + }, + error: function(res,textStatus,jqXHR) + { + //alert("TECHNICAL ERROR"+res); + } + }); + } + catch(e){} + return false; + } + $('#module_type_filter').change(function() { setFilter(); }); + $('#module_install_filter').change(function() { setFilter(); }); + $('#module_status_filter').change(function() { setFilter(); }); + $('#country_module_value_filter').change(function() { setFilter(); }); + + + }); {/literal} diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 6661c5e7e..6c1aa3057 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -228,9 +228,14 @@ class AdminModulesControllerCore extends AdminController $this->initContent(); $this->context->smarty->display('modules/list.tpl'); - exit; + die('OK'); } + public function ajaxProcessSetFilter() + { + $this->setFilterModules(Tools::getValue('module_type'), Tools::getValue('country_module_value'), Tools::getValue('module_install'), Tools::getValue('module_status')); + die('OK'); + } @@ -881,9 +886,9 @@ class AdminModulesControllerCore extends AdminController $tpl_vars['autocompleteList'] = rtrim($autocompleteList, ' ,').'];'; $tpl_vars['showTypeModules'] = $this->filter_configuration['PS_SHOW_TYPE_MODULES_'.(int)$this->id_employee]; - $tpl_vars['showInstalledModules'] = $this->filter_configuration['PS_SHOW_COUNTRY_MODULES_'.(int)$this->id_employee]; - $tpl_vars['showEnabledModules'] = $this->filter_configuration['PS_SHOW_INSTALLED_MODULES_'.(int)$this->id_employee]; - $tpl_vars['showCountryModules'] = $this->filter_configuration['PS_SHOW_ENABLED_MODULES_'.(int)$this->id_employee]; + $tpl_vars['showCountryModules'] = $this->filter_configuration['PS_SHOW_COUNTRY_MODULES_'.(int)$this->id_employee]; + $tpl_vars['showInstalledModules'] = $this->filter_configuration['PS_SHOW_INSTALLED_MODULES_'.(int)$this->id_employee]; + $tpl_vars['showEnabledModules'] = $this->filter_configuration['PS_SHOW_ENABLED_MODULES_'.(int)$this->id_employee]; $tpl_vars['nameCountryDefault'] = Country::getNameById($this->context->language->id, Configuration::get('PS_COUNTRY_DEFAULT')); $tpl_vars['isoCountryDefault'] = $this->iso_default_country;