Bug 37065 - Bookings tab should filter out expired bookings by default
Summary: Bookings tab should filter out expired bookings by default
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Martin Renvoize
QA Contact: Julian Maurice
URL:
Keywords:
Depends on: 36428
Blocks:
  Show dependency treegraph
 
Reported: 2024-06-10 18:59 UTC by Nick Clemens (kidclamp)
Modified: 2024-07-05 14:40 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the list of bookings for items so that only current bookings are listed. There is now a link, "Show expired", to display all bookings.
Version(s) released in:
24.11


Attachments
Bug 37065: Filter completed bookings by default (2.71 KB, patch)
2024-06-20 10:42 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 37065: Filter completed bookings by default (2.76 KB, patch)
2024-06-26 23:32 UTC, David Nind
Details | Diff | Splinter Review
Bug 37065: (follow-up) Terminology and active mixup (2.64 KB, patch)
2024-07-03 06:02 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 37065: Filter expired bookings by default (2.79 KB, patch)
2024-07-03 06:45 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2024-06-10 18:59:29 UTC
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.
Comment 1 Martin Renvoize 2024-06-20 10:42:42 UTC
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.
Comment 2 David Nind 2024-06-26 23:32:46 UTC
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>
Comment 3 David Nind 2024-06-27 00:42:18 UTC
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.
Comment 4 Julian Maurice 2024-07-02 14:10:31 UTC
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 ?
Comment 5 Martin Renvoize 2024-07-03 06:02:29 UTC
Created attachment 168419 [details] [review]
Bug 37065: (follow-up) Terminology and active mixup
Comment 6 Martin Renvoize 2024-07-03 06:04:46 UTC
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.
Comment 7 Julian Maurice 2024-07-03 06:45:53 UTC
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>
Comment 8 Julian Maurice 2024-07-03 06:51:11 UTC
I squashed both patches, as Martin suggested. It's ready to be pushed!
Comment 9 Katrin Fischer 2024-07-05 14:39:54 UTC
This was pushed to main for 24.11

Thanks all!