Bug 31654: Hide non-public libraries from MastheadLibraryPulldown (bug_31654_hide_nonpublic_libs)

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>
This commit is contained in:
Thomas Klausner 2022-10-05 12:14:31 +02:00 committed by Tomas Cohen Arazi
parent cbc2217e2c
commit de0f7c23ff
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 2 additions and 0 deletions

View file

@ -232,6 +232,7 @@
[% 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 %]

View file

@ -232,6 +232,7 @@
<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 %]