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