[Bug 42444] New: Update waitingreserves.pl to use API to fetch data
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Bug ID: 42444 Summary: Update waitingreserves.pl to use API to fetch data Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com The Holds Awaiting Pickup page is a pain point for larger systems with many holds. We should update how it fetches, displays, and interacts with data. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 198914 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198914&action=edit [DO NOT PUSH] Bug 42444: Sample waiting holds injection script Adds t/lib/sample_waiting_holds.pl which creates 35 waiting holds covering all display scenarios: - 28 current waiting holds (pagination test) - 7 expired waiting holds - 3 holds with cancellation requests - Holds with desk assigned - Items with different home/holding branch (transfer on cancel) - Items with shelving location, call number, copy number, enumchron - Patrons with varied primary_contact_method values - Patrons with email and phone numbers Usage: $ ktd --shell k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl Assisted-by: Sonnet 4.6 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 198915 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198915&action=edit Bug 42444: Add missing embeds for waiting holds page The waiting holds page (waitingreserves.pl) needs data that is not currently exposed through the holds API embeds. This patch adds: - desk: the desk object (name) for holds assigned to a desk - item+strings: item with string representations (library names, location descriptions, item type labels) - cancellation_requests: the actual cancellation request objects with creation_date (the existing cancellation_requested embed only returns a boolean) - patron.notice_email_address: the computed email address used for notices (respects EmailFieldPrimary syspref). Also added as a direct embed on GET /patrons and GET /patrons/{patron_id}. All underlying relationships and methods already exist in Koha::Hold, Koha::Patron, and the DBIC schema. This patch only adds them to the OpenAPI specification enum lists. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! 3. Verify the new embeds work: GET /api/v1/holds?status=W x-koha-embed: desk,item+strings,cancellation_requests,patron,patron.notice_email_address => SUCCESS: Response includes desk, item with _strings, cancellation_requests array, and patron with notice_email_address field 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 198916 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198916&action=edit Bug 42444: Convert waiting holds page to API-driven The waiting holds page (circ/waitingreserves.pl) loaded all waiting holds at once server-side, which is slow for libraries with many waiting holds. This patch converts it to use the REST API with DataTables for paginated, client-side rendering. Changes: - circ/waitingreserves.pl: stripped down to auth + POST actions (cancel single, cancel bulk, cancel all expired). Data loading removed entirely. - waitingreserves.tt: replaced server-rendered FOREACH loops with three kohaTable instances calling /api/v1/holds with appropriate JSON query filters: * Holds waiting: status=W, expiration_date >= today * Holds over: status=W, expiration_date < today * Cancellation requests: status=W, has cancellation_requests - Embeds used: patron, patron.notice_email_address, biblio, item+strings, desk, cancellation_requests (last tab only) - Removes waiting_holds.inc (no longer used anywhere) Test plan: 1. Apply patches (including the [DO NOT PUSH] sample data commit) 2. Populate sample data: $ ktd --shell k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl => SUCCESS: Creates 35 waiting holds covering all scenarios 3. Navigate to Circulation > Holds awaiting pickup 4. Verify 'Holds waiting' tab: => SUCCESS: Shows ~28 current holds with pagination => Columns: waiting date, hold date, expiration date, title (with barcode and item type), patron info, libraries, location, call number, copy number, enumeration => Some holds show desk name next to current library => Items with different home/holding branch show 'Cancel hold and return to: <library>' 5. Verify 'Holds waiting past their expiration date' tab: => SUCCESS: Shows 7 expired holds => 'Cancel all' button present and functional 6. Verify 'Holds with cancellation requests' tab: => SUCCESS: Shows 3 holds with cancellation request date column 7. Verify patron column: => Name links to patron detail page => Phone number displayed => Email displayed (uses patron.notice_email_address embed, respects EmailFieldPrimary syspref) => Main contact method label displayed (Primary phone, Primary email, Secondary phone, etc.) 8. Verify sorting works on all columns (server-side via API) 9. Test cancel single hold (form POST, check confirmation message) 10. Test bulk cancel (select multiple via checkboxes, confirm in modal, verify background job enqueued) 11. Test 'Cancel all' on expired holds tab 12. Verify 'View all libraries' link works (allbranches=1) 13. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Small patch |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Alex Carver [Acerock7] <alex@rcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex@rcls.org Status|Needs Signoff |Failed QA --- Comment #4 from Alex Carver [Acerock7] <alex@rcls.org> --- Hitting an issue at step 4. Navigating to the Holds Awaiting Pickup tab after applying the patch results in the following error popup: Something went wrong when loading the table. 400: Bad Request Not in enum list: +strings, cancellation_requested, biblio, deleted_biblio, pickup_library, item, patron, item_group, item_level_holds_count, iso18626_request. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #5 from Alex Carver [Acerock7] <alex@rcls.org> --- yarn build gets me just a touch further. I am no longer getting the error but the list never populates on Holds awaiting pickup. The processing box remains on the page indefinitely. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emmi.takkinen@koha-suomi.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198914|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198915|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198916|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #6 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 199198 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199198&action=edit [DO NOT PUSH] Bug 42444: Sample waiting holds injection script Adds t/lib/sample_waiting_holds.pl which creates 35 waiting holds covering all display scenarios: - 28 current waiting holds (pagination test) - 7 expired waiting holds - 3 holds with cancellation requests - Holds with desk assigned - Items with different home/holding branch (transfer on cancel) - Items with shelving location, call number, copy number, enumchron - Patrons with varied primary_contact_method values - Patrons with email and phone numbers Usage: $ ktd --shell k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl Assisted-by: Sonnet 4.6 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #7 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 199199 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199199&action=edit Bug 42444: Add missing embeds for waiting holds page The waiting holds page (waitingreserves.pl) needs data that is not currently exposed through the holds API embeds. This patch adds: - desk: the desk object (name) for holds assigned to a desk - item+strings: item with string representations (library names, location descriptions, item type labels) - cancellation_requests: the actual cancellation request objects with creation_date (the existing cancellation_requested embed only returns a boolean) - patron.notice_email_address: the computed email address used for notices (respects EmailFieldPrimary syspref). Also added as a direct embed on GET /patrons and GET /patrons/{patron_id}. All underlying relationships and methods already exist in Koha::Hold, Koha::Patron, and the DBIC schema. This patch only adds them to the OpenAPI specification enum lists. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! 3. Verify the new embeds work: GET /api/v1/holds?status=W x-koha-embed: desk,item+strings,cancellation_requests,patron,patron.notice_email_address => SUCCESS: Response includes desk, item with _strings, cancellation_requests array, and patron with notice_email_address field 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #8 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 199200 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199200&action=edit Bug 42444: Convert waiting holds page to API-driven The waiting holds page (circ/waitingreserves.pl) loaded all waiting holds at once server-side, which is slow for libraries with many waiting holds. This patch converts it to use the REST API with DataTables for paginated, client-side rendering. Changes: - circ/waitingreserves.pl: stripped down to auth + POST actions (cancel single, cancel bulk, cancel all expired). Data loading removed entirely. - waitingreserves.tt: replaced server-rendered FOREACH loops with three kohaTable instances calling /api/v1/holds with appropriate JSON query filters: * Holds waiting: status=W, expiration_date >= today * Holds over: status=W, expiration_date < today * Cancellation requests: status=W, has cancellation_requests - Embeds used: patron, patron.category, patron.notice_email_address, biblio, item+strings, item.holding_library, item.home_library, desk, cancellation_requests (last tab only) - Library columns sort by name via embedded relationships - Removes waiting_holds.inc (no longer used anywhere) Note: Shelving location sorting is intentionally disabled. The location value is an authorised value code resolved to a description via item+strings. Server-side sorting by AV description would require embedding the authorised_values table, which is not currently supported by the framework. Test plan: 1. Apply patches (including the [DO NOT PUSH] sample data commit) 2. Populate sample data: $ ktd --shell k$ yarn build ; koha-plack --restart kohadev k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl => SUCCESS: Creates 35 waiting holds covering all scenarios 3. Navigate to Circulation > Holds awaiting pickup 4. Verify 'Holds waiting' tab: => SUCCESS: Shows ~28 current holds with pagination => Columns: waiting date, hold date, expiration date, title (with barcode and item type), patron info, libraries, location, call number, copy number, enumeration => Some holds show desk name next to current library => Items with different home/holding branch show 'Cancel hold and return to: <library>' 5. Verify 'Holds waiting past their expiration date' tab: => SUCCESS: Shows 7 expired holds => 'Cancel all' button present and functional 6. Verify 'Holds with cancellation requests' tab: => SUCCESS: Shows 3 holds with cancellation request date column 7. Verify patron column: => Name links to patron detail page => Phone number displayed => Email displayed (uses patron.notice_email_address embed, respects EmailFieldPrimary syspref) => Main contact method label displayed (Primary phone, Primary email, Secondary phone, etc.) 8. Verify sorting works on all sortable columns (server-side via API) 9. Test cancel single hold (form POST, check confirmation message) 10. Test bulk cancel (select multiple via checkboxes, confirm in modal, verify background job enqueued) 11. Test 'Cancel all' on expired holds tab 12. Verify 'View all libraries' link works (allbranches=1) 13. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k QA Contact|testopia@bugs.koha-communit |pedro.amorim@openfifth.co.u |y.org |k -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #9 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Testing notes: - Step 12 (View all libraries) is required before step 4 for the numbers in the test plan to match what's shown. - Non-blocker: 'Cancel all' should ideally only show if there are some entries to cancel, but likely not related to this work. Some regressions (don't think any individual regression is a blocker specifically, but worth mentioning): 1) The old template had: href="mailto:[% ... | uri %]?subject=[% "Hold waiting: " | uri %][% reserveloo.biblio.title | uri %]" The new code drops the subject entirely. Staff clicking the email link used to get a pre-filled "Hold waiting: [title]" — now they get a blank compose window. 2) item_level_itypes no longer respected Old template: [% UNLESS ( item_level_itypes ) %] ...show item type... [% END %] When item-level_itypes is OFF (meaning it should display the bib level type) and an item's itype differs from the biblio's itemtype, the displayed type will be wrong (It'll always display the item_type_id from _strings. I think _strings should also return the string equivalent of effective_item_type_id. 3) The total count of holds is no longer displayed on each respective tab 4) The patrons' cardnumber used to be displayed on the 'Patron' column. It appears that is no longer the case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42643 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #10 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 199392 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199392&action=edit Bug 42444: (follow-up) Fix QA regressions in waiting holds page Addresses four regressions reported during QA: 1. Restore mailto subject line 'Hold waiting: [title]' that was dropped in the conversion. Also fixes the encodeURIComponent issue (only encode the subject, not the email address). 2. Respect item-level_itypes syspref: only show item type in the title column when the syspref is OFF (matching old behavior). Uses effective_item_type_id from the API response. 3. Restore total count of holds on each tab. Uses drawCallback to update tab labels with recordsTotal from the API response. 4. Add cardnumber to patron column display, matching the old patron-title.inc output format: 'Surname, Firstname (card)'. Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #11 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- All tabs show '35' total for me. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #12 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Pedro Amorim (ammopt) from comment #11)
All tabs show '35' total for me.
<.< -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199392|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #13 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 199674 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199674&action=edit Bug 42444: (follow-up) Fix QA regressions in waiting holds page Addresses four regressions reported during QA: 1. Restore mailto subject line 'Hold waiting: [title]' that was dropped in the conversion. Also fixes the encodeURIComponent issue (only encode the subject, not the email address). 2. Respect item-level_itypes syspref: only show item type in the title column when the syspref is OFF (matching old behavior). Uses effective_item_type_id from the API response. 3. Restore total count of holds on each tab. Uses drawCallback to update tab labels with recordsTotal from the API response. 4. Add cardnumber to patron column display, matching the old patron-title.inc output format: 'Surname, Firstname (card)'. Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #14 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Pedro Amorim (ammopt) from comment #11)
All tabs show '35' total for me.
Solved, I had picked the wrong variable i.e. recordsTotal vs. recordsDisplay -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199199|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199200|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199674|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #15 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 199675 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199675&action=edit Bug 42444: Sample waiting holds injection script Adds t/lib/sample_waiting_holds.pl which creates 35 waiting holds covering all display scenarios: - 28 current waiting holds (pagination test) - 7 expired waiting holds - 3 holds with cancellation requests - Holds with desk assigned - Items with different home/holding branch (transfer on cancel) - Items with shelving location, call number, copy number, enumchron - Patrons with varied primary_contact_method values - Patrons with email and phone numbers Usage: $ ktd --shell k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #16 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 199676 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199676&action=edit Bug 42444: Add missing embeds for waiting holds page The waiting holds page (waitingreserves.pl) needs data that is not currently exposed through the holds API embeds. This patch adds: - desk: the desk object (name) for holds assigned to a desk - item+strings: item with string representations (library names, location descriptions, item type labels) - cancellation_requests: the actual cancellation request objects with creation_date (the existing cancellation_requested embed only returns a boolean) - patron.notice_email_address: the computed email address used for notices (respects EmailFieldPrimary syspref). Also added as a direct embed on GET /patrons and GET /patrons/{patron_id}. All underlying relationships and methods already exist in Koha::Hold, Koha::Patron, and the DBIC schema. This patch only adds them to the OpenAPI specification enum lists. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! 3. Verify the new embeds work: GET /api/v1/holds?status=W x-koha-embed: desk,item+strings,cancellation_requests,patron,patron.notice_email_address => SUCCESS: Response includes desk, item with _strings, cancellation_requests array, and patron with notice_email_address field 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #17 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 199677 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199677&action=edit Bug 42444: Convert waiting holds page to API-driven The waiting holds page (circ/waitingreserves.pl) loaded all waiting holds at once server-side, which is slow for libraries with many waiting holds. This patch converts it to use the REST API with DataTables for paginated, client-side rendering. Changes: - circ/waitingreserves.pl: stripped down to auth + POST actions (cancel single, cancel bulk, cancel all expired). Data loading removed entirely. - waitingreserves.tt: replaced server-rendered FOREACH loops with three kohaTable instances calling /api/v1/holds with appropriate JSON query filters: * Holds waiting: status=W, expiration_date >= today * Holds over: status=W, expiration_date < today * Cancellation requests: status=W, has cancellation_requests - Embeds used: patron, patron.category, patron.notice_email_address, biblio, item+strings, item.holding_library, item.home_library, desk, cancellation_requests (last tab only) - Library columns sort by name via embedded relationships - Removes waiting_holds.inc (no longer used anywhere) Note: Shelving location sorting is intentionally disabled. The location value is an authorised value code resolved to a description via item+strings. Server-side sorting by AV description would require embedding the authorised_values table, which is not currently supported by the framework. Test plan: 1. Apply patches (including the [DO NOT PUSH] sample data commit) 2. Populate sample data: $ ktd --shell k$ yarn build ; koha-plack --restart kohadev k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl => SUCCESS: Creates 35 waiting holds covering all scenarios 3. Navigate to Circulation > Holds awaiting pickup 4. Verify 'Holds waiting' tab: => SUCCESS: Shows ~28 current holds with pagination => Columns: waiting date, hold date, expiration date, title (with barcode and item type), patron info, libraries, location, call number, copy number, enumeration => Some holds show desk name next to current library => Items with different home/holding branch show 'Cancel hold and return to: <library>' 5. Verify 'Holds waiting past their expiration date' tab: => SUCCESS: Shows 7 expired holds => 'Cancel all' button present and functional 6. Verify 'Holds with cancellation requests' tab: => SUCCESS: Shows 3 holds with cancellation request date column 7. Verify patron column: => Name links to patron detail page => Phone number displayed => Email displayed (uses patron.notice_email_address embed, respects EmailFieldPrimary syspref) => Main contact method label displayed (Primary phone, Primary email, Secondary phone, etc.) 8. Verify sorting works on all sortable columns (server-side via API) 9. Test cancel single hold (form POST, check confirmation message) 10. Test bulk cancel (select multiple via checkboxes, confirm in modal, verify background job enqueued) 11. Test 'Cancel all' on expired holds tab 12. Verify 'View all libraries' link works (allbranches=1) 13. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #18 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Created attachment 199678 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199678&action=edit Bug 42444: (follow-up) Fix QA regressions in waiting holds page Addresses four regressions reported during QA: 1. Restore mailto subject line 'Hold waiting: [title]' that was dropped in the conversion. Also fixes the encodeURIComponent issue (only encode the subject, not the email address). 2. Respect item-level_itypes syspref: only show item type in the title column when the syspref is OFF (matching old behavior). Uses effective_item_type_id from the API response. 3. Restore total count of holds on each tab. Uses drawCallback to update tab labels with recordsTotal from the API response. 4. Add cardnumber to patron column display, matching the old patron-title.inc output format: 'Surname, Firstname (card)'. Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199675|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #19 from Jonathan Druart <jonathan.druart@gmail.com> ---
Bug 42444: Add missing embeds for waiting holds page
Don't we require tests for this kind of changes? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #20 from Jonathan Druart <jonathan.druart@gmail.com> --- 1. Not blocker but I would have expected the tab content to be loaded on demand. 2. "Cancel all" cancels everything, without confirmation Also note that "Cancel hold" (in the "Actions" column) does not trigger a confirmation, but "Cancel selected" does (asking for a reason) 3. We usually use escape_str instead of escapeHtml, because it takes care of null values. return (data || "").escapeHtml(); Note that here you also remove "0", when escape_str deals with it correctly. Also note that there are variables not escaped in the last column ("Actions") 4. Instead of: ``` let cols = [{ stuff }]; if (condition) { cols.push({other_stuff}); } cols.push({yet_another_stuff}); ``` I would suggest: let cols = [ {stuff}, ...(condition ? [{other_stuff}] : []} {yet_anot_erstuff}, ]; Of course not blocker, but I have used it extensively in the different patches still in the queue (42278, 42332, etc.) 5. data: "patron.surname", Then search on firstname does not work 6. Search on library names in the global search does not work. (search for coded_values and filters_options in includes/html_helpers/tables/items/catalogue_detail.inc or includes/patron-search.inc for examples). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #21 from Jonathan Druart <jonathan.druart@gmail.com> --- Note that bug 42278 is PQA and will add conflict with this change. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|pedro.amorim@openfifth.co.u |jonathan.druart@gmail.com |k | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #22 from Jonathan Druart <jonathan.druart@gmail.com> ---
[DO NOT PUSH] Bug 42444: Sample waiting holds injection script
Please have a look at https://gitlab.com/joubu/koha-plugin-jump/-/merge_requests/10 I have tried to migrate your need to the Koha Jump plugin, I introduced the concept of "modifiers" (under square brackets): $ kj 'build 20 holds' $ kj 'build 20 holds [expired]' $ kj 'build 20 holds [with-cancellation-request]' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |ASSIGNED --- Comment #23 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #20)
1. Not blocker but I would have expected the tab content to be loaded on demand.
I prefer to load them while staff is looking at the initial tab. But I noticed the way I tied the tab title (which includes totals) to the API response produces a flicker. I will fix it by preloading the totals from the pl controller.
2. "Cancel all" cancels everything, without confirmation Also note that "Cancel hold" (in the "Actions" column) does not trigger a confirmation, but "Cancel selected" does (asking for a reason)
That's the original behavior! I can add it a confirmation modal with the reason dialog!
3. We usually use escape_str instead of escapeHtml, because it takes care of null values. return (data || "").escapeHtml();
Note that here you also remove "0", when escape_str deals with it correctly.
100% agreed.
Also note that there are variables not escaped in the last column ("Actions")
4. Instead of: ``` let cols = [{ stuff }]; if (condition) { cols.push({other_stuff}); } cols.push({yet_another_stuff}); ``` I would suggest: let cols = [ {stuff}, ...(condition ? [{other_stuff}] : []} {yet_anot_erstuff}, ];
Of course not blocker, but I have used it extensively in the different patches still in the queue (42278, 42332, etc.)
Will do my best to rewrite that. I like the spread operator.
5. data: "patron.surname", Then search on firstname does not work
Oops, my bad.
6. Search on library names in the global search does not work. (search for coded_values and filters_options in includes/html_helpers/tables/items/catalogue_detail.inc or includes/patron-search.inc for examples).
Right. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #24 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #19)
Bug 42444: Add missing embeds for waiting holds page
Don't we require tests for this kind of changes?
Our coverage on 'embeds' is really sparse. I will add them this time, but we should discuss if we're gonna hard require that and have it documented somewhere if not already. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199676|0 |1 is obsolete| | Attachment #199677|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #25 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 200936 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200936&action=edit Bug 42444: Sample waiting holds injection script Adds t/lib/sample_waiting_holds.pl which creates 35 waiting holds covering all display scenarios: - 28 current waiting holds (pagination test) - 7 expired waiting holds - 3 holds with cancellation requests - Holds with desk assigned - Items with different home/holding branch (transfer on cancel) - Items with shelving location, call number, copy number, enumchron - Patrons with varied primary_contact_method values - Patrons with email and phone numbers Usage: $ ktd --shell k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl Assisted-by: Sonnet 4.6 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #26 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 200937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200937&action=edit Bug 42444: Add missing embeds for waiting holds page The waiting holds page (waitingreserves.pl) needs data that is not currently exposed through the holds API embeds. This patch adds: - desk: the desk object (name) for holds assigned to a desk - item+strings: item with string representations (library names, location descriptions, item type labels) - cancellation_requests: the actual cancellation request objects with creation_date (the existing cancellation_requested embed only returns a boolean) - patron.notice_email_address: the computed email address used for notices (respects EmailFieldPrimary syspref). Also added as a direct embed on GET /patrons and GET /patrons/{patron_id}. All underlying relationships and methods already exist in Koha::Hold, Koha::Patron, and the DBIC schema. This patch only adds them to the OpenAPI specification enum lists. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! 3. Verify the new embeds work: GET /api/v1/holds?status=W x-koha-embed: desk,item+strings,cancellation_requests,patron,patron.notice_email_address => SUCCESS: Response includes desk, item with _strings, cancellation_requests array, and patron with notice_email_address field 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #27 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 200938 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200938&action=edit Bug 42444: Convert waiting holds page to API-driven The waiting holds page (circ/waitingreserves.pl) loaded all waiting holds at once server-side, which is slow for libraries with many waiting holds. This patch converts it to use the REST API with DataTables for paginated, client-side rendering. Changes: - circ/waitingreserves.pl: stripped down to auth + POST actions (cancel single, cancel bulk, cancel all expired). Data loading removed entirely. - waitingreserves.tt: replaced server-rendered FOREACH loops with three kohaTable instances calling /api/v1/holds with appropriate JSON query filters: * Holds waiting: status=W, expiration_date >= today * Holds over: status=W, expiration_date < today * Cancellation requests: status=W, has cancellation_requests - Embeds used: patron, patron.category, patron.notice_email_address, biblio, item+strings, item.holding_library, item.home_library, desk, cancellation_requests (last tab only) - Library columns sort by name via embedded relationships - Removes waiting_holds.inc (no longer used anywhere) Note: Shelving location sorting is intentionally disabled. The location value is an authorised value code resolved to a description via item+strings. Server-side sorting by AV description would require embedding the authorised_values table, which is not currently supported by the framework. Test plan: 1. Apply patches (including the [DO NOT PUSH] sample data commit) 2. Populate sample data: $ ktd --shell k$ yarn build ; koha-plack --restart kohadev k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl => SUCCESS: Creates 35 waiting holds covering all scenarios 3. Navigate to Circulation > Holds awaiting pickup 4. Verify 'Holds waiting' tab: => SUCCESS: Shows ~28 current holds with pagination => Columns: waiting date, hold date, expiration date, title (with barcode and item type), patron info, libraries, location, call number, copy number, enumeration => Some holds show desk name next to current library => Items with different home/holding branch show 'Cancel hold and return to: <library>' 5. Verify 'Holds waiting past their expiration date' tab: => SUCCESS: Shows 7 expired holds => 'Cancel all' button present and functional 6. Verify 'Holds with cancellation requests' tab: => SUCCESS: Shows 3 holds with cancellation request date column 7. Verify patron column: => Name links to patron detail page => Phone number displayed => Email displayed (uses patron.notice_email_address embed, respects EmailFieldPrimary syspref) => Main contact method label displayed (Primary phone, Primary email, Secondary phone, etc.) 8. Verify sorting works on all sortable columns (server-side via API) 9. Test cancel single hold (form POST, check confirmation message) 10. Test bulk cancel (select multiple via checkboxes, confirm in modal, verify background job enqueued) 11. Test 'Cancel all' on expired holds tab 12. Verify 'View all libraries' link works (allbranches=1) 13. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #28 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 200939 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200939&action=edit Bug 42444: (follow-up) Add confirmation modal to 'Cancel all' The 'Cancel all' button previously submitted without any confirmation. This patch wires it through the existing cancellation modal so the user must confirm and can optionally provide a cancellation reason. The cancellation reason is passed through to ModReserveCancelAll which already supports it as its third parameter. Test plan: 1. Apply patch 2. Navigate to Circulation > Holds awaiting pickup > expired tab 3. Click 'Cancel all' => SUCCESS: Modal appears with reason dropdown 4. Select a reason and confirm => SUCCESS: All expired holds cancelled with reason recorded 5. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199198|0 |1 is obsolete| | Attachment #199678|0 |1 is obsolete| | Attachment #200936|0 |1 is obsolete| | Attachment #200937|0 |1 is obsolete| | Attachment #200938|0 |1 is obsolete| | Attachment #200939|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #29 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 200940 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200940&action=edit [DO NOT PUSH] Bug 42444: Sample waiting holds injection script Adds t/lib/sample_waiting_holds.pl which creates 35 waiting holds covering all display scenarios: - 28 current waiting holds (pagination test) - 7 expired waiting holds - 3 holds with cancellation requests - Holds with desk assigned - Items with different home/holding branch (transfer on cancel) - Items with shelving location, call number, copy number, enumchron - Patrons with varied primary_contact_method values - Patrons with email and phone numbers Usage: $ ktd --shell k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl Assisted-by: Sonnet 4.6 (Anthropic) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #30 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 200941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200941&action=edit Bug 42444: Add missing embeds for waiting holds page The waiting holds page (waitingreserves.pl) needs data that is not currently exposed through the holds API embeds. This patch adds: - desk: the desk object (name) for holds assigned to a desk - item+strings: item with string representations (library names, location descriptions, item type labels) - cancellation_requests: the actual cancellation request objects with creation_date (the existing cancellation_requested embed only returns a boolean) - patron.notice_email_address: the computed email address used for notices (respects EmailFieldPrimary syspref). Also added as a direct embed on GET /patrons and GET /patrons/{patron_id}. All underlying relationships and methods already exist in Koha::Hold, Koha::Patron, and the DBIC schema. This patch only adds them to the OpenAPI specification enum lists. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! 3. Verify the new embeds work: GET /api/v1/holds?status=W x-koha-embed: desk,item+strings,cancellation_requests,patron,patron.notice_email_address => SUCCESS: Response includes desk, item with _strings, cancellation_requests array, and patron with notice_email_address field 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #31 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 200942 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200942&action=edit Bug 42444: Convert waiting holds page to API-driven The waiting holds page (circ/waitingreserves.pl) loaded all waiting holds at once server-side, which is slow for libraries with many waiting holds. This patch converts it to use the REST API with DataTables for paginated, client-side rendering. Changes: - circ/waitingreserves.pl: stripped down to auth + POST actions (cancel single, cancel bulk, cancel all expired). Data loading removed entirely. - waitingreserves.tt: replaced server-rendered FOREACH loops with three kohaTable instances calling /api/v1/holds with appropriate JSON query filters: * Holds waiting: status=W, expiration_date >= today * Holds over: status=W, expiration_date < today * Cancellation requests: status=W, has cancellation_requests - Embeds used: patron, patron.category, patron.notice_email_address, biblio, item+strings, item.holding_library, item.home_library, desk, cancellation_requests (last tab only) - Library columns sort by name via embedded relationships - Removes waiting_holds.inc (no longer used anywhere) Note: Shelving location sorting is intentionally disabled. The location value is an authorised value code resolved to a description via item+strings. Server-side sorting by AV description would require embedding the authorised_values table, which is not currently supported by the framework. Test plan: 1. Apply patches (including the [DO NOT PUSH] sample data commit) 2. Populate sample data: $ ktd --shell k$ yarn build ; koha-plack --restart kohadev k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl => SUCCESS: Creates 35 waiting holds covering all scenarios 3. Navigate to Circulation > Holds awaiting pickup 4. Verify 'Holds waiting' tab: => SUCCESS: Shows ~28 current holds with pagination => Columns: waiting date, hold date, expiration date, title (with barcode and item type), patron info, libraries, location, call number, copy number, enumeration => Some holds show desk name next to current library => Items with different home/holding branch show 'Cancel hold and return to: <library>' 5. Verify 'Holds waiting past their expiration date' tab: => SUCCESS: Shows 7 expired holds => 'Cancel all' button present and functional 6. Verify 'Holds with cancellation requests' tab: => SUCCESS: Shows 3 holds with cancellation request date column 7. Verify patron column: => Name links to patron detail page => Phone number displayed => Email displayed (uses patron.notice_email_address embed, respects EmailFieldPrimary syspref) => Main contact method label displayed (Primary phone, Primary email, Secondary phone, etc.) 8. Verify sorting works on all sortable columns (server-side via API) 9. Test cancel single hold (form POST, check confirmation message) 10. Test bulk cancel (select multiple via checkboxes, confirm in modal, verify background job enqueued) 11. Test 'Cancel all' on expired holds tab 12. Verify 'View all libraries' link works (allbranches=1) 13. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #32 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 200943 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200943&action=edit Bug 42444: (follow-up) Add confirmation modal to 'Cancel all' The 'Cancel all' button previously submitted without any confirmation. This patch wires it through the existing cancellation modal so the user must confirm and can optionally provide a cancellation reason. The cancellation reason is passed through to ModReserveCancelAll which already supports it as its third parameter. Test plan: 1. Apply patch 2. Navigate to Circulation > Holds awaiting pickup > expired tab 3. Click 'Cancel all' => SUCCESS: Modal appears with reason dropdown 4. Select a reason and confirm => SUCCESS: All expired holds cancelled with reason recorded 5. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #33 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- I squashed things a bit. I think I covered all. I'll explore the jump plugin, sounds like it will be very helpful. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #34 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- *** Bug 41782 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Circulation| |Holds function| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43017 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43017 [Bug 43017] [OMNIBUS] Interface optimization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|42643 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Laura O'Neil <laura@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |laura@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m QA Contact|jonathan.druart@gmail.com |matt.blenkinsop@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|matt.blenkinsop@openfifth.c |paul.derscheid@lmscloud.de |o.uk | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200940|0 |1 is obsolete| | Attachment #200941|0 |1 is obsolete| | Attachment #200942|0 |1 is obsolete| | Attachment #200943|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #35 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206709 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206709&action=edit [DO NOT PUSH] Bug 42444: Sample waiting holds injection script Adds t/lib/sample_waiting_holds.pl which creates 35 waiting holds covering all display scenarios: - 28 current waiting holds (pagination test) - 7 expired waiting holds - 3 holds with cancellation requests - Holds with desk assigned - Items with different home/holding branch (transfer on cancel) - Items with shelving location, call number, copy number, enumchron - Patrons with varied primary_contact_method values - Patrons with email and phone numbers Usage: $ ktd --shell k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #36 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206710 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206710&action=edit Bug 42444: Add missing embeds for waiting holds page The waiting holds page (waitingreserves.pl) needs data that is not currently exposed through the holds API embeds. This patch adds: - desk: the desk object (name) for holds assigned to a desk - item+strings: item with string representations (library names, location descriptions, item type labels) - cancellation_requests: the actual cancellation request objects with creation_date (the existing cancellation_requested embed only returns a boolean) - patron.notice_email_address: the computed email address used for notices (respects EmailFieldPrimary syspref). Also added as a direct embed on GET /patrons and GET /patrons/{patron_id}. All underlying relationships and methods already exist in Koha::Hold, Koha::Patron, and the DBIC schema. This patch only adds them to the OpenAPI specification enum lists. Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove xt/api.t t/db_dependent/api/v1/holds.t => SUCCESS: Tests pass! 3. Verify the new embeds work: GET /api/v1/holds?status=W x-koha-embed: desk,item+strings,cancellation_requests,patron,patron.notice_email_address => SUCCESS: Response includes desk, item with _strings, cancellation_requests array, and patron with notice_email_address field 4. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #37 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206711 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206711&action=edit Bug 42444: Convert waiting holds page to API-driven The waiting holds page (circ/waitingreserves.pl) loaded all waiting holds at once server-side, which is slow for libraries with many waiting holds. This patch converts it to use the REST API with DataTables for paginated, client-side rendering. Changes: - circ/waitingreserves.pl: stripped down to auth + POST actions (cancel single, cancel bulk, cancel all expired). Data loading removed entirely. - waitingreserves.tt: replaced server-rendered FOREACH loops with three kohaTable instances calling /api/v1/holds with appropriate JSON query filters: * Holds waiting: status=W, expiration_date >= today * Holds over: status=W, expiration_date < today * Cancellation requests: status=W, has cancellation_requests - Embeds used: patron, patron.category, patron.notice_email_address, biblio, item+strings, item.holding_library, item.home_library, desk, cancellation_requests (last tab only) - Library columns sort by name via embedded relationships - Removes waiting_holds.inc (no longer used anywhere) Note: Shelving location sorting is intentionally disabled. The location value is an authorised value code resolved to a description via item+strings. Server-side sorting by AV description would require embedding the authorised_values table, which is not currently supported by the framework. Test plan: 1. Apply patches (including the [DO NOT PUSH] sample data commit) 2. Populate sample data: $ ktd --shell k$ yarn build ; koha-plack --restart kohadev k$ cd /kohadevbox/koha && perl t/lib/sample_waiting_holds.pl => SUCCESS: Creates 35 waiting holds covering all scenarios 3. Navigate to Circulation > Holds awaiting pickup 4. Verify 'Holds waiting' tab: => SUCCESS: Shows ~28 current holds with pagination => Columns: waiting date, hold date, expiration date, title (with barcode and item type), patron info, libraries, location, call number, copy number, enumeration => Some holds show desk name next to current library => Items with different home/holding branch show 'Cancel hold and return to: <library>' 5. Verify 'Holds waiting past their expiration date' tab: => SUCCESS: Shows 7 expired holds => 'Cancel all' button present and functional 6. Verify 'Holds with cancellation requests' tab: => SUCCESS: Shows 3 holds with cancellation request date column 7. Verify patron column: => Name links to patron detail page => Phone number displayed => Email displayed (uses patron.notice_email_address embed, respects EmailFieldPrimary syspref) => Main contact method label displayed (Primary phone, Primary email, Secondary phone, etc.) 8. Verify sorting works on all sortable columns (server-side via API) 9. Test cancel single hold (form POST, check confirmation message) 10. Test bulk cancel (select multiple via checkboxes, confirm in modal, verify background job enqueued) 11. Test 'Cancel all' on expired holds tab 12. Verify 'View all libraries' link works (allbranches=1) 13. Sign off :-D Assisted-by: Sonnet 4.6 (Anthropic) Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #38 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206712 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206712&action=edit Bug 42444: (follow-up) Add confirmation modal to 'Cancel all' The 'Cancel all' button previously submitted without any confirmation. This patch wires it through the existing cancellation modal so the user must confirm and can optionally provide a cancellation reason. The cancellation reason is passed through to ModReserveCancelAll which already supports it as its third parameter. Test plan: 1. Apply patch 2. Navigate to Circulation > Holds awaiting pickup > expired tab 3. Click 'Cancel all' => SUCCESS: Modal appears with reason dropdown 4. Select a reason and confirm => SUCCESS: All expired holds cancelled with reason recorded 5. Sign off :-D Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #39 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206713 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206713&action=edit Bug 42444: (QA follow-up) Add tests for the new embeds - holds: desk, cancellation_requests, item+strings, item.home_library, item.holding_library, patron.category, patron.notice_email_address - patrons: notice_email_address on GET /patrons and /patrons/{patron_id} Test plan: 1. yarn api:bundle 2. prove t/db_dependent/api/v1/holds.t t/db_dependent/api/v1/patrons.t Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #40 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206714 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206714&action=edit Bug 42444: (QA follow-up) Submit single cancel through form-submit.js - The cancel form was built as a JS string with a hand-added CSRF token, failing xt/find-missing-csrf.t - Its inline onclick confirmation was blocked when csp_mode is enforced, and a quote in the translated string broke the attribute - Use a .submit-form-link with data-confirmation-msg instead (JS16) - Add escape_attr for values inside attributes; escape_str leaves quotes - Word the modal for the action it confirms (cancel all / selected), without jQuery (JS21) Test plan: 1. prove xt/find-missing-csrf.t 2. Go to Circulation > Holds awaiting pickup 3. Click 'Cancel hold' on a row; a confirmation appears, cancelling it keeps the hold, confirming cancels it 4. Select some holds and click 'Cancel selected'; the modal asks about the selected holds 5. On the expired tab click 'Cancel all'; the modal asks about all expired holds Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #41 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206715 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206715&action=edit Bug 42444: (QA follow-up) Use the server date to split waiting and expired holds - The tables used the browser's UTC date, the tab counts the server date; around local midnight rows and counts disagreed - Pass today from the controller Test plan: 1. Set the OS timezone ahead of UTC (e.g. Europe/Berlin) 2. Load Holds awaiting pickup between 00:00 and 02:00 local time 3. Without this patch holds that expired yesterday are listed as waiting and the rows don't match the tab counts; with it they do Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #42 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206716 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206716&action=edit Bug 42444: (QA follow-up) Pass the tab to the single cancel form - row._tab was set in drawCallback, after the cells were rendered, so the hidden tab input was always empty and the holdsover redirect never fired - Pass the tab to render_holds_columns instead Test plan: 1. Go to Holds awaiting pickup > Holds waiting past their expiration date 2. Cancel a hold that has no other holds queued 3. Without this patch you land on the default tab; with it on ?tab=holdsover Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #43 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206717 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206717&action=edit Bug 42444: (QA follow-up) Escape remaining values in the holds tables - Holding/home library codes in the cancel link's data attributes (fbr/tbr) - Unmapped primary_contact_method fallback in the patron column Test plan: 1. Go to Holds awaiting pickup 2. Cancel forms and contact method labels render as before Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #44 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206718 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206718&action=edit Bug 42444: (QA follow-up) Show item type description in the title column - Map effective_item_type_id to its translated description, as the old template did with ItemTypes.GetDescription Test plan: 1. Set item-level_itypes to 'biblio record' 2. Go to Holds awaiting pickup 3. Without this patch the title column shows the code (BK); with it the description (Books) Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #45 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206719 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206719&action=edit Bug 42444: (QA follow-up) Isolate TT variables from the holds tables script - Move the template variables into their own data-tt-allowed script tag - Pass item-level_itypes through Koha.addPrefs - Tidy the remaining script (bug 42278 convention) Test plan: 1. Go to Circulation > Holds awaiting pickup, then 'View all libraries' 2. All three tabs load, counts, sorting and search work as before 3. Toggle item-level_itypes; the item type shows in the title column only when it is set to 'biblio record' Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #46 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206720 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206720&action=edit Bug 42444: (QA follow-up) Render the patron column like patron-title.inc - Use $patron_to_html for the name, cardnumber and link, so preferred_name, middle_name and other_name are shown again - Include preferred_name in the column search - Separate the contact method label from the email with a space, as the old template did Test plan: 1. Give a patron with a waiting hold a preferred name that differs from the first name 2. Go to Circulation > Holds awaiting pickup 3. Without this patch the patron column shows the first name; with it the preferred name, as before the conversion to the API 4. Search for the preferred name; the hold is found 5. The 'Main contact method' label is separated from the email Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #47 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 206721 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206721&action=edit Bug 42444: (QA follow-up) Use format() for strings joined with values - Barcode, main contact method and 'Cancel hold and return to' strings were concatenated with their values, so translators could not move the value (JS4) Test plan: 1. Go to Circulation > Holds awaiting pickup 2. Barcode, main contact method and the 'Cancel hold and return to' button render as before Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #48 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Hi Tomás, this is really cool! Had to rebase onto current main, didn't apply, and I deliberately did not set it to PQA since I had too many QA follow-ups and wanted you to have a look and SO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|paul.derscheid@lmscloud.de |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #49 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 206790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206790&action=edit Bug 42444: Allow filter on item's barcode|external_id -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #50 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 206791 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206791&action=edit Bug 42444: Fix sorting on the cancellation request date -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #51 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 206792 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206792&action=edit Bug 42444: Make expiration_date, hold_date and waiting_date searchable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #52 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 206793 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206793&action=edit Bug 42444: Use $biblio_to_html to display the biblio's title Or we display less info than before (medium, part number). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 --- Comment #53 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 206794 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206794&action=edit Bug 42444: Use the embedded home library It's what we use to display the home library in the "Home library" column. Let's be consistent? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #54 from Jonathan Druart <jonathan.druart@gmail.com> --- Added more follow-ups. Remaining work: 1. "Cancel selected" is totally buggy when there is pagination. Same for the "select all" checkbox. 2. Why do you update the tab count when the table is redrawn? I don't understand why we need that. drawCallback: function () { let dt = this.api(); let total = dt.page.info().recordsDisplay; $("#" + tab + "-count").text("(" + total + ")"); 3. 94 use Date::Calc qw( Date_to_Days Today ); Move it to the top 4. But... Isn't there something weird with "cancel all"? Why aren't we using the REST API endpoint /api/v1/holds/cancellation_bulk? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zoho.roboto@bywatersolution | |s.com -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org