From c46e1da54fff948a3b0b1953bfca23e78940fe30 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 20 Jul 2023 09:16:29 +0200 Subject: [PATCH] Bug 33568: Fix 'actions' links when filters are shown/hidden MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It also fixes a problem when "Select all" was clicked, the checkbox selection was not kept when the table was refreshed (was comparing string and integer, parseInt needed) Signed-off-by: Owen Leonard Signed-off-by: Laurence Rault Signed-off-by: Emily Lamancusa Signed-off-by: Tomás Cohen Arazi Signed-off-by: Katrin Fischer --- .../includes/html_helpers/tables/items/catalogue_detail.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 5e9daedd7b..f03eb3a776 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 @@ -123,7 +123,8 @@ let tab_id = $(this).data("tab"); let tab = $("#"+tab_id); tab.find("input[name='itemnumber'][type='checkbox']").each( (i, input) => { - items_selection[tab_id].push($(input).val()); + let itemnumber = parseInt($(input).val()); + items_selection[tab_id].push(itemnumber); $(input).prop('checked', true); }); itemSelectionBuildActionLinks(tab_id); @@ -146,6 +147,7 @@ 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); }); $(".hide_filters").on("click",function(e){ @@ -156,6 +158,7 @@ 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 ); + itemSelectionBuildActionLinks(tab_id); }); }); [% END %] -- 2.39.5