From 55030968980665bc003f86cd28247422b9eaa9d7 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Wed, 5 Oct 2022 12:14:31 +0200 Subject: [PATCH] Bug 31654: Hide non-public libraries from MastheadLibraryPulldown (bug_31654_hide_nonpublic_libs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not list library in masthead and advanced search if branches.public is false Test Plan: * Set OpacAddMastheadLibraryPulldown to "Add" * Go to Administration -> Libraries, edit "Fairfield", set "public" = "no" (at the end of the form) * Or connect to DB and run update branches set public = 0 where branchcode like 'F%'; This will set all three libraries starting with F to non-public * open OPAC * The "All libraries" Pulldown in the Header (between search slot and search button) still shows the non-public libraries * Go to OPAC -> Advanced Search, scroll to "Location and availability": The selectbox still shows the non-public libraries Now apply the patch * Open OPAC * The "All libraries" Pulldown in the Header now should not contain the libraries set to "public = no" * And in the Advanced Search "Location and availability" pulldown those libraries should also not be shown. Sponsored-by: Steiermärkische Landesbibliothek Signed-off-by: Claude Demeure Signed-off-by: Martin Renvoize --- koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 1 + koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 1 + 2 files changed, 2 insertions(+) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index c13f52f4dc..8c3e8575a7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -232,6 +232,7 @@ [% IF LibrarySearchGroups %][% END %] [% FOREACH library IN Branches.all( selected => opac_name ) %] + [% NEXT UNLESS library.public %] [% IF library.selected %] [% ELSE %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt index b9dbe58e23..c669dcaf32 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt @@ -232,6 +232,7 @@