@@ -, +, @@
---
.../prog/en/modules/cataloguing/concerns.tt | 38 +++++++++++++++++--
1 file changed, 34 insertions(+), 4 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt
@@ -1,6 +1,8 @@
[% USE raw %]
[% USE Asset %]
+[% USE AuthorisedValues %]
[% PROCESS 'i18n.inc' %]
+[% SET status = AuthorisedValues.GetAuthValueDropbox('TICKET_STATUS') %]
[% SET footerjs = 1 %]
[% USE TablesSettings %]
[% INCLUDE 'doc-head-open.inc' %]
@@ -41,6 +43,9 @@
@@ -193,19 +198,44 @@
},
}, table_settings, 1, additional_filters);
- var txtActivefilter = _("Filter resolved");
- var txtInactivefilter = _("Include resolved");
+ var txtActivefilter = _("Include resolved");
+ var txtInactivefilter = _("Filter resolved");
$('#resolved_filter').on("click", function() {
if ($(this).hasClass('filtered')){
filter_resolved = false;
- $(this).html(' '+txtActivefilter);
+ $(this).html(' '+txtActivefilter);
} else {
filter_resolved = true;
- $(this).html(' '+txtInactivefilter);
+ $(this).html(' '+txtInactivefilter);
}
tickets.DataTable().draw();
$(this).toggleClass('filtered');
});
+
+ [% FOR st IN status %]
+ $('#[% st.authorised_value | html %]_filter').on("click", function() {
+ if ($(this).hasClass('filtered')){
+ additional_filters.status.find((o, i) => {
+ if (o["!="] === '[% st.authorised_value | html %]') {
+ additional_filters.status.splice(i, 1);
+ return true; // stop searching
+ }
+ });
+ if ( additional_filters.status.length === 1 ){
+ delete additional_filters.status;
+ }
+ $(this).html(' '+_("Filter ")+"[% st.lib | html %]");
+ } else {
+ if (!additional_filters.hasOwnProperty("status")) {
+ additional_filters.status = [ '-and' ];
+ }
+ additional_filters.status.push({ '!=': "[% st.authorised_value | html %]" });
+ $(this).html(' '+_("Include ")+"[% st.lib | html %]");
+ }
+ tickets.DataTable().draw();
+ $(this).toggleClass('filtered');
+ });
+ [% END %]
});
[% Asset.js("js/modals/display_ticket.js") | $raw %]
--