Bug 40395

Summary: Allow selecting multiple holds in patron detail page to perform actions on
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: Hold requestsAssignee: Pedro Amorim <pedro.amorim>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andrew, chloe.zermatten, gmcharlt, kebliss, lisette, martin.renvoize, pedro.amorim, tomascohen
Version: Main   
Hardware: All   
OS: All   
URL: https://github.com/openfifth/koha/commits/b_40395/
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 40517    
Attachments: Bug 40395: Preparation: suspension_bulk REST API endpoint
Bug 40395: Preparation: DRY cancel_hold_modal
Bug 40395: Preparation: Move holds table JS from request.tt to holds.js
Bug 40395: Use 'deny' CSS class for red color
Bug 40395: Reimplement suspend
Bug 40395: Reimplement delete
Bug 40395: Refactor: Move suspend modal to its own tt BLOCK
Bug 40395: Add checkboxes column to holds table
Bug 40395: Preparation: suspension_bulk REST API endpoint
Bug 40395: Preparation: DRY cancel_hold_modal
Bug 40395: Preparation: Move holds table JS from request.tt to holds.js
Bug 40395: Use 'deny' CSS class for red color
Bug 40395: Reimplement suspend
Bug 40395: Reimplement delete
Bug 40395: Refactor: Move suspend modal to its own tt BLOCK
Bug 40395: Add checkboxes column to holds table
Bug 40395: Preparation: suspension_bulk REST API endpoint
Bug 40395: Preparation: DRY cancel_hold_modal
Bug 40395: Preparation: Move holds table JS from request.tt to holds.js
Bug 40395: Use 'deny' CSS class for red color
Bug 40395: Reimplement suspend
Bug 40395: Reimplement delete
Bug 40395: Refactor: Move suspend modal to its own tt BLOCK
Bug 40395: Add checkboxes column to holds table
Bug 40395: (QA follow-up): Add checkbox column to table settings
Bug 40395: (QA follow-up) Ensure checkboxes are unchecked after suspending
Bug 40395: (QA follow-up): Add checkbox column to table settings
Bug 40395: Preparation: suspension_bulk REST API endpoint
Bug 40395: Preparation: DRY cancel_hold_modal
Bug 40395: Preparation: Move holds table JS from request.tt to holds.js
Bug 40395: Use 'deny' CSS class for red color
Bug 40395: Reimplement suspend
Bug 40395: Reimplement delete
Bug 40395: Refactor: Move suspend modal to its own tt BLOCK
Bug 40395: Add checkboxes column to holds table
Bug 40395: (QA follow-up): Add checkbox column to table settings
Bug 40395: (QA follow-up) Ensure checkboxes are unchecked after suspending

Description Pedro Amorim 2025-07-15 14:59:31 UTC

    
Comment 1 Pedro Amorim 2025-07-15 15:01:34 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2025-07-15 15:01:36 UTC Comment hidden (obsolete)
Comment 3 Pedro Amorim 2025-07-15 15:01:39 UTC Comment hidden (obsolete)
Comment 4 Pedro Amorim 2025-07-15 15:01:41 UTC Comment hidden (obsolete)
Comment 5 Pedro Amorim 2025-07-15 15:01:43 UTC Comment hidden (obsolete)
Comment 6 Pedro Amorim 2025-07-15 15:01:46 UTC Comment hidden (obsolete)
Comment 7 Pedro Amorim 2025-07-15 15:01:48 UTC Comment hidden (obsolete)
Comment 8 Pedro Amorim 2025-07-15 15:01:50 UTC Comment hidden (obsolete)
Comment 9 Pedro Amorim 2025-07-16 10:29:25 UTC
Created attachment 184134 [details] [review]
Bug 40395: Preparation: suspension_bulk REST API endpoint
Comment 10 Pedro Amorim 2025-07-16 10:29:28 UTC
Created attachment 184135 [details] [review]
Bug 40395: Preparation: DRY cancel_hold_modal
Comment 11 Pedro Amorim 2025-07-16 10:29:30 UTC
Created attachment 184136 [details] [review]
Bug 40395: Preparation: Move holds table JS from request.tt to holds.js

