Bug 24160 - Short loan collection holds
Summary: Short loan collection holds
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-03 19:40 UTC by Jonathan Druart
Modified: 2020-02-26 11:31 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 24160: Fix OPACHoldsIfAvailableAtPickup to follow holds policy (8.02 KB, patch)
2019-12-13 16:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 24160: Fix OPACHoldsIfAvailableAtPickup to follow holds policy (8.08 KB, patch)
2020-02-26 11:30 UTC, PTFS Europe Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2019-12-03 19:40:12 UTC
Scenario:
 * The library has 3 items - two with item type "general shelves", one with type "desk reserve".
 * Circ rules are set to not allow holds on "desk reserve" items in default holds policy by item type.
 * OPACHoldsIfAvailableAtPickup is set to "Don't allow" to prevent patrons reserving an item which is available at the specified pickup library.

A patron wants to place a hold on one of the “general shelves” items which are both on loan. If this is done by a member of staff in the staff client there is no problem.
If the patron tries to place a hold in the opac it is denied because the "desk reserve" item status is available, even though circ rules specify "desk reserve" item types are not holdable.
Comment 1 Jonathan Druart 2019-12-13 16:21:28 UTC
Created attachment 96265 [details] [review]
Bug 24160: Fix OPACHoldsIfAvailableAtPickup to follow holds policy

Bug 17453 added the ability to restrict the pick up location for items,
if at least one item was available at this location.
It assumed that an available item was an item that was not checked out,
not lost and not damaged.
But actually we should follow holds policy, defined in the circulation
rules.
An item that is not checked out but on which no hold can be placed on,
it should be considered as not available.

Test plan:
0/ Setting up the problematic situation
Considering a bibliographic record with 3 items I1, I2, and I3:
  I1, I2 and I3 have the same location (say Centerville)
  I1 and I2 have the item type 'Book' and are checked out
  I3 is a "Computer Files"
"Computer Files" has a "No holds allowed" hold policy (bottom of the
circulation rules view)

Turn on off (Don't allow) OPACHoldsIfAvailableAtPickup

1/ At the OPAC place a hold on this bibliographic record (biblio or
item-level hold), open the "Pick up location" dropdown list
=> Without this patch you cannot select "Centerville"
=> With this patch applied you can select it

2/ Confirm the hold
=> The hold as been correctly placed on the item and the pickup location
is correct.

3/ Cancel the hold
4/ Check I1 in

5/ Repeat 1/
=> Without and with this patch you cannot select "Centerville"

6/ Open the HTML inspector in the browser, select the dropdown list and
remove the 'disabled="disabled"' attribute of the CPL option

7/ Select (force) Centerville

8/ Confirm the hold
=> Nothing happened! You tried to cheat and place a hold to pickup at an
invalid location.

Note for QA: I have tried to move that code to a module but it's not
trivial at all. The availability needs to be indexed in the search
engine to make all of this much more easy.

Sponsored-by: Educampus
Comment 2 PTFS Europe Sandboxes 2020-02-26 11:30:43 UTC
Created attachment 99640 [details] [review]
Bug 24160: Fix OPACHoldsIfAvailableAtPickup to follow holds policy

Bug 17453 added the ability to restrict the pick up location for items,
if at least one item was available at this location.
It assumed that an available item was an item that was not checked out,
not lost and not damaged.
But actually we should follow holds policy, defined in the circulation
rules.
An item that is not checked out but on which no hold can be placed on,
it should be considered as not available.

Test plan:
0/ Setting up the problematic situation
Considering a bibliographic record with 3 items I1, I2, and I3:
  I1, I2 and I3 have the same location (say Centerville)
  I1 and I2 have the item type 'Book' and are checked out
  I3 is a "Computer Files"
"Computer Files" has a "No holds allowed" hold policy (bottom of the
circulation rules view)

Turn on off (Don't allow) OPACHoldsIfAvailableAtPickup

1/ At the OPAC place a hold on this bibliographic record (biblio or
item-level hold), open the "Pick up location" dropdown list
=> Without this patch you cannot select "Centerville"
=> With this patch applied you can select it

2/ Confirm the hold
=> The hold as been correctly placed on the item and the pickup location
is correct.

3/ Cancel the hold
4/ Check I1 in

5/ Repeat 1/
=> Without and with this patch you cannot select "Centerville"

6/ Open the HTML inspector in the browser, select the dropdown list and
remove the 'disabled="disabled"' attribute of the CPL option

7/ Select (force) Centerville

8/ Confirm the hold
=> Nothing happened! You tried to cheat and place a hold to pickup at an
invalid location.

Note for QA: I have tried to move that code to a module but it's not
trivial at all. The availability needs to be indexed in the search
engine to make all of this much more easy.

Sponsored-by: Educampus

Signed-off-by: Simon Perry <simon.perry@itcarlow.ie>