From 3ed79f502c49970c5356cc7571f7ceef4374819c Mon Sep 17 00:00:00 2001
From: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Date: Mon, 22 Apr 2024 15:53:57 +0000
Subject: [PATCH] Bug 36663: Hide specific inner elements, not the whole top
 pager container

1- Enable StaffDetailItemSelection
2- Visit a biblio page:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
3- Notice there are no table configuration options on the top right (Columns, Export, Configure).
4- Click the "Show filters" link, notice the table configuration options now show, as well as top and bottom pagers, column filter inputs and search input.
5- Disable StaffDetailItemSelection
6- Visit a biblio page:
http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
7- Notice that the table configurations options are visible, as well as top and bottom pagers, and search input.
8- Click the "Show filters" link, notice it now only governs the column filter inputs, the other elements mentioned in step 7 are always visible.
9- Apply patches, run yarn css:build
10- Repeat 1 and 2.
11- Notice the table configuration options are shown on the top right, and no other table options exist.

Further testing:
Test clicking hide/show filters
Test with StaffDetailItemSelection enabled/disabled
Test other datatables in other pages

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
---
 .../includes/html_helpers/tables/items/catalogue_detail.inc   | 4 +++-
 1 file changed, 3 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 4ce2888120..24f94a7ac4 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
@@ -809,7 +809,9 @@
                 if (!add_filters && settings._iRecordsDisplay == settings._iRecordsTotal && settings._iDisplayLength >= settings._iRecordsDisplay){
                     let container = $(this).parent();
                     container.find(".dt-info").remove();
-                    container.find(".top.pager").remove();
+                    container.find(".table_entries").remove();
+                    container.find(".dataTables_filter").remove();
+                    container.find(".dt_button_clear_filter").remove();
                     container.find(".bottom.pager").remove();
                 }
 
-- 
2.30.2