This is so that tables from patron-detail-tabs.inc can also make use of this JS
Comment 12 Pedro Amorim 2025-07-16 10:29:33 UTC
Created attachment 184137 [details] [review]
Bug 40395: Use 'deny' CSS class for red color
Comment 13 Pedro Amorim 2025-07-16 10:29:35 UTC
Created attachment 184138 [details] [review]
Bug 40395: Reimplement suspend
Comment 14 Pedro Amorim 2025-07-16 10:29:38 UTC
Created attachment 184139 [details] [review]
Bug 40395: Reimplement delete
Comment 15 Pedro Amorim 2025-07-16 10:29:40 UTC
Created attachment 184140 [details] [review]
Bug 40395: Refactor: Move suspend modal to its own tt BLOCK
Comment 16 Pedro Amorim 2025-07-16 10:29:43 UTC
Created attachment 184141 [details] [review]
Bug 40395: Add checkboxes column to holds table

Test plan, k-t-d, patches applied:
1) Search for 'music':
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=music
2) Click the 'Select all' link on the left of the search toolbar
3) Click the 'Place hold' button on the same toolbar
4) On the patron input, add 'koha'
5) You need to pick the 'Pickup location' specifically for each hold. Click 'Place holds'
6) On this screen (reserve/request.pl) ensure the table(s) work. Selecting all works. Canceling selected works (it doesn't refresh immediatelly, it's a background job). Suspend works as before, sorting, etc.
7) Now visit the patron details page:
http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
8) Click the 'Holds' tab.
9) Verify we now have a checkbox column at the start.
10) Test that selecting multiple holds and canceling selected works. Same for suspending.
11) Test the canceling or suspending a specific hold works.
12) Test that this table is compatible with AutoResumeSuspendedHolds sys pref i.e. you're unable to set a resume date when suspending in bulk or single if this sys pref is turned off.
13) Repeat steps 8-12 but for the circulation page from patron details at:
http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
14) Ensure tests added for API REST endpoint added here pass:
prove t/db_dependent/api/v1/holds.t
Comment 17 Andrew Fuerste-Henry 2025-07-18 15:27:37 UTC
These patches remove some functionality from this page. Before the patches, one can select a hold cancellation reason when cancelling several holds at once at can set a suspend-until date when suspending multiple holds at once.
Comment 18 Andrew Fuerste-Henry 2025-07-18 16:06:45 UTC
(In reply to Andrew Fuerste-Henry from comment #17)
> These patches remove some functionality from this page. Before the patches,
> one can select a hold cancellation reason when cancelling several holds at
> once at can set a suspend-until date when suspending multiple holds at once.

Don't mind me, both functions are now in a modal that pops up on clicking their respective buttons.
Comment 19 Andrew Fuerste-Henry 2025-07-18 16:38:18 UTC
Created attachment 184398 [details] [review]
Bug 40395: Preparation: suspension_bulk REST API endpoint

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 20 Andrew Fuerste-Henry 2025-07-18 16:38:21 UTC
Created attachment 184399 [details] [review]
Bug 40395: Preparation: DRY cancel_hold_modal

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 21 Andrew Fuerste-Henry 2025-07-18 16:38:24 UTC
Created attachment 184400 [details] [review]
Bug 40395: Preparation: Move holds table JS from request.tt to holds.js

This is so that tables from patron-detail-tabs.inc can also make use of this JS

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 22 Andrew Fuerste-Henry 2025-07-18 16:38:26 UTC
Created attachment 184401 [details] [review]
Bug 40395: Use 'deny' CSS class for red color

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 23 Andrew Fuerste-Henry 2025-07-18 16:38:29 UTC
Created attachment 184402 [details] [review]
Bug 40395: Reimplement suspend

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 24 Andrew Fuerste-Henry 2025-07-18 16:38:32 UTC
Created attachment 184403 [details] [review]
Bug 40395: Reimplement delete

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 25 Andrew Fuerste-Henry 2025-07-18 16:38:35 UTC
Created attachment 184404 [details] [review]
Bug 40395: Refactor: Move suspend modal to its own tt BLOCK

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 26 Andrew Fuerste-Henry 2025-07-18 16:38:37 UTC
Created attachment 184405 [details] [review]
Bug 40395: Add checkboxes column to holds table

Test plan, k-t-d, patches applied:
1) Search for 'music':
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=music
2) Click the 'Select all' link on the left of the search toolbar
3) Click the 'Place hold' button on the same toolbar
4) On the patron input, add 'koha'
5) You need to pick the 'Pickup location' specifically for each hold. Click 'Place holds'
6) On this screen (reserve/request.pl) ensure the table(s) work. Selecting all works. Canceling selected works (it doesn't refresh immediatelly, it's a background job). Suspend works as before, sorting, etc.
7) Now visit the patron details page:
http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
8) Click the 'Holds' tab.
9) Verify we now have a checkbox column at the start.
10) Test that selecting multiple holds and canceling selected works. Same for suspending.
11) Test the canceling or suspending a specific hold works.
12) Test that this table is compatible with AutoResumeSuspendedHolds sys pref i.e. you're unable to set a resume date when suspending in bulk or single if this sys pref is turned off.
13) Repeat steps 8-12 but for the circulation page from patron details at:
http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
14) Ensure tests added for API REST endpoint added here pass:
prove t/db_dependent/api/v1/holds.t

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 27 Pedro Amorim 2025-07-21 11:21:52 UTC Comment hidden (obsolete)
Comment 28 Pedro Amorim 2025-07-21 11:27:41 UTC
Created attachment 184435 [details] [review]
Bug 40395: (QA follow-up) Ensure checkboxes are unchecked after suspending

