From ce216aaa820037c5a37128d279e5747e7ee27055 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 30 Oct 2023 17:51:33 +0100 Subject: [PATCH] Bug 33568: Restore column filters when StaffDetailItemSelection is off MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Laurence Rault Signed-off-by: Emily Lamancusa Signed-off-by: Tomás Cohen Arazi Signed-off-by: Katrin Fischer --- .../tables/items/catalogue_detail.inc | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index ad07f341b7..1d3837c157 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -46,12 +46,11 @@ [% END %] [% BLOCK items_table %]
+ + Show filters + + [% IF (StaffDetailItemSelection) %] - - - Show filters - - | Select all | Clear all @@ -142,30 +141,37 @@ itemSelectionBuildActionLinks(tab_id); }); - $(".show_filters").on("click",function(e){ - e.preventDefault(); - let tab_id = $(this).data("tab"); - let tab = $("#"+tab_id); - tab.find(".show_filters").hide(); - tab.find(".hide_filters").show(); - $("#"+tab_id+"_table thead tr:eq(1)").remove(); - build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback ); - itemSelectionBuildActionLinks(tab_id); - }); + }); + [% END %] - $(".hide_filters").on("click",function(e){ - e.preventDefault(); - let tab_id = $(this).data("tab"); - let tab = $("#"+tab_id); - tab.find(".hide_filters").hide(); - tab.find(".show_filters").show(); - $("#"+tab_id+"_table thead tr:eq(1)").remove(); - build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback ); + + $(document).ready(function() { + $(".show_filters").on("click",function(e){ + e.preventDefault(); + let tab_id = $(this).data("tab"); + let tab = $("#"+tab_id); + tab.find(".show_filters").hide(); + tab.find(".hide_filters").show(); + $("#"+tab_id+"_table thead tr:eq(1)").remove(); + build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback ); + [% IF StaffDetailItemSelection %] itemSelectionBuildActionLinks(tab_id); - }); + [% END %] }); - [% END %] + $(".hide_filters").on("click",function(e){ + e.preventDefault(); + let tab_id = $(this).data("tab"); + let tab = $("#"+tab_id); + tab.find(".hide_filters").hide(); + tab.find(".show_filters").show(); + $("#"+tab_id+"_table thead tr:eq(1)").remove(); + build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback ); + [% IF StaffDetailItemSelection %] + itemSelectionBuildActionLinks(tab_id); + [% END %] + }); + }); const all_libraries = [% To.json(Branches.all) | $raw %]; const libraries_filters = all_libraries.map(e => { -- 2.39.5