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.
Created attachment 171256 [details] [review] Bug 37883: Add logged in branch available, other, and onloan counts
Created attachment 171257 [details] [review] Bug 37883: Add ability to filter search results location column by logged in location
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.
Created attachment 171286 [details] [review] Bug 37883: Add FilterSearchResultsByLoggedInBranch system preference
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.
Created attachment 171289 [details] [review] Bug 37883: Use Cookie to remember last selection
Created attachment 171291 [details] [review] Bug 37883: Minor fix-ups and perltidy
Created attachment 171406 [details] [review] Bug 37883: Add logged in branch available, other, and onloan counts Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
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>
Created attachment 171408 [details] [review] Bug 37883: Add FilterSearchResultsByLoggedInBranch system preference Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
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>
Created attachment 171410 [details] [review] Bug 37883: Use Cookie to remember last selection Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Created attachment 171411 [details] [review] Bug 37883: Minor fix-ups and perltidy Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
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!