Bug 30077 - Add option for library dropdown in search function for staff interface
Summary: Add option for library dropdown in search function for staff interface
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
: 29615 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-02-10 21:57 UTC by Donna
Modified: 2023-12-28 20:42 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/661
Text to go in the release notes:
With the new system preference IntranetCatalogSearchPulldown enabled, you will be able to limit your simple searches in the staff interface by library.
Version(s) released in:
22.11.00


Attachments
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown (4.86 KB, patch)
2022-02-10 23:49 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown (5.75 KB, patch)
2022-02-11 16:16 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown (5.78 KB, patch)
2022-03-09 17:49 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown (5.84 KB, patch)
2022-03-10 12:10 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 30077: (follow-up) retain branch selection (2.78 KB, patch)
2022-04-05 23:06 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 30077: (follow-up) Set max width for library drapdown (1.10 KB, patch)
2022-04-06 14:21 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown (5.89 KB, patch)
2022-06-01 09:45 UTC, David Nind
Details | Diff | Splinter Review
Bug 30077: (follow-up) retain branch selection (2.83 KB, patch)
2022-06-01 09:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 30077: (follow-up) Set max width for library drapdown (1.15 KB, patch)
2022-06-01 09:46 UTC, David Nind
Details | Diff | Splinter Review
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown (5.93 KB, patch)
2022-07-26 15:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30077: (follow-up) retain branch selection (2.83 KB, patch)
2022-07-26 15:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30077: (follow-up) Set max width for library drapdown (1.15 KB, patch)
2022-07-26 15:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown (5.99 KB, patch)
2022-07-30 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30077: (follow-up) retain branch selection (2.88 KB, patch)
2022-07-30 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30077: (follow-up) Set max width for library drapdown (1.21 KB, patch)
2022-07-30 21:02 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30077: (QA follow-up) Avoid warning (843 bytes, patch)
2022-08-01 17:49 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Donna 2022-02-10 21:57:24 UTC
The functionality of OpacAddMastheadLibraryPulldown would be helpful to have on the staff interface.  Often staff need to limit their search a specific library, without having to go to the advanced search.  This would be an excellent addition, and by default, should limit to the library you are logged in to, with the option via the dropdown to search all libraries.
Comment 1 Lucas Gass 2022-02-10 23:49:32 UTC Comment hidden (obsolete)
Comment 2 Lucas Gass 2022-02-10 23:52:22 UTC
I setting this to ASSIGNED and not NSO because I have a couple questions:

1. If by default it sets the limit to the logged in branch and you do a search at a different branch, should the limiter then be set to the branch you just searched or still your logged in branch?

2. Does these need to account for IndependentBranches?
Comment 3 Donna 2022-02-11 15:43:17 UTC
> 1. If by default it sets the limit to the logged in branch and you do a
> search at a different branch, should the limiter then be set to the branch
> you just searched or still your logged in branch?

My expectation would be to set my search back to the branch I am logged in at.  If I need to do an extensive search at another location, then I would change My Library.

> 
> 2. Does these need to account for IndependentBranches?

Maybe?  What I typically see with independent branches is that the libraries are not interested in seeing/looking for any materials other than their own.  So I would imagine they would use this to keep the search at their own location and not change it.  BUT, I don't have a lot of experience with independent branches, so if anyone else can add to this, that would be great!
Comment 4 Lucas Gass 2022-02-11 16:16:21 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2022-02-19 21:41:12 UTC
*** Bug 29615 has been marked as a duplicate of this bug. ***
Comment 6 Sally 2022-02-22 10:53:15 UTC
Sorry, I have a note of dissent here.

I think the idea is great - having the drop down menu available, mirroring the OPAC functionality, would be very useful.

But I disagree with this part:  "and by default, should limit to the library you are logged in to, with the option via the dropdown to search all libraries."

The default search option on the OPAC is customisable, using the 'SearchMyLibraryFirst' preference.  

I think that the configuration for this should be similarly customisable, because reading through the bug report, my stance would be opposite to Donna's.

Obviously, both workflows are equally valid - and it will entirely depend on the library's set up.

Is it possible to have a second system preference so the default search behaviour could be configured?  For example:  

IntranetAddMastheadLibraryPulldown:  Show
SearchLoggedInLibraryFirst:  Yes

