Bug 37883 - Add a filter for staff search results to filter by branch
Summary: Add a filter for staff search results to filter by branch
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-10 14:16 UTC by Lucas Gass (lukeg)
Modified: 2024-09-12 14:53 UTC (History)
2 users (show)

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


Attachments
Bug 37883: Add logged in branch available, other, and onloan counts (6.03 KB, patch)
2024-09-10 15:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37883: Add ability to filter search results location column by logged in location (7.92 KB, patch)
2024-09-10 15:40 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37883: Add ability to filter search results location column by logged in location (8.49 KB, patch)
2024-09-10 15:50 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37883: Add FilterSearchResultsByLoggedInBranch system preference (3.58 KB, patch)
2024-09-10 19:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37883: Adjust template for new system preference (7.75 KB, patch)
2024-09-10 19:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37883: Use Cookie to remember last selection (2.80 KB, patch)
2024-09-10 20:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37883: Minor fix-ups and perltidy (3.94 KB, patch)
2024-09-10 20:33 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 37883: Add logged in branch available, other, and onloan counts (6.08 KB, patch)
2024-09-12 14:42 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 37883: Add ability to filter search results location column by logged in location (8.54 KB, patch)
2024-09-12 14:42 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 37883: Add FilterSearchResultsByLoggedInBranch system preference (3.62 KB, patch)
2024-09-12 14:42 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 37883: Adjust template for new system preference (7.80 KB, patch)
2024-09-12 14:42 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 37883: Use Cookie to remember last selection (2.85 KB, patch)
2024-09-12 14:42 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 37883: Minor fix-ups and perltidy (3.98 KB, patch)
2024-09-12 14:42 UTC, Brendan Lawlor
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2024-09-10 14:16:57 UTC
This is a thing I've been doing with custom JS for a while now and wanted to add it to Koha properly. 

When looking at a page of search results some librarians would like to be able to filter the 'Location' column to only show items from their local branch.
Comment 1 Lucas Gass (lukeg) 2024-09-10 15:38:59 UTC
Created attachment 171256 [details] [review]
Bug 37883: Add logged in branch available, other, and onloan counts
Comment 2 Lucas Gass (lukeg) 2024-09-10 15:40:37 UTC
Created attachment 171257 [details] [review]
Bug 37883: Add ability to filter search results location column by logged in location
Comment 3 Lucas Gass (lukeg) 2024-09-10 15:50:56 UTC
Created attachment 171261 [details] [review]
Bug 37883: Add ability to filter search results location column by logged in location

To test:

1. Apply patch, restart_all, and regenerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface ) I also recommend clearing your browser cache.
2. Do a catalog search and notice the 'Show local items only' button above the "Location" column.
3. Click it to show information ( in that column ) that is only related to the branch you are currently logged in at.
4. In the same result set have some items that are checked out, withdrawn, lost, damaged, and notforlaon.
5. Play more with the search results and ensure everything is accurate.
Comment 4 Lucas Gass (lukeg) 2024-09-10 19:43:24 UTC
Created attachment 171286 [details] [review]
Bug 37883: Add FilterSearchResultsByLoggedInBranch system preference
Comment 5 Lucas Gass (lukeg) 2024-09-10 19:43:27 UTC
Created attachment 171287 [details] [review]
Bug 37883: Adjust template for new system preference

To test:

0. Apply patch, restart_all, and regenerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface ) I also recommend clearing your browser cache.
1. Search fof the FilterSearchResultsByLoggedInBranch system preference and set it to 'Do'.
2. Do a catalog search and notice the 'Show local items only' button above the "Location" column.
3. Click it to show information ( in that column ) that is only related to the branch you are currently logged in at.
4. In the same result set have some items that are checked out, withdrawn, lost, damaged, and notforlaon.
5. Play more with the search results and ensure everything is accurate.
6. Set the FilterSearchResultsByLoggedInBranch system preference to 'Don't' and confirm that there is no button to filter by branch anymore.
Comment 6 Lucas Gass (lukeg) 2024-09-10 20:24:22 UTC
Created attachment 171289 [details] [review]
Bug 37883: Use Cookie to remember last selection
Comment 7 Lucas Gass (lukeg) 2024-09-10 20:33:32 UTC
Created attachment 171291 [details] [review]
Bug 37883: Minor fix-ups and perltidy
Comment 8 Brendan Lawlor 2024-09-12 14:42:17 UTC
Created attachment 171406 [details] [review]
Bug 37883: Add logged in branch available, other, and onloan counts

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 9 Brendan Lawlor 2024-09-12 14:42:19 UTC
Created attachment 171407 [details] [review]
Bug 37883: Add ability to filter search results location column by logged in location

To test:

1. Apply patch, restart_all, and regenerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface ) I also recommend clearing your browser cache.
2. Do a catalog search and notice the 'Show local items only' button above the "Location" column.
3. Click it to show information ( in that column ) that is only related to the branch you are currently logged in at.
4. In the same result set have some items that are checked out, withdrawn, lost, damaged, and notforlaon.
5. Play more with the search results and ensure everything is accurate.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 10 Brendan Lawlor 2024-09-12 14:42:21 UTC
Created attachment 171408 [details] [review]
Bug 37883: Add FilterSearchResultsByLoggedInBranch system preference

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 11 Brendan Lawlor 2024-09-12 14:42:23 UTC
Created attachment 171409 [details] [review]
Bug 37883: Adjust template for new system preference

To test:

0. Apply patch, restart_all, and regenerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface ) I also recommend clearing your browser cache.
1. Search fof the FilterSearchResultsByLoggedInBranch system preference and set it to 'Do'.
2. Do a catalog search and notice the 'Show local items only' button above the "Location" column.
3. Click it to show information ( in that column ) that is only related to the branch you are currently logged in at.
4. In the same result set have some items that are checked out, withdrawn, lost, damaged, and notforlaon.
5. Play more with the search results and ensure everything is accurate.
6. Set the FilterSearchResultsByLoggedInBranch system preference to 'Don't' and confirm that there is no button to filter by branch anymore.

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 12 Brendan Lawlor 2024-09-12 14:42:25 UTC
Created attachment 171410 [details] [review]
Bug 37883: Use Cookie to remember last selection

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 13 Brendan Lawlor 2024-09-12 14:42:27 UTC
Created attachment 171411 [details] [review]
Bug 37883: Minor fix-ups and perltidy

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 14 Brendan Lawlor 2024-09-12 14:53:35 UTC
We have been using Lucas' JS for this for a really long time now (I think we requested it in early 2023 when we migrated) and our library staff love it. It's especially helpful for consortia with many branches.

Thanks Lucas!