Bug 23820

Summary: Club hold pickup locations should be able to default to patron's home library
Product: Koha Reporter: Jason Robb <jrobb>
Component: Hold requestsAssignee: Agustín Moyano <agustinmoyano>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, gmcharlt, jonathan.druart, lisettepalouse+koha, lucas, tomascohen
Version: Main   
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:
20.11.00, 20.05.03
Circulation function:
Attachments: Bug 23820: Add checkout to default to patron's home branch on club hold
Bug 23820: Add checkout to default to patron's home branch on club hold
Bug 23820: Add test for new behaviour
Bug 23820: Add checkout to default to patron's home branch on club hold
Bug 23820: Add test for new behaviour
Bug 23820: (QA follow-up) Make label clickable for checkbox
Bug 23820: Fix Koha/Club/Hold.t

Description Jason Robb 2019-10-15 21:28:16 UTC
Currently club holds force you to choose a single, specific pickup location when placing holds for the club. This isn't ideal in a multibranch/consortial setting.

It would be nice if there were an option to default the pickup location to the patron's home branch for holds placed with clubs.

My use case involves clubs for specific authors. For example, I want to create a 'Stuart Woods' club that patrons can join, then whenever a new Stuart Woods title is added, staff place a club hold that hits every patron enrolled.

Right now, if I take three different patrons from three different branches and add them to a single club, I will be forced to select a single pickup location which may be inaccessible to some or all of the patrons. To set three different pickup locations, I would need to place three different club holds for three different clubs. That has potential to get very messy, very quickly. Each branch would need a club for each author, which then makes it easy to enroll patrons in the wrong club and get their holds sent to the wrong branch.

Ideally, all three patrons should be able to join a single club and get their holds sent to their respective home branches for pick up.
Comment 1 Agustín Moyano 2020-03-30 20:50:33 UTC
Created attachment 102093 [details] [review]
Bug 23820: Add checkout to default to patron's home branch on club hold

This patch adds a checkbox to make holds created by club hold to default to patron's home branch if possible.

To test:
1. Apply this patch
2. Create a club, and add two patrons (from now on called patron A and patron B) to it, each one form a different library..
3. Create a hold for the club, and in the details set pickup location different from any of the patrons.
4. Check "Pickup at patron's home library when possible" checkbox
SUCCESS => when submitted, pickup location of holds defaults to patron's home branch
5. Modify patron A's library and set pickup location to no.
6. Repeat steps 3 and 4.
SUCCESS => when submitted, patron A's hold now points to pickup location setted on step 3, and patron B's hold still points to his home branch.
7. Sign off

Sponsored-by: Southeast Kansas Library - SEKLS
Comment 2 ByWater Sandboxes 2020-03-31 16:53:28 UTC
Created attachment 102153 [details] [review]
Bug 23820: Add checkout to default to patron's home branch on club hold

This patch adds a checkbox to make holds created by club hold to default to patron's home branch if possible.

To test:
1. Apply this patch
2. Create a club, and add two patrons (from now on called patron A and patron B) to it, each one form a different library..
3. Create a hold for the club, and in the details set pickup location different from any of the patrons.
4. Check "Pickup at patron's home library when possible" checkbox
SUCCESS => when submitted, pickup location of holds defaults to patron's home branch
5. Modify patron A's library and set pickup location to no.
6. Repeat steps 3 and 4.
SUCCESS => when submitted, patron A's hold now points to pickup location setted on step 3, and patron B's hold still points to his home branch.
7. Sign off

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Jason Robb <jrobb@sekls.org>
Comment 3 Jason Robb 2020-03-31 16:56:40 UTC
Tested with a sandbox, works as described! Excellent!!
Comment 4 Jonathan Druart 2020-04-27 11:01:24 UTC
Please add tests to cover this change.
Comment 5 Agustín Moyano 2020-05-29 16:26:00 UTC
Created attachment 105437 [details] [review]
Bug 23820: Add test for new behaviour

To test:
1. prove t/db_dependent/api/v1/clubs_holds.t
2. Sign off

Sponsored-by: Southeast Kansas Library - SEKLS
Comment 6 Katrin Fischer 2020-07-05 19:11:14 UTC
Created attachment 106561 [details] [review]
Bug 23820: Add checkout to default to patron's home branch on club hold

This patch adds a checkbox to make holds created by club hold to default to patron's home branch if possible.

To test:
1. Apply this patch
2. Create a club, and add two patrons (from now on called patron A and patron B) to it, each one form a different library..
3. Create a hold for the club, and in the details set pickup location different from any of the patrons.
4. Check "Pickup at patron's home library when possible" checkbox
SUCCESS => when submitted, pickup location of holds defaults to patron's home branch
5. Modify patron A's library and set pickup location to no.
6. Repeat steps 3 and 4.
SUCCESS => when submitted, patron A's hold now points to pickup location setted on step 3, and patron B's hold still points to his home branch.
7. Sign off

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Jason Robb <jrobb@sekls.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2020-07-05 19:11:17 UTC
Created attachment 106562 [details] [review]
Bug 23820: Add test for new behaviour

To test:
1. prove t/db_dependent/api/v1/clubs_holds.t
2. Sign off

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Katrin Fischer 2020-07-05 19:11:21 UTC
Created attachment 106563 [details] [review]
Bug 23820: (QA follow-up) Make label clickable for checkbox

By adding an id the checkbox is selected when the label is clicked
enhancing usability.

Also adds a colon : to the label.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Jonathan Druart 2020-07-20 15:48:11 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 10 Jonathan Druart 2020-07-21 08:08:42 UTC
Created attachment 107128 [details] [review]
Bug 23820: Fix Koha/Club/Hold.t

kohadev-koha@kohadevbox:/kohadevbox/koha$ prove t/db_dependent/Koha/Club/Hold.t
t/db_dependent/Koha/Club/Hold.t .. Patron(238) Hold cannot be placed. Reason: libraryNotPickupLocation at /kohadevbox/koha/Koha/Club/Hold.pm line 98.
    # Looks like you planned 5 tests but ran 4.
t/db_dependent/Koha/Club/Hold.t .. 1/1
 #   Failed test 'add'
 #   at t/db_dependent/Koha/Club/Hold.t line 86.
Can't call method "borrowernumber" on an undefined value at t/db_dependent/Koha/Club/Hold.t line 83.
Comment 11 Jonathan Druart 2020-07-21 10:24:18 UTC
Follow-up pushed to master for 20.11
Comment 12 Lucas Gass (lukeg) 2020-07-27 16:45:30 UTC
backported to 20.05.x for 20.05.03
Comment 13 Aleisha Amohia 2020-08-03 22:55:24 UTC
enhancement, not backported to 19.11.x