[Bug 42443] New: Update transferstoreceive.pl to use the API to fetch transfer information
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Bug ID: 42443 Summary: Update transferstoreceive.pl to use the API to fetch transfer information 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 Transfers to Receive page is a pain point for larger systems with many transfers. We should update it to fetch data via API. -- 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=42443 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. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199854 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199854&action=edit Bug 42443: Add REST API for item transfers Patch from commit 31e07e8 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #2 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199855 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199855&action=edit Bug 42443: Add unit tests Patch from commit fd88d77 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #3 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199856 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199856&action=edit Bug 42443: Convert transfers to receive page to ajax datatable Updates circ/transferstoreceive.pl to use the new REST API with an ajax DataTable to display transfer to receive. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Set an item in transit to your logged in library ( check it in at another branch so it is sent home, or place a hold to trigger a transfer ) 4) Place a hold on a second transferred item, and a recall on a third 5) Browse to /cgi-bin/koha/circ/transferstoreceive.pl 6) Note the "On hold for" column shows the hold patron, the recall patron or "None" 7) Set TransfersMaxDaysWarning low and note the "days late" badge appears 8) Click "Cancel transfer" and note the transfer is cancelled 9) A library with no incoming transfers will get "No transfers to receive" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199857 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199857&action=edit Bug 42443: Add ability to cancel a transfer via the REST API This patch adds a DELETE /transfers/{transfer_id} route that cancels the given transfer by id and reverts an in transit recall for the item the same way as returns.pl does. The cancellation reason is passed in the request body so this api endpoint could be used in other places we can cancel transfers. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@openfifth.c |y.org |o.uk CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Alex Carver [Acerock7] <alex@rcls.org> 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=42443 Alex Carver [Acerock7] <alex@rcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199854|0 |1 is obsolete| | Attachment #199855|0 |1 is obsolete| | Attachment #199856|0 |1 is obsolete| | Attachment #199857|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=42443 --- Comment #5 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 200105 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200105&action=edit Bug 42443: Add REST API for item transfers Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #6 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 200106 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200106&action=edit Bug 42443: Add unit tests Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #7 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 200107 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200107&action=edit Bug 42443: Convert transfers to receive page to ajax datatable Updates circ/transferstoreceive.pl to use the new REST API with an ajax DataTable to display transfer to receive. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Set an item in transit to your logged in library ( check it in at another branch so it is sent home, or place a hold to trigger a transfer ) 4) Place a hold on a second transferred item, and a recall on a third 5) Browse to /cgi-bin/koha/circ/transferstoreceive.pl 6) Note the "On hold for" column shows the hold patron, the recall patron or "None" 7) Set TransfersMaxDaysWarning low and note the "days late" badge appears 8) Click "Cancel transfer" and note the transfer is cancelled 9) A library with no incoming transfers will get "No transfers to receive" Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 --- Comment #8 from Alex Carver [Acerock7] <alex@rcls.org> --- Created attachment 200108 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200108&action=edit Bug 42443: Add ability to cancel a transfer via the REST API This patch adds a DELETE /transfers/{transfer_id} route that cancels the given transfer by id and reverts an in transit recall for the item the same way as returns.pl does. The cancellation reason is passed in the request body so this api endpoint could be used in other places we can cancel transfers. Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Initiative type|--- |Feature -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200105|0 |1 is obsolete| | Attachment #200106|0 |1 is obsolete| | Attachment #200107|0 |1 is obsolete| | Attachment #200108|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=42443 --- Comment #9 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200291&action=edit Bug 42443: Add REST API for item transfers Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #10 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200292 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200292&action=edit Bug 42443: Add unit tests Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #11 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200293 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200293&action=edit Bug 42443: Convert transfers to receive page to ajax datatable Updates circ/transferstoreceive.pl to use the new REST API with an ajax DataTable to display transfer to receive. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Set an item in transit to your logged in library ( check it in at another branch so it is sent home, or place a hold to trigger a transfer ) 4) Place a hold on a second transferred item, and a recall on a third 5) Browse to /cgi-bin/koha/circ/transferstoreceive.pl 6) Note the "On hold for" column shows the hold patron, the recall patron or "None" 7) Set TransfersMaxDaysWarning low and note the "days late" badge appears 8) Click "Cancel transfer" and note the transfer is cancelled 9) A library with no incoming transfers will get "No transfers to receive" Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #12 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200294 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200294&action=edit Bug 42443: Add ability to cancel a transfer via the REST API This patch adds a DELETE /transfers/{transfer_id} route that cancels the given transfer by id and reverts an in transit recall for the item the same way as returns.pl does. The cancellation reason is passed in the request body so this api endpoint could be used in other places we can cancel transfers. Signed-off-by: Alex Carver [Acerock7] <alex@rcls.org> Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #13 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200295 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200295&action=edit Bug 42443: (QA follow-up) Prevent cancelling completed transfers The delete endpoint was passing force => 1 to cancel() with no state guards, allowing already-received and already-cancelled transfers to be re-cancelled, corrupting datearrived/datecancelled audit fields. Add explicit 400 responses for both cases and tests to cover them. Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #14 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200296 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200296&action=edit Bug 42443: (QA follow-up) Add to_library to embed enum Koha::Item::Transfer exposes a to_library() method and the definition already listed to_library as a valid property, but the x-koha-embed enum was missing the entry. Add it so consumers can embed it. Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #15 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200297 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200297&action=edit Bug 42443: (QA follow-up) Guard nullable embed access in JS renderers from_library and home_library can be null if a transfer references an orphaned branch row. Accessing .name on null throws a TypeError and crashes the DataTable renderer; guard both accesses. Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #16 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200298 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200298&action=edit Bug 42443: (QA follow-up) Fix escaping of branchcode in JS context Using | html to embed a TT value inside a JS string literal is incorrect: it produces HTML entities rather than JS-safe characters. Store the branchcode in a data attribute (where | html is correct) and read it from there in JavaScript. Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #17 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200299&action=edit Bug 42443: (QA follow-up) Test UseRecalls integration in transfer cancel The delete() controller reverts any in-transit recall tied to the item when UseRecalls is enabled. Add a subtest to verify the recall status is set back to 'requested' after the transfer is cancelled. Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #18 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200300 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200300&action=edit Bug 42443: (QA follow-up) Test from_library_id query filter The OpenAPI spec documents from_library_id as a supported filter parameter but the test suite only exercised to_library_id. Add a test to verify filtering by source library returns the correct transfer. Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #19 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200301 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200301&action=edit Bug 42443: (QA follow-up) Group transfers by sending library using rowGroup Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #20 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200302 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200302&action=edit Bug 42443: (QA follow-up) Add DBIC relationship aliases on Branchtransfer The REST framework resolves _order_by parameters and embed prefetches by walking prefetch_whitelist, which is built from DBIC relationship names. The auto-generated relationships use the FK column names (itemnumber, frombranch, tobranch), but the API exposes them as item, from_library, and to_library. Sorting by item.biblio.title etc. threw a 500 because those names were not in the whitelist. Adding belongs_to aliases below the DO NOT MODIFY line bridges the API names to the DBIC names, matching the convention used by other Koha schema result classes (e.g. Koha::Schema::Result::Item). Also updates the relation methods in Koha::Item::Transfer to use the new aliases consistently, so the accessor names line up across both layers. Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #21 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 200303 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200303&action=edit Bug 42443: (QA follow-up) Use library selects for Sent from and Home library filters Replace the free-text filter inputs for the "Sent from" and "Home library" columns with select dropdowns populated from the full library list, consistent with other DataTables pages such as the pending bookings page. The "Sent from" column is made visible again (it was previously hidden since rowGroup provides the visual grouping); showing it also allows its filter cell to render. The "On hold for" column intentionally has no filter: it is computed from two different embedded sub-objects (item.first_hold.patron or item.recall.patron) and has no single API field to filter against server-side. Signed-off-by: Martin Renvoize <martin.renvoize@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=42443 --- Comment #22 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- OK.. that grew a bit.. The more I reviewed it the more small, but important, things became apparent to me. Lots of small QA follow-ups to add the requisite polish and restore small functional regressions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42443 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=42443 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.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org