Bug 31654: Hide non-public libraries from MastheadLibraryPulldown (bug_31654_hide_non...
authorThomas Klausner <domm@plix.at>
Wed, 5 Oct 2022 10:14:31 +0000 (12:14 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 4 Nov 2022 22:24:14 +0000 (19:24 -0300)
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 <claude.demeure@mailo.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt

index c13f52f..8c3e857 100644 (file)
                                                         [% IF LibrarySearchGroups %]<optgroup label="Libraries">[% END %]
 
                                                         [% FOREACH library IN Branches.all( selected => opac_name ) %]
+                                                            [% NEXT UNLESS library.public %]
                                                             [% IF library.selected %]
                                                                 <option selected="selected" value="branch:[% library.branchcode | html %]">[% library.branchname | html %]</option>
                                                             [% ELSE %]
index b9dbe58..c669dca 100644 (file)
                                     <select name="limit" id="branchloop">
                                     <option value="">All libraries</option>
                                     [% FOREACH BranchesLoo IN Branches.all( selected => opac_name ) %]
+                                        [% NEXT UNLESS BranchesLoo.public %]
                                         [% IF BranchesLoo.selected %]
                                             <option value="branch:[% BranchesLoo.branchcode | html %]" selected="selected">[% BranchesLoo.branchname | html %]</option>
                                         [% ELSE %]