This meets Donna's criteria - defaulting the search to the logged in library.

Or:  

IntranetAddMastheadLibraryPulldown:  Show
SearchLoggedInLibraryFirst:  No

This meets our criteria - having the drop down menu visible so it can be used, but defaulting to 'All Libraries'.
Comment 7 Katrin Fischer 2022-02-22 11:08:49 UTC
I had filed the same bug earlier as bug 29615 and I very much agree with Sally. 
We should start out by duplicating the behaviour of the OPAC preference to make things consistent. 

Then having a SearchMyLibraryFrist equivalent for the staff interface would make a lot of sense as a second step.

For our installations not wanting to limit would currently be the more common setting.
Comment 8 Lucas Gass 2022-03-09 17:49:44 UTC Comment hidden (obsolete)
Comment 9 Lucas Gass 2022-03-09 17:51:21 UTC
This patch should now default to 'All libraries', like the OPAC. I think we should file a separate bug to add the system preference "SearchLoggedInLibraryFirst".
Comment 10 Biblibre Sandboxes 2022-03-10 12:10:40 UTC Comment hidden (obsolete)
Comment 11 Sally 2022-03-10 12:11:05 UTC
Works perfectly, thanks Lucas - great feature!
Comment 12 Katrin Fischer 2022-04-02 22:31:59 UTC
I believe 8) is not right:

8. Try changing to a different branch and doing another search. It should correcrly limit to that branch BUT it should also default back to 'All libraries' for the next search.

* In the OPAC the branch selection is maintained and I believe this is the correct behaviour. 
* We keep all the other search related options: search terms, search option (IntranetCatalogSearchPulldown). So It doesn't make sense that the branch selection would be the only search parameter to be reset. 

It creates a mismatch of what you see and what has been searched for.
Comment 13 Lucas Gass 2022-04-05 23:06:30 UTC Comment hidden (obsolete)
Comment 14 Owen Leonard 2022-04-06 14:21:27 UTC Comment hidden (obsolete)
Comment 15 Owen Leonard 2022-04-06 14:23:45 UTC
> If you have a library with a very long name the dropdown will expand to
> accommodate it.

