Bug 19618 - Add 'Club Holds' feature
Summary: Add 'Club Holds' feature
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low new feature (vote)
Assignee: Agustín Moyano
QA Contact: Kyle M Hall
URL:
Keywords: Manual
Depends on:
Blocks: 23857 23710
  Show dependency treegraph
 
Reported: 2017-11-13 16:03 UTC by Kyle M Hall
Modified: 2019-11-27 11:39 UTC (History)
10 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Medium patch
Who signed the patch off:
Text to go in the release notes:
This new feature adds the ability for clubs to place a hold for bibs. When such a hold is placed, in the background a hold will be automatically placed for each member of the group in random order.
Version(s) released in:
19.11.00


Attachments
Bug 19618: Add club_holds and club_holds_to_patron_holds tables (6.39 KB, patch)
2019-09-10 07:11 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 19618: [DO NOT PUSH] (follow-up) Schema structure (12.50 KB, patch)
2019-09-10 07:11 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 19618: Add ability to place holds for members of a club in intranet (45.04 KB, patch)
2019-09-10 07:11 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 19618: Add api endpoint for club holds (26.04 KB, patch)
2019-09-10 07:11 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 19618: Add tests (11.92 KB, patch)
2019-09-10 07:11 UTC, Agustín Moyano
Details | Diff | Splinter Review
Bug 19618: Add club_holds and club_holds_to_patron_holds tables (6.45 KB, patch)
2019-09-12 15:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 19618: [DO NOT PUSH] (follow-up) Schema structure (12.57 KB, patch)
2019-09-12 15:59 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 19618: Add ability to place holds for members of a club in intranet (45.11 KB, patch)
2019-09-12 15:59 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 19618: Add api endpoint for club holds (26.10 KB, patch)
2019-09-12 15:59 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 19618: Add tests (11.99 KB, patch)
2019-09-12 15:59 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 19618: (QA follow-up) POD Fix (646 bytes, patch)
2019-09-12 15:59 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 19618: Add club_holds and club_holds_to_patron_holds tables (6.57 KB, patch)
2019-09-30 13:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19618: [DO NOT PUSH] (follow-up) Schema structure (12.69 KB, patch)
2019-09-30 13:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19618: Add ability to place holds for members of a club in intranet (45.23 KB, patch)
2019-09-30 13:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19618: Add api endpoint for club holds (26.22 KB, patch)
2019-09-30 13:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19618: Add tests (12.10 KB, patch)
2019-09-30 13:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 19618: (QA follow-up) POD Fix (766 bytes, patch)
2019-09-30 13:40 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2017-11-13 16:03:36 UTC
1) Add a pulldown and button labeled "Add randomized holds" to the holds page for each bib
Comment 1 Magnus Enger 2017-11-27 08:57:11 UTC
Not sure I understand this one. Is it similar/related to Bug 8809 - Cascading Holds?
Comment 2 Agustín Moyano 2019-07-10 13:59:26 UTC
This bug is intended to add the ability for clubs to place a hold for bibs

This means that when a club places a hold, what really happens is that a hold will automatically be placed for each member in random order.
Comment 3 Agustín Moyano 2019-09-10 07:11:35 UTC
Created attachment 92674 [details] [review]
Bug 19618: Add club_holds and club_holds_to_patron_holds tables

This patch adds 2 new tables
1. club_holds
2. club_holds_to_patron_holds

They are ment to keep info about hold requests made in name of a club

To test:
1) apply this patch
2) perl installer/data/mysql/updatedatabase.pl
SUCCESS => 2 new tables were created
Comment 4 Agustín Moyano 2019-09-10 07:11:39 UTC
Created attachment 92675 [details] [review]
Bug 19618: [DO NOT PUSH] (follow-up) Schema structure
Comment 5 Agustín Moyano 2019-09-10 07:11:43 UTC
Created attachment 92676 [details] [review]
Bug 19618: Add ability to place holds for members of a club in intranet

This patch adds the ability to place a hold for each member of a club in random order.

To test:
1) apply this patch
2) create 2 clubs, (club names should have some part in common, and some part different for each other)
3) in one of them add at least 6 members
4) enter patron clubs management and click on "Actions" button
SUCCESS.1 => club with members has a new action called "search to hold"
5) click on search to hold
SUCCESS.2 => in the list of bilios there appears an action called "Place hold for <club name>"
6) click on "Place hold for <club name>"
SUCCESS.3 => a new window appears where you can select pickup location (defaults to club's library, if any), and the list of members.
7) go back to the list of bilios in the catalog and click on "Forget <club name>"
8) click on "Holds" action of any biblio
SUCCESS.4 => a search box appears with two tabs: Patrons and Clubs
9) click on Clubs tab and search by the common part of clubs names
SUCCESS.5 => a list of clubs that matches the search appears. If you click on any of them, the same page as SUCCESS.3 appears.
10) go back to the search box in SUCCESS.4 and search by the different part of the name.
SUCCESS.6 => because there is only one club that matches search criteria, the same page as SUCCESS.3 appears;
11) Sign off
Comment 6 Agustín Moyano 2019-09-10 07:11:46 UTC
Created attachment 92677 [details] [review]
Bug 19618: Add api endpoint for club holds

