https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42444
--- Comment #3 from Tomás Cohen Arazi (tcohen) <[email protected]> --- 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. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
