When loading the bookings tab we load all bookings for a biblio, current and completed. We should filter out the completed by default and offer a link to view all unfiltered.
Created attachment 167932 [details] [review] Bug 37065: Filter completed bookings by default This patch adds a default filter for the bookings table on the bookings tab of a biblio. We also add the option to turn off the filtering after initial page load.
Created attachment 168185 [details] [review] Bug 37065: Filter completed bookings by default This patch adds a default filter for the bookings table on the bookings tab of a biblio. We also add the option to turn off the filtering after initial page load. Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. Add two bookings for an item (can only set dates in the future): . Make an item bookable: for a record, go to the items section and change Bookable to Yes for an item. . Place a booking: Place booking action for the record and add booking details 2. Change the dates in the database for one of the bookings to dates in the past: . koha-mysql kohadev . select * from bookings; . update bookings set start_date="2024-06-24 12:00:00" where booking_id=1 . update bookings set end_date="2024-06-25 12:00:00" where booking_id=1 3. Refresh the bookings section for the record. 4. Note that only current bookings are listed (although the old booking is also shown on calendar, but that may be because of the SQL I used to update the bookings). 5. Note that there is also an "Include completed" link above the data table navigation. Selecting this should show the completed bookings. Clicking again should only show the current bookings, and the link changes to "Filter completed" (not sure of the exact words that should be used). 6. If you look at the patron's page, only current bookings are shown.
When I load the booking tab, completed bookings are not shown and the link text is "<bars icon> Include completed" (OK) When I click on the link, completed bookings appear (OK) but the link text changes to "<filter icon> Include completed". txtActivefilter and txtInactivefilter should probably be swapped. Failing QA for that. About the wording, what about Show/Hide instead of Include/Filter ? Also, wouldn't "expired" fit better than "completed" in that case ?
Created attachment 168419 [details] [review] Bug 37065: (follow-up) Terminology and active mixup
Doh.. silly mistake with calling the wrong filtertext on filtered vs unfiltered.. well caught Julian. I've added the fix for this and updated the terminology as suggested (I'll add a bug to update the terminology elsewhere to match as we agreed on 'Show/Hide' in chat yesterday. Feel free to squash the follow-up.. I added it distinct to show the work had been completed, but it's a tiny fix so makes sense to have it squashed unless you disagree.
Created attachment 168421 [details] [review] Bug 37065: Filter expired bookings by default This patch adds a default filter for the bookings table on the bookings tab of a biblio. We also add the option to turn off the filtering after initial page load. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
I squashed both patches, as Martin suggested. It's ready to be pushed!
This was pushed to main for 24.11 Thanks all!
Backported to 24.05.x for upcoming 24.05.06