Lines 1-6
Link Here
|
1 |
[% USE raw %] |
1 |
[% USE raw %] |
2 |
[% USE Asset %] |
2 |
[% USE Asset %] |
|
|
3 |
[% USE AuthorisedValues %] |
3 |
[% PROCESS 'i18n.inc' %] |
4 |
[% PROCESS 'i18n.inc' %] |
|
|
5 |
[% SET status = AuthorisedValues.GetAuthValueDropbox('TICKET_STATUS') %] |
4 |
[% SET footerjs = 1 %] |
6 |
[% SET footerjs = 1 %] |
5 |
[% USE TablesSettings %] |
7 |
[% USE TablesSettings %] |
6 |
[% INCLUDE 'doc-head-open.inc' %] |
8 |
[% INCLUDE 'doc-head-open.inc' %] |
Lines 41-46
Link Here
|
41 |
<div class="page-section"> |
43 |
<div class="page-section"> |
42 |
<fieldset class="action filters" style="cursor:pointer;"> |
44 |
<fieldset class="action filters" style="cursor:pointer;"> |
43 |
<a id="resolved_filter" class="filtered"><i class="fa fa-bars"></i> Include resolved</a> |
45 |
<a id="resolved_filter" class="filtered"><i class="fa fa-bars"></i> Include resolved</a> |
|
|
46 |
[% FOR st IN status %] |
47 |
| <a id="[% st.authorised_value | html %]_filter"><i class="fa fa-filter"></i> Filter [% st.lib | html %]</a> |
48 |
[% END %] |
44 |
</fieldset> |
49 |
</fieldset> |
45 |
|
50 |
|
46 |
<table id="table_concerns"> |
51 |
<table id="table_concerns"> |
Lines 193-211
Link Here
|
193 |
}, |
198 |
}, |
194 |
}, table_settings, 1, additional_filters); |
199 |
}, table_settings, 1, additional_filters); |
195 |
|
200 |
|
196 |
var txtActivefilter = _("Filter resolved"); |
201 |
var txtActivefilter = _("Include resolved"); |
197 |
var txtInactivefilter = _("Include resolved"); |
202 |
var txtInactivefilter = _("Filter resolved"); |
198 |
$('#resolved_filter').on("click", function() { |
203 |
$('#resolved_filter').on("click", function() { |
199 |
if ($(this).hasClass('filtered')){ |
204 |
if ($(this).hasClass('filtered')){ |
200 |
filter_resolved = false; |
205 |
filter_resolved = false; |
201 |
$(this).html('<i class="fa fa-bars"></i> '+txtActivefilter); |
206 |
$(this).html('<i class="fa fa-filter"></i> '+txtActivefilter); |
202 |
} else { |
207 |
} else { |
203 |
filter_resolved = true; |
208 |
filter_resolved = true; |
204 |
$(this).html('<i class="fa fa-filter"></i> '+txtInactivefilter); |
209 |
$(this).html('<i class="fa fa-bars"></i> '+txtInactivefilter); |
205 |
} |
210 |
} |
206 |
tickets.DataTable().draw(); |
211 |
tickets.DataTable().draw(); |
207 |
$(this).toggleClass('filtered'); |
212 |
$(this).toggleClass('filtered'); |
208 |
}); |
213 |
}); |
|
|
214 |
|
215 |
[% FOR st IN status %] |
216 |
$('#[% st.authorised_value | html %]_filter').on("click", function() { |
217 |
if ($(this).hasClass('filtered')){ |
218 |
additional_filters.status.find((o, i) => { |
219 |
if (o["!="] === '[% st.authorised_value | html %]') { |
220 |
additional_filters.status.splice(i, 1); |
221 |
return true; // stop searching |
222 |
} |
223 |
}); |
224 |
if ( additional_filters.status.length === 1 ){ |
225 |
delete additional_filters.status; |
226 |
} |
227 |
$(this).html('<i class="fa fa-filter"></i> '+_("Filter ")+"[% st.lib | html %]"); |
228 |
} else { |
229 |
if (!additional_filters.hasOwnProperty("status")) { |
230 |
additional_filters.status = [ '-and' ]; |
231 |
} |
232 |
additional_filters.status.push({ '!=': "[% st.authorised_value | html %]" }); |
233 |
$(this).html('<i class="fa fa-bars"></i> '+_("Include ")+"[% st.lib | html %]"); |
234 |
} |
235 |
tickets.DataTable().draw(); |
236 |
$(this).toggleClass('filtered'); |
237 |
}); |
238 |
[% END %] |
209 |
}); |
239 |
}); |
210 |
</script> |
240 |
</script> |
211 |
[% Asset.js("js/modals/display_ticket.js") | $raw %] |
241 |
[% Asset.js("js/modals/display_ticket.js") | $raw %] |
212 |
- |
|
|