This is why I have a library in my test dataset named "Gloucester Memorial Free Public Library Incorporated"
Comment 16 Lucas Gass 2022-04-06 22:05:37 UTC
(In reply to Owen Leonard from comment #14)
> Created attachment 133037 [details] [review] [review]
> Bug 30077: (follow-up) Set max width for library drapdown
> 
> If you have a library with a very long name the dropdown will expand to
> accommodate it. I think this is awkward-looking, so I propose to set a
> max width on <select> elements in the header search region.
> 
> The patch requires a rebuild of the staff interface CSS:
> https://wiki.koha-community.org/wiki/
> Working_with_SCSS_in_the_OPAC_and_staff_client

Nice catch, thanks Owen!
Comment 17 David Nind 2022-06-01 09:45:54 UTC Comment hidden (obsolete)
Comment 18 David Nind 2022-06-01 09:46:00 UTC Comment hidden (obsolete)
Comment 19 David Nind 2022-06-01 09:46:08 UTC Comment hidden (obsolete)
Comment 20 Owen Leonard 2022-07-26 15:13:37 UTC
Created attachment 138134 [details] [review]
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown

To test:
1. Apply patch, updatedatabase, restart_all
2. Search for the system pref 'IntranetAddMastheadLibraryPulldown'
3. Set it to 'Show'.
4. Go to any page that contains header search box and click on 'Search
   the catalog'.
5. To the left of the search bar you should see a dropdown for branches.
6. This should be defaulted to 'All libraries'.
7. In the dropdown choose any branch and do a search and make sure it is
   correctly limiting to that branch.
8. Try changing to a different branch and doing another search. It
   should correcrly limit to that branch BUT it should also default back
   to 'All libraries' for the next search.
9. Try selecting 'All libraries' from the top of the dropdown and make
   sure it is correctly searching all branches.
10. Turn on the system pref 'IntranetCatalogSearchPulldown' and make
    sure it looks nice with both of those dropdowns and functions when
    you use limiters from both dropdowns.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: David Nind <david@davidnind.com>
Comment 21 Owen Leonard 2022-07-26 15:13:41 UTC
Created attachment 138135 [details] [review]
Bug 30077: (follow-up) retain branch selection

To test:
1. Apply patch, updatedatabase, restart_all
2. Search for the system pref 'IntranetAddMastheadLibraryPulldown'
3. Set it to 'Show'.
4. Go to any page that contains header search box and click on 'Search
   the catalog'.
5. To the left of the search bar you should see a dropdown for branches.
6. This should be defaulted to 'All libraries'.
7. In the dropdown choose any branch and do a search and make sure it is
   correctly limiting to that branch.
8. Try changing to a different branch and doing another search. It
   should correcrly limit to that branch and retain that branch in the
   dropdown, just like the OPAC.
9. Try selecting 'All libraries' from the top of the dropdown and make
   sure it is correctly searching all branches.
10. Turn on the system pref 'IntranetCatalogSearchPulldown' and make
    sure it looks nice with both of those dropdowns and functions when
    you use limiters from both dropdowns.

Signed-off-by: David Nind <david@davidnind.com>
Comment 22 Owen Leonard 2022-07-26 15:13:45 UTC
Created attachment 138136 [details] [review]
Bug 30077: (follow-up) Set max width for library drapdown

If you have a library with a very long name the dropdown will expand to
accommodate it. I think this is awkward-looking, so I propose to set a
max width on <select> elements in the header search region.

The patch requires a rebuild of the staff interface CSS:
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client

Signed-off-by: David Nind <david@davidnind.com>
Comment 23 Katrin Fischer 2022-07-30 21:02:09 UTC
Created attachment 138396 [details] [review]
Bug 30077: Add system preference IntranetAddMastheadLibraryPulldown

To test:
1. Apply patch, updatedatabase, restart_all
2. Search for the system pref 'IntranetAddMastheadLibraryPulldown'
3. Set it to 'Show'.
4. Go to any page that contains header search box and click on 'Search
   the catalog'.
5. To the left of the search bar you should see a dropdown for branches.
6. This should be defaulted to 'All libraries'.
7. In the dropdown choose any branch and do a search and make sure it is
   correctly limiting to that branch.
8. Try changing to a different branch and doing another search. It
   should correcrly limit to that branch BUT it should also default back
   to 'All libraries' for the next search.
9. Try selecting 'All libraries' from the top of the dropdown and make
   sure it is correctly searching all branches.
10. Turn on the system pref 'IntranetCatalogSearchPulldown' and make
    sure it looks nice with both of those dropdowns and functions when
    you use limiters from both dropdowns.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 24 Katrin Fischer 2022-07-30 21:02:13 UTC
Created attachment 138397 [details] [review]
Bug 30077: (follow-up) retain branch selection

To test:
1. Apply patch, updatedatabase, restart_all
2. Search for the system pref 'IntranetAddMastheadLibraryPulldown'
3. Set it to 'Show'.
4. Go to any page that contains header search box and click on 'Search
   the catalog'.
5. To the left of the search bar you should see a dropdown for branches.
6. This should be defaulted to 'All libraries'.
7. In the dropdown choose any branch and do a search and make sure it is
   correctly limiting to that branch.
8. Try changing to a different branch and doing another search. It
   should correcrly limit to that branch and retain that branch in the
   dropdown, just like the OPAC.
9. Try selecting 'All libraries' from the top of the dropdown and make
   sure it is correctly searching all branches.
10. Turn on the system pref 'IntranetCatalogSearchPulldown' and make
    sure it looks nice with both of those dropdowns and functions when
    you use limiters from both dropdowns.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 25 Katrin Fischer 2022-07-30 21:02:18 UTC
Created attachment 138398 [details] [review]
Bug 30077: (follow-up) Set max width for library drapdown

If you have a library with a very long name the dropdown will expand to
accommodate it. I think this is awkward-looking, so I propose to set a
max width on <select> elements in the header search region.

The patch requires a rebuild of the staff interface CSS:
https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 26 Tomás Cohen Arazi 2022-08-01 17:11:17 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 27 Tomás Cohen Arazi 2022-08-01 17:49:18 UTC
Created attachment 138484 [details] [review]
Bug 30077: (QA follow-up) Avoid warning

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 28 Lucas Gass 2022-09-29 15:55:30 UTC
Enhancement will not be backported to 22.05.x series