This patch adds an endpoint in thi api in /api/v1/clubs/{club_id}/holds whith the verb POST that maps to Koha::REST::V1::Clubs::Holds#add controller.
Classes for club_holds and club_holds_to_patron_holds new tables where also added.

To test:
1) Reach SUCCESS.3 test point of previous patch with club that has no enrollments
2) Click on "Place Hold"
SUCCESS => an alert should appear that you cannot place hold on a club without patrons
3) Reach SUCCESS.3 test point of previous patch with club that has enrollments
4) Click on "Place Hold"
SUCCESS => holds priority list should appear with holds for every patron in club
5) Repeat steps 3 and 4.
SUCCESS => new holds should appear in different order
6) Sign off
Comment 7 Agustín Moyano 2019-09-10 07:11:50 UTC
Created attachment 92678 [details] [review]
Bug 19618: Add tests

This patch adds tests for new features

To test:
1) prove t/db_dependent/Koha/Club/Enrollment.t
2) prove t/db_dependent/Koha/Club/Hold.t
3) prove t/db_dependent/api/v1/clubs_holds.t
4) Sign off
Comment 8 Tomás Cohen Arazi 2019-09-11 14:37:38 UTC
Agustín, you need to add the proposed endpoints here:
https://wiki.koha-community.org/wiki/REST_api_RFCs

I suggest you copy and paste another RFC. As this is using new tables, you probably don't need to propose attribute name mappings.

My 2 cents.
Comment 9 Martin Renvoize 2019-09-12 15:58:58 UTC
Created attachment 92746 [details] [review]
Bug 19618: Add club_holds and club_holds_to_patron_holds tables

This patch adds 2 new tables
1. club_holds
2. club_holds_to_patron_holds

They are ment to keep info about hold requests made in name of a club

To test:
1) apply this patch
2) perl installer/data/mysql/updatedatabase.pl
SUCCESS => 2 new tables were created

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize 2019-09-12 15:59:02 UTC
Created attachment 92747 [details] [review]
Bug 19618: [DO NOT PUSH] (follow-up) Schema structure

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2019-09-12 15:59:06 UTC
Created attachment 92748 [details] [review]
Bug 19618: Add ability to place holds for members of a club in intranet

This patch adds the ability to place a hold for each member of a club in random order.

To test:
1) apply this patch
2) create 2 clubs, (club names should have some part in common, and some part different for each other)
3) in one of them add at least 6 members
4) enter patron clubs management and click on "Actions" button
SUCCESS.1 => club with members has a new action called "search to hold"
5) click on search to hold
SUCCESS.2 => in the list of bilios there appears an action called "Place hold for <club name>"
6) click on "Place hold for <club name>"
SUCCESS.3 => a new window appears where you can select pickup location (defaults to club's library, if any), and the list of members.
7) go back to the list of bilios in the catalog and click on "Forget <club name>"
8) click on "Holds" action of any biblio
SUCCESS.4 => a search box appears with two tabs: Patrons and Clubs
9) click on Clubs tab and search by the common part of clubs names
SUCCESS.5 => a list of clubs that matches the search appears. If you click on any of them, the same page as SUCCESS.3 appears.
10) go back to the search box in SUCCESS.4 and search by the different part of the name.
SUCCESS.6 => because there is only one club that matches search criteria, the same page as SUCCESS.3 appears;
11) Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2019-09-12 15:59:11 UTC
Created attachment 92749 [details] [review]
Bug 19618: Add api endpoint for club holds

This patch adds an endpoint in thi api in /api/v1/clubs/{club_id}/holds whith the verb POST that maps to Koha::REST::V1::Clubs::Holds#add controller.
Classes for club_holds and club_holds_to_patron_holds new tables where also added.

To test:
1) Reach SUCCESS.3 test point of previous patch with club that has no enrollments
2) Click on "Place Hold"
SUCCESS => an alert should appear that you cannot place hold on a club without patrons
3) Reach SUCCESS.3 test point of previous patch with club that has enrollments
4) Click on "Place Hold"
SUCCESS => holds priority list should appear with holds for every patron in club
5) Repeat steps 3 and 4.
SUCCESS => new holds should appear in different order
6) Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2019-09-12 15:59:14 UTC
Created attachment 92750 [details] [review]
Bug 19618: Add tests

This patch adds tests for new features

