Bug 31698 - Add ability to move a hold to a new bibliographic record/item
Summary: Add ability to move a hold to a new bibliographic record/item
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Pedro Amorim
URL: https://bywatersolutions.com/crowdsou...
Keywords: release-notes-needed
Depends on:
Blocks:
 
Reported: 2022-10-06 13:22 UTC by Nick Clemens (kidclamp)
Modified: 2025-09-08 12:47 UTC (History)
24 users (show)

See Also:
GIT URL:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
*** Sponsored by Cuyahoga County Public Library ***
Version(s) released in:
25.11.00
Circulation function:


Attachments
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-03-12 17:31 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add new move_hold_item subroutine to Hold.pm (1.05 KB, patch)
2025-03-12 21:32 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Implement move_hold_item in request.pl (1.44 KB, patch)
2025-03-12 21:34 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Make move_hold_item use CanItemBeReserved and add logging (4.40 KB, patch)
2025-03-13 17:44 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Template and javascript changes to request.tt (9.77 KB, patch)
2025-03-13 19:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Report errors and failures back to request.tt (9.04 KB, patch)
2025-03-13 21:36 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Deal with priority (3.55 KB, patch)
2025-03-13 22:27 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Improve priority (1.86 KB, patch)
2025-03-13 23:29 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Flip the logic for priority (1.47 KB, patch)
2025-03-13 23:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add missing filters (2.48 KB, patch)
2025-03-25 20:15 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Use _ShiftPriority to deal with priority (4.00 KB, patch)
2025-03-25 22:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Call _FixPriority on orginal biblio to clean-up priorty (1.16 KB, patch)
2025-03-25 23:22 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-04-21 18:19 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add new move_hold_item subroutine to Hold.pm (4.52 KB, patch)
2025-04-21 18:19 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Template and javascript changes to request.tt (9.77 KB, patch)
2025-04-21 18:19 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Report errors and failures back to request.tt (10.97 KB, patch)
2025-04-21 18:19 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add missing filters (6.37 KB, patch)
2025-04-21 18:19 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-04-21 19:23 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add new move_hold_item subroutine to Hold.pm and request.pl (4.53 KB, patch)
2025-04-21 19:23 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Template and javascript changes to request.tt (9.77 KB, patch)
2025-04-21 19:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Report errors and failures back to request.tt (12.89 KB, patch)
2025-04-21 19:24 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add support for moving record level holds (14.65 KB, patch)
2025-04-21 21:35 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Combine item and record level subroutines (7.73 KB, patch)
2025-04-21 22:02 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (26.61 KB, patch)
2025-04-21 22:06 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.53 KB, patch)
2025-05-05 16:44 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.60 KB, patch)
2025-05-05 17:02 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-05-05 20:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (26.61 KB, patch)
2025-05-05 20:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.53 KB, patch)
2025-05-05 20:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.60 KB, patch)
2025-05-05 20:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add unit tests (5.47 KB, patch)
2025-05-05 20:53 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-05-05 22:35 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (26.61 KB, patch)
2025-05-05 22:35 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.53 KB, patch)
2025-05-05 22:35 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.60 KB, patch)
2025-05-05 22:36 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add unit tests (5.47 KB, patch)
2025-05-05 22:36 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Disallow moving waiting or intransit holds (7.57 KB, patch)
2025-05-05 22:36 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-05-05 22:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (29.54 KB, patch)
2025-05-05 22:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.53 KB, patch)
2025-05-05 22:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.60 KB, patch)
2025-05-05 22:38 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add unit tests (5.47 KB, patch)
2025-05-05 22:39 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Disallow moving waiting or intransit holds (7.57 KB, patch)
2025-05-05 22:39 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Disallow moving waiting or intransit holds (7.62 KB, patch)
2025-05-19 21:04 UTC, OpenFifth Sandboxes
Details | Diff | Splinter Review
Error Message for Don't allow holds on damaged items (7.48 KB, image/png)
2025-05-19 21:11 UTC, Kristi Krueger
Details
Checkbox for record level moves sometimes shows twice (21.47 KB, image/png)
2025-05-19 21:11 UTC, Kristi Krueger
Details
Bug 31698: Ensure searches for biblio records return only unique bibs (1.67 KB, patch)
2025-07-28 14:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Adjust number of tests (643 bytes, patch)
2025-08-01 16:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-08-01 16:21 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (29.54 KB, patch)
2025-08-01 16:21 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.53 KB, patch)
2025-08-01 16:21 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.60 KB, patch)
2025-08-01 16:21 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add unit tests (5.46 KB, patch)
2025-08-01 16:21 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Disallow moving waiting or intransit holds (7.62 KB, patch)
2025-08-01 16:21 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Ensure searches for biblio records return only unique bibs (1.67 KB, patch)
2025-08-01 16:21 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios (1.99 KB, patch)
2025-08-05 14:12 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Style move selected button and disable when nothing is selected (2.51 KB, patch)
2025-08-13 21:01 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Make searches return only exact matches for barcode/biblionumber (4.32 KB, patch)
2025-08-13 22:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-08-20 21:08 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (20.05 KB, patch)
2025-08-20 21:08 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.53 KB, patch)
2025-08-20 21:08 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.60 KB, patch)
2025-08-20 21:08 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add unit tests (5.48 KB, patch)
2025-08-20 21:08 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Disallow moving waiting or intransit holds (10.04 KB, patch)
2025-08-20 21:08 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Ensure searches for biblio records return only unique bibs (1.67 KB, patch)
2025-08-20 21:09 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios (1.99 KB, patch)
2025-08-20 21:09 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Style move selected button and disable when nothing is selected (2.51 KB, patch)
2025-08-20 21:09 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Make searches return only exact matches for barcode/biblionumber (4.32 KB, patch)
2025-08-20 21:09 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-08-25 20:54 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (19.97 KB, patch)
2025-08-25 20:54 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.53 KB, patch)
2025-08-25 20:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.60 KB, patch)
2025-08-25 20:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add unit tests (5.48 KB, patch)
2025-08-25 20:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Disallow moving waiting or intransit holds (9.79 KB, patch)
2025-08-25 20:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Ensure searches for biblio records return only unique bibs (1.67 KB, patch)
2025-08-25 20:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios (1.99 KB, patch)
2025-08-25 20:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Style move selected button and disable when nothing is selected (1.61 KB, patch)
2025-08-25 20:56 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Make searches return only exact matches for barcode/biblionumber (3.23 KB, patch)
2025-08-25 20:56 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Move request.tt JS to hold.js (8.46 KB, patch)
2025-08-25 20:56 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Report errors and failures back to request.tt (4.79 KB, patch)
2025-08-25 21:50 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.06 KB, patch)
2025-08-25 21:59 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (19.97 KB, patch)
2025-08-25 21:59 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.53 KB, patch)
2025-08-25 21:59 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.60 KB, patch)
2025-08-25 21:59 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add unit tests (5.48 KB, patch)
2025-08-25 21:59 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Disallow moving waiting or intransit holds (9.79 KB, patch)
2025-08-25 22:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Ensure searches for biblio records return only unique bibs (1.67 KB, patch)
2025-08-25 22:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios (1.99 KB, patch)
2025-08-25 22:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Style move selected button and disable when nothing is selected (1.61 KB, patch)
2025-08-25 22:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Make searches return only exact matches for barcode/biblionumber (3.23 KB, patch)
2025-08-25 22:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Report errors and failures back to request.tt (4.79 KB, patch)
2025-08-25 22:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Move request.tt JS to hold.js (14.04 KB, patch)
2025-08-25 22:00 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Move reamining JS to hold.js (12.71 KB, patch)
2025-08-27 15:55 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets permission (3.12 KB, patch)
2025-09-03 15:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Add ability to move holds to new items or new records (20.03 KB, patch)
2025-09-03 15:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Fix modals for item level moves (8.59 KB, patch)
2025-09-03 15:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Fix modals for biblio level moves (10.65 KB, patch)
2025-09-03 15:47 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Add unit tests (5.54 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Disallow moving waiting or intransit holds (9.84 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Ensure searches for biblio records return only unique bibs (1.73 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios (2.05 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Style move selected button and disable when nothing is selected (1.66 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Make searches return only exact matches for barcode/biblionumber (3.29 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Report errors and failures back to request.tt (4.85 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Move request.tt JS to hold.js (14.09 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Move reamining JS to hold.js (12.77 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: (QA follow-up): Prevent display 'NaN' UI error message (1.65 KB, patch)
2025-09-03 15:48 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Make strings in holds.js translatable (7.06 KB, patch)
2025-09-03 19:20 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 31698: Make strings in holds.js translatable (7.12 KB, patch)
2025-09-04 08:31 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 31698: Add alter_hold_targets to t/Koha/Auth/Permissions.t (1.04 KB, patch)
2025-09-05 19:43 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2022-10-06 13:22:25 UTC
Sometimes a library gets a new edition, or a new copy of an item and would like to be able to directly provide this to a patron with an existing hold.

We propose add a new action on the holds table on request.pl 'Move hold'

For an item level hold it would provide a modal with a barcode entry box so librarians can scan a new copy in hand, and move the hold to that specific item

For a biblio level hold it would provide a modal with a search box - entering keywords would search the catalog, and add a 'Move hold' button to the results - similar to 'Add to basket form existing record' search in acquisitions
Comment 1 Kristi Krueger 2023-10-18 19:10:29 UTC
We would love to see this capability! It would be ideal if moving all holds on the bib at once were built in. This would be helpful for bibs with many (over 50) holds on them.
Comment 2 Felicity Brown 2024-01-16 19:30:13 UTC
This would be a fantastic solution to a problem we've been having with re-orders of older titles, where we get the newer edition as a replacement. Our current workaround creates some pretty yucky metadata.
Comment 3 Kristi Krueger 2024-01-16 19:38:01 UTC
(In reply to Felicity Brown from comment #2)
> This would be a fantastic solution to a problem we've been having with
> re-orders of older titles, where we get the newer edition as a replacement.
> Our current workaround creates some pretty yucky metadata.

Same for us.
Comment 4 Rhonda Kuiper 2024-05-20 22:00:55 UTC
This function would be fantastic for our library.  Currently, our processes to move holds is time consuming and prone to errors.  This would be great!  
One thing to specifically note is that the date that the hold was placed on the original item would be preserved.  This was the order of the holds queue could be preserved and sorted in the the holds on the new item.
Comment 5 Piia Semenoff 2024-06-05 10:06:15 UTC
This sounds good! I totally agree that currently the transfer of the holds takes time and the possibility of errors is high. 

I think these are the things that can go wrong now while doing the hold transfer and should be considered when building this function:

- It should be taken into account whether the hold has been suspended or whether it is a itemlevel hold or a non-urgent hold. 

- In addition, you must choose the right pick-up location for the hold, change the hold date and priority of the hold.
Comment 6 olivier.delangle 2024-12-17 13:42:32 UTC
I agree. We are facing the same situation.  A new action on the holds table on request.pl 'Move hold' would be very helpful
Comment 7 Lucas Gass (lukeg) 2025-03-12 17:31:03 UTC
Created attachment 179226 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 8 Lucas Gass (lukeg) 2025-03-12 21:32:31 UTC
Created attachment 179235 [details] [review]
Bug 31698: Add new move_hold_item subroutine to Hold.pm
Comment 9 Lucas Gass (lukeg) 2025-03-12 21:34:28 UTC
Created attachment 179236 [details] [review]
Bug 31698: Implement move_hold_item in request.pl
Comment 10 Lucas Gass (lukeg) 2025-03-13 17:44:25 UTC
Created attachment 179279 [details] [review]
Bug 31698: Make move_hold_item use CanItemBeReserved and add logging
Comment 11 Lucas Gass (lukeg) 2025-03-13 19:55:04 UTC
Created attachment 179287 [details] [review]
Bug 31698: Template and javascript changes to request.tt
Comment 12 Lucas Gass (lukeg) 2025-03-13 21:36:22 UTC
Created attachment 179290 [details] [review]
Bug 31698: Report errors and failures back to request.tt
Comment 13 Lucas Gass (lukeg) 2025-03-13 22:27:13 UTC
Created attachment 179291 [details] [review]
Bug 31698: Deal with priority
Comment 14 Lucas Gass (lukeg) 2025-03-13 23:29:56 UTC
Created attachment 179292 [details] [review]
Bug 31698: Improve priority
Comment 15 Lucas Gass (lukeg) 2025-03-13 23:55:28 UTC
Created attachment 179295 [details] [review]
Bug 31698: Flip the logic for priority
Comment 16 Lucas Gass (lukeg) 2025-03-25 20:15:10 UTC
Created attachment 179704 [details] [review]
Bug 31698: Add missing filters
Comment 17 Lucas Gass (lukeg) 2025-03-25 22:55:54 UTC
Created attachment 179711 [details] [review]
Bug 31698: Use _ShiftPriority to deal with priority
Comment 18 Lucas Gass (lukeg) 2025-03-25 23:22:10 UTC
Created attachment 179713 [details] [review]
Bug 31698: Call _FixPriority on orginal biblio to clean-up priorty
Comment 19 Lucas Gass (lukeg) 2025-04-21 18:19:40 UTC
Created attachment 181222 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 20 Lucas Gass (lukeg) 2025-04-21 18:19:44 UTC
Created attachment 181223 [details] [review]
Bug 31698: Add new move_hold_item subroutine to Hold.pm
Comment 21 Lucas Gass (lukeg) 2025-04-21 18:19:48 UTC
Created attachment 181224 [details] [review]
Bug 31698: Template and javascript changes to request.tt
Comment 22 Lucas Gass (lukeg) 2025-04-21 18:19:52 UTC
Created attachment 181225 [details] [review]
Bug 31698: Report errors and failures back to request.tt
Comment 23 Lucas Gass (lukeg) 2025-04-21 18:19:55 UTC
Created attachment 181226 [details] [review]
Bug 31698: Add missing filters
Comment 24 Lucas Gass (lukeg) 2025-04-21 19:23:53 UTC
Created attachment 181228 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 25 Lucas Gass (lukeg) 2025-04-21 19:23:57 UTC
Created attachment 181229 [details] [review]
Bug 31698: Add new move_hold_item subroutine to Hold.pm and request.pl
Comment 26 Lucas Gass (lukeg) 2025-04-21 19:24:00 UTC
Created attachment 181230 [details] [review]
Bug 31698: Template and javascript changes to request.tt
Comment 27 Lucas Gass (lukeg) 2025-04-21 19:24:04 UTC
Created attachment 181231 [details] [review]
Bug 31698: Report errors and failures back to request.tt
Comment 28 Lucas Gass (lukeg) 2025-04-21 21:35:49 UTC
Created attachment 181232 [details] [review]
Bug 31698: Add support for moving record level holds
Comment 29 Lucas Gass (lukeg) 2025-04-21 22:02:34 UTC
Created attachment 181233 [details] [review]
Bug 31698: Combine item and record level subroutines
Comment 30 Lucas Gass (lukeg) 2025-04-21 22:06:06 UTC
Created attachment 181234 [details] [review]
Bug 31698: Add ability to move holds to new items or new records
Comment 31 Lucas Gass (lukeg) 2025-05-05 16:44:55 UTC
Created attachment 181929 [details] [review]
Bug 31698: Fix modals for item level moves
Comment 32 Lucas Gass (lukeg) 2025-05-05 17:02:40 UTC
Created attachment 181930 [details] [review]
Bug 31698: Fix modals for biblio level moves
Comment 33 Lucas Gass (lukeg) 2025-05-05 20:53:07 UTC
Created attachment 181944 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 34 Lucas Gass (lukeg) 2025-05-05 20:53:11 UTC
Created attachment 181945 [details] [review]
Bug 31698: Add ability to move holds to new items or new records
Comment 35 Lucas Gass (lukeg) 2025-05-05 20:53:14 UTC
Created attachment 181946 [details] [review]
Bug 31698: Fix modals for item level moves
Comment 36 Lucas Gass (lukeg) 2025-05-05 20:53:18 UTC
Created attachment 181947 [details] [review]
Bug 31698: Fix modals for biblio level moves
Comment 37 Lucas Gass (lukeg) 2025-05-05 20:53:21 UTC
Created attachment 181948 [details] [review]
Bug 31698: Add unit tests
Comment 38 Lucas Gass (lukeg) 2025-05-05 22:35:50 UTC
Created attachment 181951 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 39 Lucas Gass (lukeg) 2025-05-05 22:35:54 UTC
Created attachment 181952 [details] [review]
Bug 31698: Add ability to move holds to new items or new records
Comment 40 Lucas Gass (lukeg) 2025-05-05 22:35:57 UTC
Created attachment 181953 [details] [review]
Bug 31698: Fix modals for item level moves
Comment 41 Lucas Gass (lukeg) 2025-05-05 22:36:01 UTC
Created attachment 181954 [details] [review]
Bug 31698: Fix modals for biblio level moves
Comment 42 Lucas Gass (lukeg) 2025-05-05 22:36:04 UTC
Created attachment 181955 [details] [review]
Bug 31698: Add unit tests
Comment 43 Lucas Gass (lukeg) 2025-05-05 22:36:08 UTC
Created attachment 181956 [details] [review]
Bug 31698: Disallow moving waiting or intransit holds
Comment 44 Lucas Gass (lukeg) 2025-05-05 22:38:45 UTC
Created attachment 181957 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 45 Lucas Gass (lukeg) 2025-05-05 22:38:49 UTC
Created attachment 181958 [details] [review]
Bug 31698: Add ability to move holds to new items or new records

Test plan:

1. APPLY PATCH, updatedatabase, restart_all
2. Have two staff members. 1. Superlibrarian, 2. Staff with new permission to `alter_hold_targets`
3. Now place some holds on different record, you'll want some item level holds and some record level holds.
4. After placing some holds go to a record with some holds on it.
5. Go to the holds tab (reserve/request.p)
6. You should notice a disabled 'Move selected (0)' button, next to 'Cancel selected (0)'
7. Select some holds to move, ensure that the number updates accordingly. ( Move selected (2) )
8. When you click the button you should see 2 options, 'Item level holds to a different item' and 'Record level holds to a different record'
9. Clicking on either should bring up a modal with information about the holds you selected to move.
10. If you have item level holds and you select 'Item level holds to a different item' those holds should appear pre-checked.
11. If you have item level holds and you select 'Record level holds to a different record' those holds checkboxes should be disabled by default, you should see the 'Problem' as 'Cannot move a waiting or record level hold'
12. If you are moving a item level hold you should see a searchbar labeled 'Enter the item barcode of new hold target:'.
13. Enter a full or partial barcode and click search
14. You should see your item, if it exists.
15. Check 'Move all selected item level holds to this item', once you do so the yellow 'Move selected holds' button should be enabled.
16. Click 'Move selected holds', the hold should be moved.
17. You should see a message like " Moved the following holds:
    Hold ID: 1854 - Moved from The Arden edition of the works of William Shakespeare. to The Arden edition of the works of William Shakespeare."

19. Do steps 12 - 17 again, but with a record level hold.
20. Now make or have many holds on a specific target record to test priority. Make note of the current priority
21. Now move a hold on to that record, testing both item and record level holds.
22. Now on the target record review the priority. The holds originally on the record should not have changed. The hold you move should now have the lowest priority on the record.
23. Check the original record, if a hold was moved all other priority should have been adjusted correctly. FOr example, if the hold you moved was 3 of 4 then the others should have adjusted priority of 1 2 3 now.

24. Turn on HoldsLog if it is disabled.
25. Move some holds, both item and record ones, and review the logs after each one. There should be a correct MODIFY entry for each move.

26. Make an item with a hold on it as damaged and turn on AllowHoldsOnDamagedItems. Try to move the hold, you should get an error telling you that the target item is damaged.

27. Now login as the non-superlibrarian patron from step 2. If they have the `alter_hold_targets` permission they should see the 'Move selected' button.
28. Revoke the `alter_hold_targets` permission. The button should not appear now.
Comment 46 Lucas Gass (lukeg) 2025-05-05 22:38:53 UTC
Created attachment 181959 [details] [review]
Bug 31698: Fix modals for item level moves
Comment 47 Lucas Gass (lukeg) 2025-05-05 22:38:57 UTC
Created attachment 181960 [details] [review]
Bug 31698: Fix modals for biblio level moves
Comment 48 Lucas Gass (lukeg) 2025-05-05 22:39:00 UTC
Created attachment 181961 [details] [review]
Bug 31698: Add unit tests
Comment 49 Lucas Gass (lukeg) 2025-05-05 22:39:04 UTC
Created attachment 181962 [details] [review]
Bug 31698: Disallow moving waiting or intransit holds
Comment 50 OpenFifth Sandboxes 2025-05-19 21:04:31 UTC
Created attachment 182639 [details] [review]
Bug 31698: Disallow moving waiting or intransit holds

Signed-off-by: kristi <kkrueger@cuyahogalibrary.org>
Comment 51 Kristi Krueger 2025-05-19 21:09:44 UTC
Re: Step 25, I do see in the hold log a modify entry. For example, if I created a hold on bib 20, and I move it to bib 8, the log shows the create entry with 'biblionumber'=20 and the modify entry with 'biblionumber=8 for the same object number.

Re: Step 26, I think this was supposed to be set AllowHoldsOnDamagedItems to "don't allow" If this is correct, then the error message shows as expected (see attached screenshot). If it is indeed supposed to be a turn on, that is Allow for this system preference, there is no error message.

One final thing, sometimes on moving record level holds, it shows the checkbox/"Move all selected record level holds..." message twice (see attached RecordLevel_ListTwice.PNG) I didn't think this was big enough not to sign off, but I wanted to call it out.
Comment 52 Kristi Krueger 2025-05-19 21:11:12 UTC
Created attachment 182640 [details]
Error Message for Don't allow holds on damaged items
Comment 53 Kristi Krueger 2025-05-19 21:11:54 UTC
Created attachment 182641 [details]
Checkbox for record level moves sometimes shows twice
Comment 54 Lucas Gass (lukeg) 2025-06-10 21:20:51 UTC
Bug 23269 is going to conflict with this one, I'll need to rebase this on top of that one.
Comment 55 Lucas Gass (lukeg) 2025-06-16 19:44:59 UTC
(In reply to Lucas Gass (lukeg) from comment #54)
> Bug 23269 is going to conflict with this one, I'll need to rebase this on
> top of that one.

Well, maybe not. Bug 23269 has some problems and I don't want to wait.
Comment 56 Lucas Gass (lukeg) 2025-07-28 14:00:54 UTC
Created attachment 184750 [details] [review]
Bug 31698: Ensure searches for biblio records return only unique bibs
Comment 57 Lucas Gass (lukeg) 2025-07-28 14:19:30 UTC
> Re: Step 26, I think this was supposed to be set AllowHoldsOnDamagedItems to
> "don't allow" If this is correct, then the error message shows as expected
> (see attached screenshot). If it is indeed supposed to be a turn on, that is
> Allow for this system preference, there is no error message.
Yes, this is a mistake in the test plan. 


> One final thing, sometimes on moving record level holds, it shows the
> checkbox/"Move all selected record level holds..." message twice (see
> attached RecordLevel_ListTwice.PNG) I didn't think this was big enough not
> to sign off, but I wanted to call it out.
I have added a patch that should fix this problem. 


Thanks for testing!
Comment 58 Lucas Gass (lukeg) 2025-08-01 16:11:09 UTC
Created attachment 185050 [details] [review]
Bug 31698: Adjust number of tests
Comment 59 Lucas Gass (lukeg) 2025-08-01 16:21:32 UTC
Created attachment 185064 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 60 Lucas Gass (lukeg) 2025-08-01 16:21:36 UTC
Created attachment 185065 [details] [review]
Bug 31698: Add ability to move holds to new items or new records

Test plan:

1. APPLY PATCH, updatedatabase, restart_all
2. Have two staff members. 1. Superlibrarian, 2. Staff with new permission to `alter_hold_targets`
3. Now place some holds on different record, you'll want some item level holds and some record level holds.
4. After placing some holds go to a record with some holds on it.
5. Go to the holds tab (reserve/request.p)
6. You should notice a disabled 'Move selected (0)' button, next to 'Cancel selected (0)'
7. Select some holds to move, ensure that the number updates accordingly. ( Move selected (2) )
8. When you click the button you should see 2 options, 'Item level holds to a different item' and 'Record level holds to a different record'
9. Clicking on either should bring up a modal with information about the holds you selected to move.
10. If you have item level holds and you select 'Item level holds to a different item' those holds should appear pre-checked.
11. If you have item level holds and you select 'Record level holds to a different record' those holds checkboxes should be disabled by default, you should see the 'Problem' as 'Cannot move a waiting or record level hold'
12. If you are moving a item level hold you should see a searchbar labeled 'Enter the item barcode of new hold target:'.
13. Enter a full or partial barcode and click search
14. You should see your item, if it exists.
15. Check 'Move all selected item level holds to this item', once you do so the yellow 'Move selected holds' button should be enabled.
16. Click 'Move selected holds', the hold should be moved.
17. You should see a message like " Moved the following holds:
    Hold ID: 1854 - Moved from The Arden edition of the works of William Shakespeare. to The Arden edition of the works of William Shakespeare."

19. Do steps 12 - 17 again, but with a record level hold.
20. Now make or have many holds on a specific target record to test priority. Make note of the current priority
21. Now move a hold on to that record, testing both item and record level holds.
22. Now on the target record review the priority. The holds originally on the record should not have changed. The hold you move should now have the lowest priority on the record.
23. Check the original record, if a hold was moved all other priority should have been adjusted correctly. FOr example, if the hold you moved was 3 of 4 then the others should have adjusted priority of 1 2 3 now.

24. Turn on HoldsLog if it is disabled.
25. Move some holds, both item and record ones, and review the logs after each one. There should be a correct MODIFY entry for each move.

26. Make an item with a hold on it as damaged and turn on AllowHoldsOnDamagedItems. Try to move the hold, you should get an error telling you that the target item is damaged.

27. Now login as the non-superlibrarian patron from step 2. If they have the `alter_hold_targets` permission they should see the 'Move selected' button.
28. Revoke the `alter_hold_targets` permission. The button should not appear now.
Comment 61 Lucas Gass (lukeg) 2025-08-01 16:21:40 UTC
Created attachment 185066 [details] [review]
Bug 31698: Fix modals for item level moves
Comment 62 Lucas Gass (lukeg) 2025-08-01 16:21:45 UTC
Created attachment 185067 [details] [review]
Bug 31698: Fix modals for biblio level moves
Comment 63 Lucas Gass (lukeg) 2025-08-01 16:21:49 UTC
Created attachment 185068 [details] [review]
Bug 31698: Add unit tests
Comment 64 Lucas Gass (lukeg) 2025-08-01 16:21:54 UTC
Created attachment 185069 [details] [review]
Bug 31698: Disallow moving waiting or intransit holds

Signed-off-by: kristi <kkrueger@cuyahogalibrary.org>
Comment 65 Lucas Gass (lukeg) 2025-08-01 16:21:58 UTC
Created attachment 185070 [details] [review]
Bug 31698: Ensure searches for biblio records return only unique bibs
Comment 66 Pedro Amorim 2025-08-05 14:11:34 UTC
Hey all, nice feature! From my testing everything appears to be working nicely, but I have some comments:

A) Step 6: The 'Move selected (0)' button is not disabled. It's styled differently to the 'Cancel selected (0)' button. It still expands options when clicked even if no holds are selected. My suggestion would be to style it the same as 'Cancel selected (0)' and not expand options if no holds are selected. Ideally using the 'disabled' CSS class but may be out of scope (?).

B) Step 13: If you enter a partial barcode like '76', 20 hits are returned (I believe only limited by the default paging of 20 from the REST API). I don't know if this needs addressing or not, but I wonder if an exact match for barcode here makes more sense.

C) Step 15: Clicking 'Move all selected item level holds to this item' does enable the 'Move selected holds' button and the checkbox column under the 'Review holds to move' is ticked by default. If you untick the latter, and keep the top 'Move all...' checkbox ticked, then click 'Move selected holds', the page redirects as if something happened, but no holds were moved (because none were selected, in the modal). My suggestion would be to have this button disabled if no 'holds to move' are ticked. 

D) Step 17: After moving the hold(s), it's nice that a message is shown 'Moved from X to Y', but the URL becomes '/cgi-bin/koha/reserve/request.pl'. This causes clicks on any of the links on the left side menu to result on a 404 (or 500) errors. My suggestion would be to have this URL '/cgi-bin/koha/reserve/request.pl?biblionumber=X' with the original record's biblionumber (the 'moved from' record).

E) Step 19: Moving record level holds, the modal says 'Enter the biblionumber of new hold target', but if you enter 'xyz' and then search, the error shown is 'No item found with barcode: xyz'. This error message should refer to the biblionumber e.g. 'Biblionumber 'xyz' not found.'


I think these are all very minor, with the exception perhaps of D) that I'd consider a bit more of a blocker.
Comment 67 Pedro Amorim 2025-08-05 14:12:09 UTC
Created attachment 185121 [details] [review]
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios

Instead of filtering response on the client.
Comment 68 Pedro Amorim 2025-08-05 14:14:55 UTC
Lucas I added a follow-up that implements your last patch differently, querying the biblios endpoint directly instead of using the items endpoint and then filtering on the client side. I've tested it myself to ensure it works, of course, but if my patch introduces issues or it's not worth it please feel free to obsolete!
Comment 69 Lucas Gass (lukeg) 2025-08-13 21:01:48 UTC
Created attachment 185379 [details] [review]
Bug 31698: Style move selected button and disable when nothing is selected
Comment 70 Lucas Gass (lukeg) 2025-08-13 22:11:34 UTC
Created attachment 185380 [details] [review]
Bug 31698: Make searches return only exact matches for barcode/biblionumber
Comment 71 Lucas Gass (lukeg) 2025-08-20 21:08:33 UTC
Created attachment 185607 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 72 Lucas Gass (lukeg) 2025-08-20 21:08:38 UTC
Created attachment 185608 [details] [review]
Bug 31698: Add ability to move holds to new items or new records

Test plan:

1. APPLY PATCH, updatedatabase, restart_all
2. Have two staff members. 1. Superlibrarian, 2. Staff with new permission to `alter_hold_targets`
3. Now place some holds on different record, you'll want some item level holds and some record level holds.
4. After placing some holds go to a record with some holds on it.
5. Go to the holds tab (reserve/request.p)
6. You should notice a disabled 'Move selected (0)' button, next to 'Cancel selected (0)'
7. Select some holds to move, ensure that the number updates accordingly. ( Move selected (2) )
8. When you click the button you should see 2 options, 'Item level holds to a different item' and 'Record level holds to a different record'
9. Clicking on either should bring up a modal with information about the holds you selected to move.
10. If you have item level holds and you select 'Item level holds to a different item' those holds should appear pre-checked.
11. If you have item level holds and you select 'Record level holds to a different record' those holds checkboxes should be disabled by default, you should see the 'Problem' as 'Cannot move a waiting or record level hold'
12. If you are moving a item level hold you should see a searchbar labeled 'Enter the item barcode of new hold target:'.
13. Enter a full or partial barcode and click search
14. You should see your item, if it exists.
15. Check 'Move all selected item level holds to this item', once you do so the yellow 'Move selected holds' button should be enabled.
16. Click 'Move selected holds', the hold should be moved.
17. You should see a message like " Moved the following holds:
    Hold ID: 1854 - Moved from The Arden edition of the works of William Shakespeare. to The Arden edition of the works of William Shakespeare."

19. Do steps 12 - 17 again, but with a record level hold.
20. Now make or have many holds on a specific target record to test priority. Make note of the current priority
21. Now move a hold on to that record, testing both item and record level holds.
22. Now on the target record review the priority. The holds originally on the record should not have changed. The hold you move should now have the lowest priority on the record.
23. Check the original record, if a hold was moved all other priority should have been adjusted correctly. FOr example, if the hold you moved was 3 of 4 then the others should have adjusted priority of 1 2 3 now.

24. Turn on HoldsLog if it is disabled.
25. Move some holds, both item and record ones, and review the logs after each one. There should be a correct MODIFY entry for each move.

26. Make an item with a hold on it as damaged and turn on AllowHoldsOnDamagedItems. Try to move the hold, you should get an error telling you that the target item is damaged.

27. Now login as the non-superlibrarian patron from step 2. If they have the `alter_hold_targets` permission they should see the 'Move selected' button.
28. Revoke the `alter_hold_targets` permission. The button should not appear now.
Comment 73 Lucas Gass (lukeg) 2025-08-20 21:08:43 UTC
Created attachment 185609 [details] [review]
Bug 31698: Fix modals for item level moves
Comment 74 Lucas Gass (lukeg) 2025-08-20 21:08:47 UTC
Created attachment 185610 [details] [review]
Bug 31698: Fix modals for biblio level moves
Comment 75 Lucas Gass (lukeg) 2025-08-20 21:08:52 UTC
Created attachment 185611 [details] [review]
Bug 31698: Add unit tests
Comment 76 Lucas Gass (lukeg) 2025-08-20 21:08:56 UTC
Created attachment 185612 [details] [review]
Bug 31698: Disallow moving waiting or intransit holds

Signed-off-by: kristi <kkrueger@cuyahogalibrary.org>
Comment 77 Lucas Gass (lukeg) 2025-08-20 21:09:01 UTC
Created attachment 185613 [details] [review]
Bug 31698: Ensure searches for biblio records return only unique bibs
Comment 78 Lucas Gass (lukeg) 2025-08-20 21:09:06 UTC
Created attachment 185614 [details] [review]
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios

Instead of filtering response on the client.
Comment 79 Lucas Gass (lukeg) 2025-08-20 21:09:11 UTC
Created attachment 185615 [details] [review]
Bug 31698: Style move selected button and disable when nothing is selected
Comment 80 Lucas Gass (lukeg) 2025-08-20 21:09:16 UTC
Created attachment 185616 [details] [review]
Bug 31698: Make searches return only exact matches for barcode/biblionumber
Comment 81 Lucas Gass (lukeg) 2025-08-25 20:54:40 UTC
Created attachment 185753 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 82 Lucas Gass (lukeg) 2025-08-25 20:54:56 UTC
Created attachment 185754 [details] [review]
Bug 31698: Add ability to move holds to new items or new records

Test plan:

1. APPLY PATCH, updatedatabase, restart_all
2. Have two staff members. 1. Superlibrarian, 2. Staff with new permission to `alter_hold_targets`
3. Now place some holds on different record, you'll want some item level holds and some record level holds.
4. After placing some holds go to a record with some holds on it.
5. Go to the holds tab (reserve/request.p)
6. You should notice a disabled 'Move selected (0)' button, next to 'Cancel selected (0)'
7. Select some holds to move, ensure that the number updates accordingly. ( Move selected (2) )
8. When you click the button you should see 2 options, 'Item level holds to a different item' and 'Record level holds to a different record'
9. Clicking on either should bring up a modal with information about the holds you selected to move.
10. If you have item level holds and you select 'Item level holds to a different item' those holds should appear pre-checked.
11. If you have item level holds and you select 'Record level holds to a different record' those holds checkboxes should be disabled by default, you should see the 'Problem' as 'Cannot move a waiting or record level hold'
12. If you are moving a item level hold you should see a searchbar labeled 'Enter the item barcode of new hold target:'.
13. Enter a full or partial barcode and click search
14. You should see your item, if it exists.
15. Check 'Move all selected item level holds to this item', once you do so the yellow 'Move selected holds' button should be enabled.
16. Click 'Move selected holds', the hold should be moved.
17. You should see a message like " Moved the following holds:
    Hold ID: 1854 - Moved from The Arden edition of the works of William Shakespeare. to The Arden edition of the works of William Shakespeare."

19. Do steps 12 - 17 again, but with a record level hold.
20. Now make or have many holds on a specific target record to test priority. Make note of the current priority
21. Now move a hold on to that record, testing both item and record level holds.
22. Now on the target record review the priority. The holds originally on the record should not have changed. The hold you move should now have the lowest priority on the record.
23. Check the original record, if a hold was moved all other priority should have been adjusted correctly. FOr example, if the hold you moved was 3 of 4 then the others should have adjusted priority of 1 2 3 now.

24. Turn on HoldsLog if it is disabled.
25. Move some holds, both item and record ones, and review the logs after each one. There should be a correct MODIFY entry for each move.

26. Make an item with a hold on it as damaged and turn on AllowHoldsOnDamagedItems. Try to move the hold, you should get an error telling you that the target item is damaged.

27. Now login as the non-superlibrarian patron from step 2. If they have the `alter_hold_targets` permission they should see the 'Move selected' button.
28. Revoke the `alter_hold_targets` permission. The button should not appear now.
Comment 83 Lucas Gass (lukeg) 2025-08-25 20:55:06 UTC
Created attachment 185755 [details] [review]
Bug 31698: Fix modals for item level moves
Comment 84 Lucas Gass (lukeg) 2025-08-25 20:55:17 UTC
Created attachment 185756 [details] [review]
Bug 31698: Fix modals for biblio level moves
Comment 85 Lucas Gass (lukeg) 2025-08-25 20:55:28 UTC
Created attachment 185757 [details] [review]
Bug 31698: Add unit tests
Comment 86 Lucas Gass (lukeg) 2025-08-25 20:55:39 UTC
Created attachment 185758 [details] [review]
Bug 31698: Disallow moving waiting or intransit holds

Signed-off-by: kristi <kkrueger@cuyahogalibrary.org>
Comment 87 Lucas Gass (lukeg) 2025-08-25 20:55:48 UTC
Created attachment 185759 [details] [review]
Bug 31698: Ensure searches for biblio records return only unique bibs
Comment 88 Lucas Gass (lukeg) 2025-08-25 20:55:59 UTC
Created attachment 185760 [details] [review]
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios

Instead of filtering response on the client.
Comment 89 Lucas Gass (lukeg) 2025-08-25 20:56:09 UTC
Created attachment 185761 [details] [review]
Bug 31698: Style move selected button and disable when nothing is selected
Comment 90 Lucas Gass (lukeg) 2025-08-25 20:56:16 UTC
Created attachment 185762 [details] [review]
Bug 31698: Make searches return only exact matches for barcode/biblionumber
Comment 91 Lucas Gass (lukeg) 2025-08-25 20:56:21 UTC
Created attachment 185763 [details] [review]
Bug 31698: Move request.tt JS to hold.js
Comment 92 Lucas Gass (lukeg) 2025-08-25 21:50:59 UTC
Created attachment 185764 [details] [review]
Bug 31698: Report errors and failures back to request.tt
Comment 93 Lucas Gass (lukeg) 2025-08-25 21:59:09 UTC
Created attachment 185765 [details] [review]
Bug 31698: Add alter_hold_targets permission
Comment 94 Lucas Gass (lukeg) 2025-08-25 21:59:31 UTC
Created attachment 185766 [details] [review]
Bug 31698: Add ability to move holds to new items or new records

Test plan:

1. APPLY PATCH, updatedatabase, restart_all
2. Have two staff members. 1. Superlibrarian, 2. Staff with new permission to `alter_hold_targets`
3. Now place some holds on different record, you'll want some item level holds and some record level holds.
4. After placing some holds go to a record with some holds on it.
5. Go to the holds tab (reserve/request.p)
6. You should notice a disabled 'Move selected (0)' button, next to 'Cancel selected (0)'
7. Select some holds to move, ensure that the number updates accordingly. ( Move selected (2) )
8. When you click the button you should see 2 options, 'Item level holds to a different item' and 'Record level holds to a different record'
9. Clicking on either should bring up a modal with information about the holds you selected to move.
10. If you have item level holds and you select 'Item level holds to a different item' those holds should appear pre-checked.
11. If you have item level holds and you select 'Record level holds to a different record' those holds checkboxes should be disabled by default, you should see the 'Problem' as 'Cannot move a waiting or record level hold'
12. If you are moving a item level hold you should see a searchbar labeled 'Enter the item barcode of new hold target:'.
13. Enter a full or partial barcode and click search
14. You should see your item, if it exists.
15. Check 'Move all selected item level holds to this item', once you do so the yellow 'Move selected holds' button should be enabled.
16. Click 'Move selected holds', the hold should be moved.
17. You should see a message like " Moved the following holds:
    Hold ID: 1854 - Moved from The Arden edition of the works of William Shakespeare. to The Arden edition of the works of William Shakespeare."

19. Do steps 12 - 17 again, but with a record level hold.
20. Now make or have many holds on a specific target record to test priority. Make note of the current priority
21. Now move a hold on to that record, testing both item and record level holds.
22. Now on the target record review the priority. The holds originally on the record should not have changed. The hold you move should now have the lowest priority on the record.
23. Check the original record, if a hold was moved all other priority should have been adjusted correctly. FOr example, if the hold you moved was 3 of 4 then the others should have adjusted priority of 1 2 3 now.

24. Turn on HoldsLog if it is disabled.
25. Move some holds, both item and record ones, and review the logs after each one. There should be a correct MODIFY entry for each move.

26. Make an item with a hold on it as damaged and turn on AllowHoldsOnDamagedItems. Try to move the hold, you should get an error telling you that the target item is damaged.

27. Now login as the non-superlibrarian patron from step 2. If they have the `alter_hold_targets` permission they should see the 'Move selected' button.
28. Revoke the `alter_hold_targets` permission. The button should not appear now.
Comment 95 Lucas Gass (lukeg) 2025-08-25 21:59:43 UTC
Created attachment 185767 [details] [review]
Bug 31698: Fix modals for item level moves
Comment 96 Lucas Gass (lukeg) 2025-08-25 21:59:48 UTC
Created attachment 185768 [details] [review]
Bug 31698: Fix modals for biblio level moves
Comment 97 Lucas Gass (lukeg) 2025-08-25 21:59:52 UTC
Created attachment 185769 [details] [review]
Bug 31698: Add unit tests
Comment 98 Lucas Gass (lukeg) 2025-08-25 22:00:04 UTC
Created attachment 185770 [details] [review]
Bug 31698: Disallow moving waiting or intransit holds

Signed-off-by: kristi <kkrueger@cuyahogalibrary.org>
Comment 99 Lucas Gass (lukeg) 2025-08-25 22:00:10 UTC
Created attachment 185771 [details] [review]
Bug 31698: Ensure searches for biblio records return only unique bibs
Comment 100 Lucas Gass (lukeg) 2025-08-25 22:00:15 UTC
Created attachment 185772 [details] [review]
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios

Instead of filtering response on the client.
Comment 101 Lucas Gass (lukeg) 2025-08-25 22:00:20 UTC
Created attachment 185773 [details] [review]
Bug 31698: Style move selected button and disable when nothing is selected
Comment 102 Lucas Gass (lukeg) 2025-08-25 22:00:24 UTC
Created attachment 185774 [details] [review]
Bug 31698: Make searches return only exact matches for barcode/biblionumber
Comment 103 Lucas Gass (lukeg) 2025-08-25 22:00:29 UTC
Created attachment 185775 [details] [review]
Bug 31698: Report errors and failures back to request.tt
Comment 104 Lucas Gass (lukeg) 2025-08-25 22:00:34 UTC
Created attachment 185776 [details] [review]
Bug 31698: Move request.tt JS to hold.js
Comment 105 Lucas Gass (lukeg) 2025-08-27 15:55:21 UTC
Created attachment 185834 [details] [review]
Bug 31698: Move reamining JS to hold.js
Comment 106 Pedro Amorim 2025-09-03 15:47:29 UTC
Created attachment 186085 [details] [review]
Bug 31698: Add alter_hold_targets permission

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 107 Pedro Amorim 2025-09-03 15:47:38 UTC
Created attachment 186086 [details] [review]
Bug 31698: Add ability to move holds to new items or new records

Test plan:

1. APPLY PATCH, updatedatabase, restart_all
2. Have two staff members. 1. Superlibrarian, 2. Staff with new permission to `alter_hold_targets`
3. Now place some holds on different record, you'll want some item level holds and some record level holds.
4. After placing some holds go to a record with some holds on it.
5. Go to the holds tab (reserve/request.p)
6. You should notice a disabled 'Move selected (0)' button, next to 'Cancel selected (0)'
7. Select some holds to move, ensure that the number updates accordingly. ( Move selected (2) )
8. When you click the button you should see 2 options, 'Item level holds to a different item' and 'Record level holds to a different record'
9. Clicking on either should bring up a modal with information about the holds you selected to move.
10. If you have item level holds and you select 'Item level holds to a different item' those holds should appear pre-checked.
11. If you have item level holds and you select 'Record level holds to a different record' those holds checkboxes should be disabled by default, you should see the 'Problem' as 'Cannot move a waiting or record level hold'
12. If you are moving a item level hold you should see a searchbar labeled 'Enter the item barcode of new hold target:'.
13. Enter a full or partial barcode and click search
14. You should see your item, if it exists.
15. Check 'Move all selected item level holds to this item', once you do so the yellow 'Move selected holds' button should be enabled.
16. Click 'Move selected holds', the hold should be moved.
17. You should see a message like " Moved the following holds:
    Hold ID: 1854 - Moved from The Arden edition of the works of William Shakespeare. to The Arden edition of the works of William Shakespeare."

19. Do steps 12 - 17 again, but with a record level hold.
20. Now make or have many holds on a specific target record to test priority. Make note of the current priority
21. Now move a hold on to that record, testing both item and record level holds.
22. Now on the target record review the priority. The holds originally on the record should not have changed. The hold you move should now have the lowest priority on the record.
23. Check the original record, if a hold was moved all other priority should have been adjusted correctly. FOr example, if the hold you moved was 3 of 4 then the others should have adjusted priority of 1 2 3 now.

24. Turn on HoldsLog if it is disabled.
25. Move some holds, both item and record ones, and review the logs after each one. There should be a correct MODIFY entry for each move.

26. Make an item with a hold on it as damaged and turn on AllowHoldsOnDamagedItems. Try to move the hold, you should get an error telling you that the target item is damaged.

27. Now login as the non-superlibrarian patron from step 2. If they have the `alter_hold_targets` permission they should see the 'Move selected' button.
28. Revoke the `alter_hold_targets` permission. The button should not appear now.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 108 Pedro Amorim 2025-09-03 15:47:48 UTC
Created attachment 186087 [details] [review]
Bug 31698: Fix modals for item level moves

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 109 Pedro Amorim 2025-09-03 15:47:57 UTC
Created attachment 186088 [details] [review]
Bug 31698: Fix modals for biblio level moves

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 110 Pedro Amorim 2025-09-03 15:48:06 UTC
Created attachment 186089 [details] [review]
Bug 31698: Add unit tests

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 111 Pedro Amorim 2025-09-03 15:48:17 UTC
Created attachment 186090 [details] [review]
Bug 31698: Disallow moving waiting or intransit holds

Signed-off-by: kristi <kkrueger@cuyahogalibrary.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 112 Pedro Amorim 2025-09-03 15:48:28 UTC
Created attachment 186091 [details] [review]
Bug 31698: Ensure searches for biblio records return only unique bibs

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 113 Pedro Amorim 2025-09-03 15:48:32 UTC
Created attachment 186092 [details] [review]
Bug 31698: (QA follow-up): Query biblios endpoint when searching biblios

Instead of filtering response on the client.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 114 Pedro Amorim 2025-09-03 15:48:35 UTC
Created attachment 186093 [details] [review]
Bug 31698: Style move selected button and disable when nothing is selected

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 115 Pedro Amorim 2025-09-03 15:48:39 UTC
Created attachment 186094 [details] [review]
Bug 31698: Make searches return only exact matches for barcode/biblionumber

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 116 Pedro Amorim 2025-09-03 15:48:43 UTC
Created attachment 186095 [details] [review]
Bug 31698: Report errors and failures back to request.tt

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 117 Pedro Amorim 2025-09-03 15:48:47 UTC
Created attachment 186096 [details] [review]
Bug 31698: Move request.tt JS to hold.js

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 118 Pedro Amorim 2025-09-03 15:48:51 UTC
Created attachment 186097 [details] [review]
Bug 31698: Move reamining JS to hold.js

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 119 Pedro Amorim 2025-09-03 15:48:55 UTC
Created attachment 186098 [details] [review]
Bug 31698: (QA follow-up): Prevent display 'NaN' UI error message

If the input is not a number, display an appropriate error message.
Additionally, don't make an API call unless the input is a number.

Test by doing the following:
1) Step 19: Moving record level holds, the modal says 'Enter the biblionumber of new hold target', but if you enter 'xyz' and then search, the error shown is 'No item found with barcode: NaN'.

This patch fixes that.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 120 Pedro Amorim 2025-09-03 15:50:21 UTC
Hi Lucas:
1) I've added a follow-up. Please check if you agree.
2) Passing QA as all my observations were addressed (thank you!) and QA script is happy, however
3) Can you please ensure that all the new code in holds.js is translatable e.g.:

$("#itemResultMessage").html(`
  <div class="alert alert-warning">No item found with barcode: ${externalID}.</div>
);
Comment 121 Lucas Gass (lukeg) 2025-09-03 19:20:25 UTC
Created attachment 186105 [details] [review]
Bug 31698: Make strings in holds.js translatable
Comment 122 Lucas Gass (lukeg) 2025-09-03 19:21:27 UTC
(In reply to Pedro Amorim from comment #120)
> Hi Lucas:
> 1) I've added a follow-up. Please check if you agree.
> 2) Passing QA as all my observations were addressed (thank you!) and QA
> script is happy, however
> 3) Can you please ensure that all the new code in holds.js is translatable
> e.g.:
> 
> $("#itemResultMessage").html(`
>   <div class="alert alert-warning">No item found with barcode:
> ${externalID}.</div>
> );


I agree with your follow-up, thanks! I have also supplied a follow to make the string translatable.
Comment 123 Pedro Amorim 2025-09-04 08:31:46 UTC
Created attachment 186115 [details] [review]
Bug 31698: Make strings in holds.js translatable

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 124 Lucas Gass (lukeg) 2025-09-05 19:43:31 UTC
Created attachment 186247 [details] [review]
Bug 31698: Add alter_hold_targets to t/Koha/Auth/Permissions.t
Comment 125 Lucas Gass (lukeg) 2025-09-05 21:14:04 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 126 Kristi Krueger 2025-09-08 12:47:54 UTC
This is great news! So happy to see this. Any chance for backports on this?