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