To test, select a few holds to suspend (but not all). Click 'Suspend selected'. Notice the selection doesn't reset. After this patch, it does reset.
Comment 29 Pedro Amorim 2025-07-21 13:57:31 UTC
Created attachment 184437 [details] [review]
Bug 40395: (QA follow-up): Add checkbox column to table settings

This fixes the empty entry when clicking 'Columns' on the top right of
the table.
Also ensures sorting does not exist on the checkbox column and exists on the one it was before (reservedate)
This is for holds table on both patron pages:
http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=19
http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=19
Comment 30 Pedro Amorim 2025-07-22 13:05:41 UTC
No longer applies after bug 40372
Comment 31 Pedro Amorim 2025-07-22 13:10:13 UTC
Created attachment 184470 [details] [review]
Bug 40395: Preparation: suspension_bulk REST API endpoint
Comment 32 Pedro Amorim 2025-07-22 13:10:16 UTC
Created attachment 184471 [details] [review]
Bug 40395: Preparation: DRY cancel_hold_modal
Comment 33 Pedro Amorim 2025-07-22 13:10:18 UTC
Created attachment 184472 [details] [review]
Bug 40395: Preparation: Move holds table JS from request.tt to holds.js

This is so that tables from patron-detail-tabs.inc can also make use of this JS
Comment 34 Pedro Amorim 2025-07-22 13:10:21 UTC
Created attachment 184473 [details] [review]
Bug 40395: Use 'deny' CSS class for red color
Comment 35 Pedro Amorim 2025-07-22 13:10:24 UTC
Created attachment 184474 [details] [review]
Bug 40395: Reimplement suspend
Comment 36 Pedro Amorim 2025-07-22 13:10:26 UTC
Created attachment 184475 [details] [review]
Bug 40395: Reimplement delete
Comment 37 Pedro Amorim 2025-07-22 13:10:29 UTC
Created attachment 184476 [details] [review]
Bug 40395: Refactor: Move suspend modal to its own tt BLOCK
Comment 38 Pedro Amorim 2025-07-22 13:10:32 UTC
Created attachment 184477 [details] [review]
Bug 40395: Add checkboxes column to holds table

Test plan, k-t-d, patches applied:
1) Search for 'music':
http://localhost:8081/cgi-bin/koha/catalogue/search.pl?q=music
2) Click the 'Select all' link on the left of the search toolbar
3) Click the 'Place hold' button on the same toolbar
4) On the patron input, add 'koha'
5) You need to pick the 'Pickup location' specifically for each hold. Click 'Place holds'
6) On this screen (reserve/request.pl) ensure the table(s) work. Selecting all works. Canceling selected works (it doesn't refresh immediatelly, it's a background job). Suspend works as before, sorting, etc.
7) Now visit the patron details page:
http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
8) Click the 'Holds' tab.
9) Verify we now have a checkbox column at the start.
10) Test that selecting multiple holds and canceling selected works. Same for suspending.
11) Test the canceling or suspending a specific hold works.
12) Test that this table is compatible with AutoResumeSuspendedHolds sys pref i.e. you're unable to set a resume date when suspending in bulk or single if this sys pref is turned off.
13) Repeat steps 8-12 but for the circulation page from patron details at:
http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
14) Ensure tests added for API REST endpoint added here pass:
prove t/db_dependent/api/v1/holds.t
Comment 39 Pedro Amorim 2025-07-22 13:10:34 UTC
Created attachment 184478 [details] [review]
Bug 40395: (QA follow-up): Add checkbox column to table settings

This fixes the empty entry when clicking 'Columns' on the top right of
the table
Comment 40 Pedro Amorim 2025-07-22 13:10:37 UTC
Created attachment 184479 [details] [review]
Bug 40395: (QA follow-up) Ensure checkboxes are unchecked after suspending

To test, select a few holds to suspend (but not all). Click 'Suspend selected'. Notice the selection doesn't reset. After this patch, it does reset.