To test:
1) prove t/db_dependent/Koha/Club/Enrollment.t
2) prove t/db_dependent/Koha/Club/Hold.t
3) prove t/db_dependent/api/v1/clubs_holds.t
4) Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2019-09-12 15:59:19 UTC
Created attachment 92751 [details] [review]
Bug 19618: (QA follow-up) POD Fix

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 15 Martin Renvoize 2019-09-12 16:04:15 UTC
This all seems to work well enough to me.. Signing off..

Some QA notes though.. What happens if the club is disbanded (deleted).. should the holds also be removed.. I don't see anything here doing that?
Comment 16 Martin Renvoize 2019-09-12 16:04:46 UTC
Also.. was this sponsored by anyone?
Comment 17 Tomás Cohen Arazi 2019-09-12 16:10:25 UTC
(In reply to Martin Renvoize from comment #16)
> Also.. was this sponsored by anyone?

Southeast Kansas Library - SEKLS
Comment 18 Agustín Moyano 2019-09-12 17:33:42 UTC
(In reply to Martin Renvoize from comment #15)
> This all seems to work well enough to me.. Signing off..
> 
> Some QA notes though.. What happens if the club is disbanded (deleted)..
> should the holds also be removed.. I don't see anything here doing that?

Hi Martin, thanks for taking the time.

I really wouldn't touch holds that were already placed, even if club was deleted. 

Patrons may depend on that hold.
Comment 19 Kyle M Hall 2019-09-30 13:39:35 UTC
Created attachment 93253 [details] [review]
Bug 19618: Add club_holds and club_holds_to_patron_holds tables

This patch adds 2 new tables
1. club_holds
2. club_holds_to_patron_holds

They are ment to keep info about hold requests made in name of a club

To test:
1) apply this patch
2) perl installer/data/mysql/updatedatabase.pl
SUCCESS => 2 new tables were created

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 20 Kyle M Hall 2019-09-30 13:39:49 UTC
Created attachment 93254 [details] [review]
Bug 19618: [DO NOT PUSH] (follow-up) Schema structure

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 21 Kyle M Hall 2019-09-30 13:39:52 UTC
Created attachment 93255 [details] [review]
Bug 19618: Add ability to place holds for members of a club in intranet

This patch adds the ability to place a hold for each member of a club in random order.

To test:
1) apply this patch
2) create 2 clubs, (club names should have some part in common, and some part different for each other)
3) in one of them add at least 6 members
4) enter patron clubs management and click on "Actions" button
SUCCESS.1 => club with members has a new action called "search to hold"
5) click on search to hold
SUCCESS.2 => in the list of bilios there appears an action called "Place hold for <club name>"
6) click on "Place hold for <club name>"
SUCCESS.3 => a new window appears where you can select pickup location (defaults to club's library, if any), and the list of members.
7) go back to the list of bilios in the catalog and click on "Forget <club name>"
8) click on "Holds" action of any biblio
SUCCESS.4 => a search box appears with two tabs: Patrons and Clubs
9) click on Clubs tab and search by the common part of clubs names
SUCCESS.5 => a list of clubs that matches the search appears. If you click on any of them, the same page as SUCCESS.3 appears.
10) go back to the search box in SUCCESS.4 and search by the different part of the name.
SUCCESS.6 => because there is only one club that matches search criteria, the same page as SUCCESS.3 appears;
11) Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 22 Kyle M Hall 2019-09-30 13:39:55 UTC
Created attachment 93256 [details] [review]
Bug 19618: Add api endpoint for club holds

This patch adds an endpoint in thi api in /api/v1/clubs/{club_id}/holds whith the verb POST that maps to Koha::REST::V1::Clubs::Holds#add controller.
Classes for club_holds and club_holds_to_patron_holds new tables where also added.

To test:
1) Reach SUCCESS.3 test point of previous patch with club that has no enrollments
2) Click on "Place Hold"
SUCCESS => an alert should appear that you cannot place hold on a club without patrons
3) Reach SUCCESS.3 test point of previous patch with club that has enrollments
4) Click on "Place Hold"
SUCCESS => holds priority list should appear with holds for every patron in club
5) Repeat steps 3 and 4.
SUCCESS => new holds should appear in different order
6) Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 23 Kyle M Hall 2019-09-30 13:39:58 UTC
Created attachment 93257 [details] [review]
Bug 19618: Add tests

This patch adds tests for new features

To test:
1) prove t/db_dependent/Koha/Club/Enrollment.t
2) prove t/db_dependent/Koha/Club/Hold.t
3) prove t/db_dependent/api/v1/clubs_holds.t
4) Sign off

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 24 Kyle M Hall 2019-09-30 13:40:01 UTC
Created attachment 93258 [details] [review]
Bug 19618: (QA follow-up) POD Fix

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Sponsored-by: Southeast Kansas Library - SEKLS

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 25 Martin Renvoize 2019-10-01 07:14:01 UTC
Nice work!

Pushed to master for 19.11.00