Bug 36742 - Do not show Libraries in OPAC menu if there is just one public library
Summary: Do not show Libraries in OPAC menu if there is just one public library
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
: 31817 (view as bug list)
Depends on: 30873
Blocks:
  Show dependency treegraph
 
Reported: 2024-05-01 11:33 UTC by Marcel de Rooy
Modified: 2024-07-02 15:17 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 36742: Do not show library selection options if there is one or fewer public libraries (19.11 KB, patch)
2024-06-28 15:43 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36742: Do not show library selection options if there is one or fewer public libraries (19.19 KB, patch)
2024-07-01 14:14 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 36742: (follow-up) Add hidden branchcode input for OPAC article requests (1.29 KB, patch)
2024-07-02 15:16 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2024-05-01 11:33:01 UTC
We are testing now for libraries>1 but we should check for the number of public libraries.
Comment 1 Marcel de Rooy 2024-05-01 12:04:07 UTC
This raises the question whether we are using singleBranchMode correctly.
That variable comes from a time that we did not have the possibility to mark a library non public or designate a library as pickup location or not.
Comment 2 Owen Leonard 2024-06-28 15:43:42 UTC
Created attachment 168267 [details] [review]
Bug 36742: Do not show library selection options if there is one or fewer public libraries

If a system has only one library or only one library which is public we
don't need to show library-selection menus. It doesn't make sense to
show a dropdown with only one choice.

This patch updates instances of Branches.all to add a "public => 1"
parameter.

To test, apply the patch and start with a set of multiple public
libraries in your system (where public means the entry in Administration
-> Libraries for that library has the "Public" option set to "Yes").

Log in to the OPAC test these pages, in each case confirming that the
the library dropdown appears correctly.

- OPAC home page (with OpacAddMastheadLibraryPulldown enabled)
- OPAC news section (with existing news items and OpacNewsLibrarySelect
  enabled)
- Advanced search (Location and availability section)
- The "Most popular" page (with OpacTopissue enabled)
- The suggestion entry form (with suggestion enabled)
- The article request entry form (with ArticleRequests enabled and
  circulation rules configured to allow requests)

Test again with only one library or only one public library.
Test again with no public libraries.

Sponsored-by: Athens County Public Libraries
Comment 3 Owen Leonard 2024-06-28 15:50:38 UTC
*** Bug 31817 has been marked as a duplicate of this bug. ***
Comment 4 Martin Renvoize 2024-07-01 11:16:03 UTC
sha1 failure again I'm afraid Owen :(
Comment 5 Owen Leonard 2024-07-01 11:29:47 UTC
(In reply to Martin Renvoize from comment #4)
> sha1 failure again I'm afraid Owen :(

Sorry, forgot to link the dependency
Comment 6 Jake Deery 2024-07-01 14:14:22 UTC
Created attachment 168317 [details] [review]
Bug 36742: Do not show library selection options if there is one or fewer public libraries

If a system has only one library or only one library which is public we
don't need to show library-selection menus. It doesn't make sense to
show a dropdown with only one choice.

This patch updates instances of Branches.all to add a "public => 1"
parameter.

To test, apply the patch and start with a set of multiple public
libraries in your system (where public means the entry in Administration
-> Libraries for that library has the "Public" option set to "Yes").

Log in to the OPAC test these pages, in each case confirming that the
the library dropdown appears correctly.

- OPAC home page (with OpacAddMastheadLibraryPulldown enabled)
- OPAC news section (with existing news items and OpacNewsLibrarySelect
  enabled)
- Advanced search (Location and availability section)
- The "Most popular" page (with OpacTopissue enabled)
- The suggestion entry form (with suggestion enabled)
- The article request entry form (with ArticleRequests enabled and
  circulation rules configured to allow requests)

Test again with only one library or only one public library.
Test again with no public libraries.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Jake Deery <jake.deery@ptfs-europe.com>
Comment 7 Jake Deery 2024-07-01 14:14:43 UTC
Really nice, Owen. All the pages you've mentioned work so far. I do see a library dropdown on /cgi-bin/koha/opac-memberentry.pl — both when logged in, and when logged out — as well as on the facets (holding libraries). I can also see holdings for non-public libraries within the record's holdings table.

Do we want to see non-public libraries here? This might not be a question in the scope of this bug, though.

Signed off with thanks
Comment 8 Owen Leonard 2024-07-01 19:48:13 UTC
(In reply to Jake Deery from comment #7)
> I do see a library dropdown on /cgi-bin/koha/opac-memberentry.pl

We have a preference for controlling which libraries go here. I wonder if that's enough?

> I can also see holdings for non-public libraries within the record's holdings
> table.

I'm not sure about this. We have OpacHiddenItems and 942n "Suppress in OPAC." Do we need another layer?
Comment 9 Jake Deery 2024-07-02 07:48:04 UTC
No — probably not, Owen. I wasn't familiar with either of these options, and they do exactly what you've described. I'll learn.

Nice one on this one, it'll be a nifty enhancement :-)
Comment 10 Marcel de Rooy 2024-07-02 12:01:18 UTC
Owen,
It seems that this changes makes a difference for e.g. article requests. I do not see any branch saved in the record anymore. This is in the 1 branch case.
Previously this branch was saved in the record.
That implies that you only see the request when looking for All libraries in staff. Can imagine that having no branch in the record is an unwished side-effect?
Comment 11 Owen Leonard 2024-07-02 15:16:38 UTC
Created attachment 168377 [details] [review]
Bug 36742: (follow-up) Add hidden branchcode input for OPAC article requests

This patch adds a hidden input containing the logged-in user's
branchcode to the article request form when there is only one public
branch.
Comment 12 Owen Leonard 2024-07-02 15:17:34 UTC
(In reply to Marcel de Rooy from comment #10)
> Can imagine that having no branch in the record is an unwished
> side-effect?

Agreed. I think it would cause confusion to have requests which were only visible if you viewed all libraries.