https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 --- Comment #9 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 202499 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202499&action=edit Bug 42790: Unify booking actions and display across patron and biblio tables The patron bookings tab (moremember/circulation) and the biblio bookings page previously offered different actions and rendered status, item and action cells with duplicated, subtly different code. This patch introduces a shared rendering helper (js/bookings/common.js) used by both tables, delivering: * A unified action set gated on booking status and the logged in user's permissions: - new: Edit + Cancel (manage_bookings), Checkout (circulate) - issued: no edit/cancel actions (Extend follows in a later patch) - completed/cancelled: no actions * "Transform to checkout" on the biblio bookings page is renamed "Checkout" and the same shortcut is now offered from the patron bookings tab, posting the patron, barcode and booking end date through to the checkout screen * The patron bookings tab gains the Edit action, opening the same place booking modal used elsewhere (the modal markup and assets are now included on moremember and circulation pages) * For issued bookings, the Item column now also shows the checkout due date and a link to the checkout record (via the item.checkout embed, newly allowed on the biblio bookings endpoint) * New bookings whose collection window has opened are highlighted with table-info; new bookings whose window has passed without collection are highlighted with table-warning Both pages now expose their booking permissions through Koha.addPermissions rather than bare globals. Test plan: 1) yarn api:bundle && restart_all 2) Create a booking; confirm the patron bookings tab (patron details and checkout pages) shows Edit, Cancel and Checkout actions, and that the biblio bookings page shows the same 3) Confirm Edit opens the booking modal pre-populated on all pages 4) Click Checkout; the checkout is submitted with the patron, item and the booking end date as due date - confirm you land on the patron's checkout screen with the checkout made (or its confirmation pending, e.g. for an early collection) 5) Check out a booked item; confirm the Item column shows the due date and a link to the checkout on both displays 6) Create bookings with past start/end dates; confirm the row highlights appear on both displays Sponsored-by: OpenFifth <https://openfifth.co.uk/\> Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/\> Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.