[Bug 42790] New: Bookings tab: action improvements
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 Bug ID: 42790 Summary: Bookings tab: action improvements 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: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com This patchset improves the patron and biblio bookings tabs by unifying the available actions across both displays, syncing due dates with booking end dates at issue time, and introducing a booking-aware Extend action for issued bookings. Depends on: Bug 41898 (Booking status lifecycle: rename and extend) === 2.1 Unified action set across Patron and Biblio bookings displays === Both the Patron bookings tab and the Biblio bookings page show the same actions, gated on booking status and the logged-in user's permissions: Status | Edit | Cancel | Checkout | Extend new | manage_bookings | manage_bookings | circulate | â issued | â | â | â | circulate completed | â | â | â | â cancelled | â | â | â | â The Patron bookings tab currently shows only Cancel; it gains Edit and Checkout. The Biblio bookings page currently shows Edit, Cancel, and "Transform to checkout"; "Transform to checkout" is renamed Checkout and shortcuts to the checkout screen pre-populated with the patron and item. === 2.2 Due date sync at AddIssue === When a booked item is checked out, AddIssue uses booking.end_date as the default due date. If staff override the due date at checkout time, the override is synced back to booking.end_date server-side, keeping the booking and the checkout in sync from the moment of issue. === 2.3 Booking-aware extension for issued bookings === An Extend button appears in the Actions column for issued bookings. It opens a modal containing: - The current booking end_date - The current checkout date_due from the embedded issue record - A date picker that visually blocks dates where another new or issued booking exists for the same item - A Confirm button On confirm, a single API call handles all updates server-side: 1. Validates the new date against the maximum booking period 2. Checks for conflicting bookings for the same item 3. Updates date_due on the linked checkout 4. Updates end_date on the booking The Extend button is only visible to users with circulate permission. === 2.4 Checkout link and due date display for issued bookings === For rows with status = issued, the Item column additionally shows the checkout due date and a link to the checkout record. Staff can see at a glance when the loan is due back and navigate to it without leaving the bookings tab. === 2.5 Visual row indicators for uncollected past-window bookings === new bookings where start_date < today receive a table-info row class to highlight that the booking is awaiting collection. new bookings where end_date < today receive a table-warning row class to highlight that the collection window has passed. === Test plan === 1. Apply Bug 41898 patches first. 2. Create a booking for a patron on a specific item. 3. Confirm the Patron bookings tab shows Edit, Cancel, and Checkout actions for the new booking; Biblio bookings page shows the same. 4. Click Checkout â confirm it pre-populates the checkout screen with the patron and item; confirm the due date defaults to the booking end_date. 5. Override the due date at checkout; confirm booking.end_date is updated to match. 6. Confirm the issued booking shows the due date and a checkout link in the Item column on both tabs. 7. Click Extend on the issued booking; select a new date; confirm both date_due and booking.end_date are updated. 8. Create a subsequent booking for the same item and confirm its start_date is blocked in the Extend date picker. 9. Advance the clock past a new booking's start_date; confirm the row receives the table-info highlight. 10. Advance past end_date; confirm the row receives the table-warning highlight. -- 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=42790 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41898 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41898 [Bug 41898] Expired bookings do not display when expired filter is used in patron record -- 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=42790 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- 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=42790 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Circulation| |Bookings function| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hdunne-howrie@westminster.g | |ov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Bookings tab: action |Clarify and unify bookings |improvements |actions to 'Edit, Cancel, | |Checkout, Extend' shown | |appropriate per status and | |permission -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|41898 |42998 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41898 [Bug 41898] Expired bookings do not display when expired filter is used in patron record https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42998 [Bug 42998] Allow a requested due date when renewing a checkout via the REST API -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Scope note: this proposal has been split. - Bug 42997 now carries the booking/checkout due date synchronisation and renewal handling (AddIssue/AddRenewal end date sync, the BOOKED_DUE_DATE_CLASH checkout warning, honouring explicit due date overrides, and preventing renewals running into the next booking). - Bug 42998 now carries the REST API change allowing a requested due_date on the checkout renewal endpoints. This bug retains the UI work: the unified action set (Edit, Cancel, Checkout, Extend) across the patron and biblio bookings tables, the checkout link and due date display for issued bookings, the uncollected booking row highlights, and the Extend modal (which drives bug 42998's renewal endpoint). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff 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=42790 --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 201556 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201556&action=edit Bug 42790: Add missing Scalar::Util import in Koha::REST::V1::Bookings The error handling in add() already calls blessed() but the module never imported it, so hitting the Koha::Exceptions::Booking::Clash catch branch died with an undefined subroutine error (masked as a 500 either way, but for the wrong reason). Test plan: 1) prove t/db_dependent/api/v1/bookings.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 --- Comment #3 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 201557 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201557&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 and confirm the checkout screen is pre-populated with the patron and item, and the due date defaults to the booking end date 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42790 --- Comment #4 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 201558 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201558&action=edit Bug 42790: Add booking-aware Extend action for issued bookings This patch adds an Extend action to the bookings tables for issued bookings, visible to users with the circulate permission on both the patron bookings tab and the biblio bookings page. The button opens a new modal showing the current booking end date and the current checkout due date, with a flatpickr date picker that: * blocks the date ranges of any other new or issued booking for the same item * caps the maximum selectable date at the day before the earliest subsequent booking starts On confirm, the extension is performed as a staff authorised renewal of the linked checkout - a single call to POST /api/v1/checkouts/{checkout_id}/renewal with the requested due_date and the renewal_limit override. The server validates the date against bookings for the item and keeps booking.end_date in sync with the renewed due date. Errors (clash with the next booking, renewal limits with overrides disabled) are displayed inside the modal without closing it, so staff can pick an earlier date. The Extend button only renders when the booking has a linked checkout to renew. Test plan: 1) Create a booking, check the item out to the patron (booking becomes issued) and confirm the Extend button appears on both the patron bookings tab and the biblio bookings page 2) Click Extend; confirm the modal shows the current end date and the checkout due date 3) Create a subsequent booking for the same item; re-open the modal and confirm its dates are blocked in the picker and dates beyond its start cannot be selected 4) Select a valid new date and confirm; verify both the booking end_date and the checkout due date are updated 5) Confirm the checkout now shows a renewal in its renewal history -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org