Koha/t
Arthur Suzuki a151d7ba0f Bug 20985: Add OnShelfHoldsAllowed checks to CanItemBeReserved
The expected behaviour for "On shelf holds allowed" setting for the circulation rules (Koha administration > Patrons and circulation > Circulation and fines rules):
- Allow holds only on items that are currently checked out or otherwise unavailable.
- If set to "Yes", patrons can place holds on items currently checked in.
- If set to "If any unavailable", patrons can only place holds on items that are not unavailable.
- If set to "If all unavailable", patrons can only place holds on items where *all* items on the record are unavailable.
(Adapted from https://bywatersolutions.com/education/preparing-for-library-closures)

These rules should also work when using ILS-DI, but currently they don't. This bug makes sure that the "On shelf holds allowed" rules work correctly when using ILS-DI to place holds.

Test plan:

1. Enable ILS-DI (set the ILS-DI system preference to Enable).
2. Go to Koha administration > Patrons and circulation > Circulation and fines rules.
3. Work through steps 4-5 for each of the settings for "On shelf holds allowed" for all libraries/patron categories/item types:
   . "Yes", "If any unavailable", and "If all unavailable"
4. Staff interface - place a hold on a record with items available for loan, the rules should work as expected before and after the patch is applied:
   . "Yes"
      ==> information column in the item table displays "Not on hold", the hold is placed, cancel the hold
   . "If any unavailable" and "If all unavailable"
      ==> the hold is not placed, message is "Cannot place hold. No items are available to be placed on hold.", red "X" in the hold column and the information column displays "Not on hold".
5. ILS-DI - place a hold on a record with items available for loan (note: without the patch, holds can be placed):
   . Query to place a hold using ILS-DI on a title that have all its items available,
     example query: http://127.0.0.1:8080/cgi-bin/koha/ilsdi.pl?service=HoldTitle&patron_id=1&bib_id=1&request_location=127.0.0.1
     ==> Without the patch the hold is placed but it shouldn't be allowed, cancel the hold
   . Query to place a hold using ILS-DI on an available item,
     example query: http://127.0.0.1:8080/cgi-bin/koha/ilsdi.pl?service=HoldItem&patron_id=1&bib_id=1&item_id=1)
     ==> Without the patch the hold is placed but it shouldn't be allowed, cancel the hold
6. Run the tests prove t/db_dependent/Reserves.t - these should pass.
7. Apply the patch (and flush_memcached and restart_all if using koha-testing-docker).
8. Run through steps 3-6 again, and note the changes when "If any unavailable" and "If all unavailable" options are used:
   . For the staff interface: there should be no change in behavour and should work as expected, for the red "X" in the items table additional text is added "onShelfHoldsNotAllowed".
   . For ILS-DI: these should now work as expected, with holds not placed, and this message in the results returned <code>onShelfHoldsNotAllowed</code> (check to confirm no holds place for either the patron or the item)
   . Tests: should still pass.
9. Sign off.

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-06-15 16:41:47 +02:00
..
Acquisition Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Biblio Bug 27268: Move GetMarcNotes to Koha namespace 2021-03-09 17:20:47 +01:00
Budgets Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Circulation Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
data Bug 28385: Add tests 2021-05-25 09:45:22 +02:00
db_dependent Bug 20985: Add OnShelfHoldsAllowed checks to CanItemBeReserved 2021-06-15 16:41:47 +02:00
edi_testfiles
etc Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
External
Koha Bug 28385: Add tests 2021-05-25 09:45:22 +02:00
lib Bug 28250: Remove upload of debug for Selenium failures 2021-04-30 17:07:31 +02:00
Members Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Number Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Search Bug 12430: Add unit tests for C4::Search::buildQuery 2020-12-04 15:32:11 +01:00
Serials Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
SIP
Test Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-checkdatabase-version.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-deprecated.t
00-load.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-merge-conflict-markers.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
00-testcritic.t Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
00-valid-xml.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Auth.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Auth_with_shibboleth.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
AuthoritiesMarc_MARC21.t
AuthoritiesMarc_UNIMARC.t
Barcodes_annual.t
Barcodes_EAN13.t
Barcodes_hbyymmincr.t
Barcodes_incremental.t
Biblio.t Bug 27268: Move GetMarcNotes to Koha namespace 2021-03-09 17:20:47 +01:00
Biblio2.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Budgets.t
Calendar.t Bug 25802: Change addDate to addDuration 2021-01-22 14:59:27 +01:00
Charset.t
Circulation_barcodedecode.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
ClassSortRoutine.t
ClassSortRoutine_Dewey.t
ClassSortRoutine_Generic.t
ClassSortRoutine_LCC.t
ClassSource.t
Context.t Bug 27673: Fix t/Context.t 2021-02-17 09:21:14 +01:00
Contract.t
Creators.t
DateUtils.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Debug.t
dummy.t Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Edifact.t Bug 18267: (QA follow-up) fix typo: overriden => overridden 2020-11-24 09:52:36 +01:00
EdiInvoice.t Bug 18267: Refactored Edifact Price Calculations 2020-11-16 13:46:48 +01:00
Ediorder.t
Ediordrsp.t
EdiTransport.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Form_MessagingPreferences.t
HtmlTags.t
ImportBatch.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Installer_PerlModules.t Bug 27673: Replace YAML with YAML::XS 2021-02-16 14:54:50 +01:00
Installer_pm.t
ItemCirculationAlertPreference.t
Koha.t
Koha_MetadataRecord.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Koha_SearchEngine_Elasticsearch_Browse.t
Koha_Template_Plugin_Cache.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Koha_Template_Plugin_HtmlId.t Bug 27336: Sanitize correctly HTML id 2021-01-11 10:27:37 +01:00
Koha_Template_Plugin_Koha.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Koha_Util_FrameworkPlugin.t
Koha_Util_MARC.t
Labels.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Labels_split_ccn.t
Labels_split_ddcn.t
Labels_split_lccn.t
Labels_split_Regex.t
Languages.t Bug 27491: Fix t/Languages.t 2021-01-25 10:52:02 +01:00
Letters.t
Logger.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Makefile.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Matcher.t Bug 26199: Include LDR for match check/match point 2021-03-09 17:20:47 +01:00
Members_Messaging.t
OpenLibrarySearch.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Output.t
Output_JSONStream.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
Patron.t
Patroncards.t
Patroncards_Batch.t
Patroncards_Lib.t
Patroncards_Patroncard.t
Patroncards_Profile.t
Patroncards_Template.t
Prices.t Bug 27485: Rename system preference gist to TaxRates 2021-01-22 14:09:46 +01:00
RecordProcessor.t Bug 25008: Tests for ->options 2020-04-14 08:31:22 +01:00
Ris.t
Scheduler.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Scrubber.t
Search.t
Search_PazPar2.t
SimpleMARC.t Bug 26781: Check for subfield defined rather than truth 2020-10-26 00:14:41 +01:00
SMS.t
SocialData.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
Stats.t
SuggestionEngine.t Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
SuggestionEngine_AuthorityFile.t Bug 25898: Prohibit indirect object notation 2020-10-15 12:56:30 +02:00
template_filters.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
timezones.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
TmplToken.t
Token.t Bug 26384: Fix executable flags 2020-09-11 09:56:56 +02:00
XSLT.t