[-] BO : Filter modules system repaired and now in ajax
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11426 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
<div class="select-filter">
|
||||
<label class="search-filter">{l s='Sort by'}:</label>
|
||||
|
||||
<select name="module_type">
|
||||
<select name="module_type" id="module_type_filter">
|
||||
<option value="allModules" {if $showTypeModules eq 'allModules'}selected="selected"{/if}>{l s='All Modules'}</option>
|
||||
<option value="nativeModules" {if $showTypeModules eq 'nativeModules'}selected="selected"{/if}>{l s='Native Modules'}</option>
|
||||
<option value="partnerModules" {if $showTypeModules eq 'partnerModules'}selected="selected"{/if}>{l s='Partners Modules'}</option>
|
||||
@@ -49,19 +49,19 @@
|
||||
<option value="otherModules" {if $showTypeModules eq 'otherModules'}selected="selected"{/if}>{l s='Others Modules'}</option>
|
||||
</select>
|
||||
|
||||
<select name="module_install">
|
||||
<select name="module_install" id="module_install_filter">
|
||||
<option value="installedUninstalled" {if $showInstalledModules eq 'installedUninstalled'}selected="selected"{/if}>{l s='Installed & Uninstalled'}</option>
|
||||
<option value="installed" {if $showInstalledModules eq 'installed'}selected="selected"{/if}>{l s='Installed Modules'}</option>
|
||||
<option value="uninstalled" {if $showInstalledModules eq 'uninstalled'}selected="selected"{/if}>{l s='Uninstalled Modules'}</option>
|
||||
</select>
|
||||
|
||||
<select name="module_status">
|
||||
<select name="module_status" id="module_status_filter">
|
||||
<option value="enabledDisabled" {if $showEnabledModules eq 'enabledDisabled'}selected="selected"{/if}>{l s='Enabled & Disabled'}</option>
|
||||
<option value="enabled" {if $showEnabledModules eq 'enabled'}selected="selected"{/if}>{l s='Enabled Modules'}</option>
|
||||
<option value="disabled" {if $showEnabledModules eq 'disabled'}selected="selected"{/if}>{l s='Disabled Modules'}</option>
|
||||
</select>
|
||||
|
||||
<select name="country_module_value">
|
||||
<select name="country_module_value" id="country_module_value_filter">
|
||||
<option value="0" >{l s='All countries'}</option>
|
||||
<option value="1" {if $showCountryModules eq 1}selected="selected"{/if}>{l s='Current country:'} {$nameCountryDefault}</option>
|
||||
</select>
|
||||
|
||||
@@ -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}
|
||||
</script>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user