We have a few internal libraries (branches) that are used by librarians, but should not be visible to "normal" patrons (mostly because they cannot access those books). Currently there is no way to hide a library from the Masthead Pulldown or in the advanced search. Bug 27360 introduced the flag branches.public. This could be used to also hide the library from MastheadPulldown and the AdvancedSearch List. It seems that there is some additional / similar work going on in Bug 12242 Can we submit a patch that uses branches.public to hide libraries? Or should we wait what 27360 and 12242 will bring? Or can/should we also work on those tickets?
Created attachment 141123 [details] [review] do not list library in masthead and advanced search if branches.public is false (bug_31654_hide_nonpublic_libs)
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
This is something I'm interested in as well. I don't have time for it this week, but I could probably test/QA it next week.
Hey Thomas, This will be a nice addition! There are a few problems with your patch: FAIL koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc FAIL forbidden patterns forbidden pattern: tab char (line 235) * Commit title does not start with 'Bug XXXXX: ' - abec2a9a88 Can you make sure your commit title starts with "Bug 31654: " and have a look at the bad pattern in masthead.inc?
As you are just starting out: the QA tools script that points out these kind of errors can be run by everyone. On ktd it's just: 'qa -v 2'.
Created attachment 141335 [details] [review] 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
Hi Lucas! I now fixed the problems with the patch and submitted a new one. @Katrin Thanks for pointing out `qa-test-tools/koha-qa.pl` :-) Greetings, domm
Awesome, thanks Thomas! I did notice two things, neither of which are your fault. 1. Should we update the hint on branches.tt which currently reads "Set to 'yes' to show this library on the Libraries page in the OPAC." 2. I cannot set branches to public via administration. I filed a seperate bug for this: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31688
A temporary work around to making libraries not public until bug 31785 is in master (fixes MySQL strict mode issues) is to use SQL: update branches set public=0 where branchcode = XXX; Where XXX = code for library you want to make not public, such as CPL.
(In reply to David Nind from comment #9) > A temporary work around to making libraries not public until bug 31785 is in > master This has now been pushed to master, so you should now be able to make a library not public.
Created attachment 142514 [details] [review] 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 <claude.demeure@mailo.com>
*** Bug 12242 has been marked as a duplicate of this bug. ***
Created attachment 143117 [details] [review] 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>
Created attachment 143118 [details] [review] Bug 31654: (follow-up) Update hint This patch updates the 'public' hint to include the additional functionality we now tie to it. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Great work, QA scripts are happy and I added the minor follow-up to clarify the hint when enabled/disabling the public option. Passing QA
Pushed to master for 22.11. Nice work everyone, thanks!