// Add check list filters value
This commit is contained in:
1 parent
b141975d57
commit
101df4c0b9
2 files changed
+30
-2
No files matched your search
@@ -72,6 +72,8 @@
|
|||||||
{hook h=$hookName}
|
{hook h=$hookName}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<div class="alert alert-warning" id="{$list_id}-empty-filters-alert" style="display:none;">{l s='Please fill at least one field to perform a search in this list.'}</div>
|
||||||
|
|
||||||
{if !$simple_header}
|
{if !$simple_header}
|
||||||
<form method="post" action="{$action}" class="form-horizontal">
|
<form method="post" action="{$action}" class="form-horizontal">
|
||||||
{block name="override_form_extra"}{/block}
|
{block name="override_form_extra"}{/block}
|
||||||
@@ -301,7 +303,7 @@
|
|||||||
<input type="hidden" id="submitFilter{$list_id}" name="submitFilter{$list_id}" value="0"/>
|
<input type="hidden" id="submitFilter{$list_id}" name="submitFilter{$list_id}" value="0"/>
|
||||||
<span class="pull-right">
|
<span class="pull-right">
|
||||||
{*Search must be before reset for default form submit*}
|
{*Search must be before reset for default form submit*}
|
||||||
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" />
|
<button type="submit" id="submitFilterButton{$list_id}" name="submitFilter" class="btn btn-default" data-list-id="{$list_id}">
|
||||||
<i class="icon-search"></i> {l s='Search'}
|
<i class="icon-search"></i> {l s='Search'}
|
||||||
</button>
|
</button>
|
||||||
{if $filters_has_value}
|
{if $filters_has_value}
|
||||||
|
|||||||
+27
-1
@@ -872,6 +872,33 @@ $(document).ready(function()
|
|||||||
|
|
||||||
bindTabModuleListAction();
|
bindTabModuleListAction();
|
||||||
|
|
||||||
|
//Check filters value on submit filter
|
||||||
|
$("[name='submitFilter']").click(function(event) {
|
||||||
|
var list_id = $(this).data('list-id');
|
||||||
|
var empty_filters = true;
|
||||||
|
|
||||||
|
$(document.body).find("input[name*='"+list_id+"Filter']").each(function() {
|
||||||
|
if ($(this).val() != '')
|
||||||
|
{
|
||||||
|
empty_filters = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document.body).find("select[name*='"+list_id+"Filter']").each(function() {
|
||||||
|
if ($(this).val() != '')
|
||||||
|
{
|
||||||
|
empty_filters = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (empty_filters)
|
||||||
|
{
|
||||||
|
event.preventDefault();
|
||||||
|
$('#'+list_id+'-empty-filters-alert').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -1078,4 +1105,3 @@ function sendBulkAction(form, action)
|
|||||||
|
|
||||||
$(form).submit();
|
$(form).submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user