Bug 30500

Summary: Add option to allow user to change the pickup location while a hold is in transit
Product: Koha Reporter: Nick Clemens <nick>
Component: Hold requestsAssignee: Tomás Cohen Arazi <tomascohen>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, lucas, sally.healey, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on: 22456    
Bug Blocks:    
Attachments: Bug 30500: Add OPACInTransitHoldPickupLocationChange syspref
Bug 30500: Allow patrons to change in transit holds pickup locations
Bug 30500: Add OPACInTransitHoldPickupLocationChange syspref
Bug 30500: Allow patrons to change in transit holds pickup locations
Bug 30500: Add OPACInTransitHoldPickupLocationChange syspref
Bug 30500: Allow patrons to change in transit holds pickup locations
Bug 30500: (QA follow-up) Separate code execution streams for obviously independent parameters

Description Nick Clemens 2022-04-08 14:50:10 UTC
Currently, when a hold is in transit form one library to another, the patron cannot change the pickup location.

Some libraries would like to allow the option for the patron to switch the pickup location before the book has arrived.

We should add a system preference that enables this change, Koha circulation can already handle this, if you change the location in the DB manually the hold is transferred again when arriving at initial location
Comment 1 Tomás Cohen Arazi 2022-06-08 20:40:53 UTC Comment hidden (obsolete)
Comment 2 Tomás Cohen Arazi 2022-06-08 20:40:58 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi 2022-06-08 20:46:45 UTC
Created attachment 135836 [details] [review]
Bug 30500: Add OPACInTransitHoldPickupLocationChange syspref

Sponsored-by: Montgomery County Public Libraries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi 2022-06-08 20:46:52 UTC
Created attachment 135837 [details] [review]
Bug 30500: Allow patrons to change in transit holds pickup locations

This patch adds a way for patrons to change the pickup location for in
transit holds.

This is done in the OPAC on the holds table.

The feature is controlled by a new system preference:

* OPACInTransitHoldPickupLocationChange

To test:
1. Apply this patches
2. Run:
   $ updatedatabase
   $ restart_all
=> SUCCESS: system preference added
3. Have an in-transit hold for a known patron
4. Visit the holds table for the patron (OPAC)
=> SUCCESS: Hold in transit, cannot change pickup location
5. Enable the OPACInTransitHoldPickupLocationChange system preference
=> SUCCESS: Descriptive text makes sense and is idiomatic
6. Reload the OPAC page
=> SUCCESS: You can now choose a new pickup location
7. Choose one
=> SUCCESS: It works! Reloaded page pre-selects the new pickup location
8. Switch to the new pickup location library on the staff interface
9. Go to Circulation > Transfers to receive
=> SUCCESS: The hold is there!
10. Scan the hold
=> SUCCESS: Usual workflow follows
11. Sign off :-D

Sponsored-by: Montgomery County Public Libraries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Lucas Gass 2022-06-08 22:14:55 UTC
Created attachment 135847 [details] [review]
Bug 30500: Add OPACInTransitHoldPickupLocationChange syspref

Sponsored-by: Montgomery County Public Libraries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 6 Lucas Gass 2022-06-08 22:14:58 UTC
Created attachment 135848 [details] [review]
Bug 30500: Allow patrons to change in transit holds pickup locations

This patch adds a way for patrons to change the pickup location for in
transit holds.

This is done in the OPAC on the holds table.

The feature is controlled by a new system preference:

* OPACInTransitHoldPickupLocationChange

To test:
1. Apply this patches
2. Run:
   $ updatedatabase
   $ restart_all
=> SUCCESS: system preference added
3. Have an in-transit hold for a known patron
4. Visit the holds table for the patron (OPAC)
=> SUCCESS: Hold in transit, cannot change pickup location
5. Enable the OPACInTransitHoldPickupLocationChange system preference
=> SUCCESS: Descriptive text makes sense and is idiomatic
6. Reload the OPAC page
=> SUCCESS: You can now choose a new pickup location
7. Choose one
=> SUCCESS: It works! Reloaded page pre-selects the new pickup location
8. Switch to the new pickup location library on the staff interface
9. Go to Circulation > Transfers to receive
=> SUCCESS: The hold is there!
10. Scan the hold
=> SUCCESS: Usual workflow follows
11. Sign off :-D

Sponsored-by: Montgomery County Public Libraries

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Peter Vashchuk 2022-08-05 12:48:23 UTC
Created attachment 138690 [details] [review]
Bug 30500: (QA follow-up) Separate code execution streams for obviously independent parameters

When $new_pickup_location gets passed as parameter it doesn't make any
sense to also check is_cancelable_from_opac.

Also this makes code more clearer as it seemed like it was possible for
item to get cancelled at the same time as request to change pickup
location.
Comment 8 Tomás Cohen Arazi 2022-08-05 15:05:34 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 9 Lucas Gass 2022-09-29 17:07:04 UTC
Enhancement will not be backported to 22.05.x series