Bug 21249: New syspref controlling branch fields queried against selected library...
authorAlex Buckley <alexbuckley@catalyst.net.nz>
Mon, 20 Aug 2018 09:49:43 +0000 (21:49 +1200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 6 May 2021 13:52:43 +0000 (15:52 +0200)
commit195531c038f8d3ca23981c765a880a5372549254
tree6601fbf5d0ebd6da90885b9687f4bb8e834704d7
parent786c1c8ca0f2f77af2114691ffcbe74117d52416
Bug 21249: New syspref controlling branch fields queried against selected library group value in advanced search

This commit allows librarians to choose whether they want to query the
homebranch, holdingbranch or homebranch AND holdingbranch when they set
a library or library group search condition in the staff client and OPAC
advanced searches.

Test plan:
1. Apply patches, update database, restart services
2. Set up a record with one item. Edit the item so that:
home branch = Branch A
holding/current branch = Branch B.
Note the barcode of your item.
3. Go to Administration -> Library Groups. Create a library group that
only contains Branch A.

= homebranch and holdingbranch =

4. Go to Administration -> System preferences and find the new
SearchLimitLibrary syspref. Confirm it is set to 'homebranch and
holdingbranch' by default. Keep this tab open.
5. Go to Advanced Search in the staff client in another tab. Under 'location and
availability', select your library group from the dropdown. Under
'search for', select the barcode option and enter your item's barcode.
6. Submit the search and confirm you are taken to your item as expected.
7. Go back to Advanced Search. Under 'location and availability', select
Branch A from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
8. Submit the search and confirm you are taken to your item as expected.
9. Go back to Advanced Search. Under 'location and availability', select
Branch B from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
10. Submit the search and confirm you are taken to your item as expected.

= homebranch only =

11. Go back to your System preferences tab. Set the SearchLimitLibrary
syspref to 'homebranch'. keep this tab open.
12. Go to Advanced Search in the staff client in another tab. Under 'location and
availability', select your library group from the dropdown. Under
'search for', select the barcode option and enter your item's barcode.
13. Submit the search and confirm you are taken to your item as expected,
because the syspref is set to homebranch and the library group contains our item's
homebranch.
14. Go back to Advanced Search. Under 'location and availability', select
Branch A from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
15. Submit the search and confirm you are taken to your item as expected.
16. Go back to Advanced Search. Under 'location and availability', select
Branch B from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
17. Submit the search and confirm you are NOT taken to your item and your item
does not show in the search results.

= holdingbranch only =

18. Go back to your System preferences tab. Set the SearchLimitLibrary
syspref to 'holdingbranch'. keep this tab open.
19. Go to Advanced Search in the staff client in another tab. Under 'location and
availability', select your library group from the dropdown. Under
'search for', select the barcode option and enter your item's barcode.
20. Submit the search and confirm you are NOT taken to your item and your
item does not show in the search results, because the syspref is set to
holdingbranch and the library group does not contain our item's holdingbranch.
21. Go back to Advanced Search. Under 'location and availability', select
Branch B from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
22. Submit the search and confirm you are taken to your item as expected.
23. Go back to Advanced Search. Under 'location and availability', select
Branch A from the individual libraries dropdown. Under 'search for',
select the barcode option and enter your item's barcode.
24. Submit the search and confirm you are NOT taken to your item and your item
does not show in the search results.

25. Repeat the above test plan but do your searching with the OPAC
advanced search.

Sponsored-By: Brimbank Library
Signed-off-by: Amandine Zocca <azocca@ville-montauban.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
catalogue/search.pl
installer/data/mysql/atomicupdate/bug_21249-Branch_to_limit_advanced_search_results.sql [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
opac/opac-search.pl