Bug 37141 - Add option to display completed bookings from patron page
Summary: Add option to display completed bookings from patron page
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on: 37047
Blocks: 37574
  Show dependency treegraph
 
Reported: 2024-06-20 10:53 UTC by Martin Renvoize (ashimema)
Modified: 2024-11-15 17:42 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement to bookings now shows completed bookings for patrons on their check out and details page. There is now a filter to show expired and hide expired bookings (similar to what is shown on a record's bookings page.)
Version(s) released in:
24.11.00
Circulation function: bookings


Attachments
Bug 37141: Add 'Include completed' option to bookings tab (3.44 KB, patch)
2024-06-20 11:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37141: Add 'Show completed' option to bookings tab (3.38 KB, patch)
2024-07-03 06:35 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37141: Add 'Show completed' option to bookings tab (3.43 KB, patch)
2024-08-05 11:05 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37141: (follow-up) Move filter_expired to outer scope (1.08 KB, patch)
2024-08-05 13:46 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table (2.78 KB, patch)
2024-08-05 13:46 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37141: Add 'Show completed' option to bookings tab (3.48 KB, patch)
2024-08-06 08:19 UTC, David Nind
Details | Diff | Splinter Review
Bug 37141: (follow-up) Move filter_expired to outer scope (1.13 KB, patch)
2024-08-06 08:19 UTC, David Nind
Details | Diff | Splinter Review
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table (2.82 KB, patch)
2024-08-06 08:19 UTC, David Nind
Details | Diff | Splinter Review
Bug 37141: Add 'Show completed' option to bookings tab (3.54 KB, patch)
2024-08-06 11:43 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37141: (follow-up) Move filter_expired to outer scope (1.18 KB, patch)
2024-08-06 11:43 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table (2.88 KB, patch)
2024-08-06 11:43 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 37141: Tidy JS (2.57 KB, patch)
2024-08-06 11:43 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2024-06-20 10:53:30 UTC
Currently on the bookings tab of the patron pages, we always filter to active bookings.

We should add the option to display completed bookings too; This would match the functionality introduced in the biblio details view for bookings in bug 37065
Comment 1 Martin Renvoize (ashimema) 2024-06-20 11:15:14 UTC
Created attachment 167934 [details] [review]
Bug 37141: Add 'Include completed' option to bookings tab

This patch adds the 'Include completed' filter toggle option to the
bookings display tab on both the patron details and circulation pages.
Comment 2 Martin Renvoize (ashimema) 2024-07-03 06:35:50 UTC
Created attachment 168420 [details] [review]
Bug 37141: Add 'Show completed' option to bookings tab

This patch adds the 'Show completed' filter toggle option to the
bookings display tab on both the patron details and circulation pages.
Comment 3 Kristi 2024-07-25 15:23:17 UTC
Is there a test plan for this one?
Comment 4 Paul Derscheid 2024-08-05 11:03:22 UTC
I tested like this:
1) Create a booking for any item.
2) Open a db shell with `koha-mysql <INSTANCE>`
3) Update the created booking with:
`
update bookings set start_date = '<date in the past>', end_date = '<date also in the past'> where booking_id = '<booking id of the booking you just created>'.
`
4) Go the the bookings tab of said item.
5) Notice that a 'Show expired' link/button appears on the top left of the table. Also note that the booking you created isn't displayed because it's in the past.
6) Click the 'Show expired' button.
7) Notice that the expired booking is now shown.
8) Sign off.
Comment 5 Paul Derscheid 2024-08-05 11:03:52 UTC
PS: after you applied the patch :)
Comment 6 Paul Derscheid 2024-08-05 11:05:36 UTC
Created attachment 170057 [details] [review]
Bug 37141: Add 'Show completed' option to bookings tab

This patch adds the 'Show completed' filter toggle option to the
bookings display tab on both the patron details and circulation pages.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Comment 7 Nick Clemens (kidclamp) 2024-08-05 11:55:58 UTC
This doesn't work for me, I had to move the line:
let filter_expired = true;
up in scope , then the link worked.

There is another issue, if the patron has no current bookings the table is not loaded and you can't see their expired bookings
Comment 8 Paul Derscheid 2024-08-05 12:00:46 UTC
Strange that the first issue didn't come up for me.

I'll take a look at it again in a bit.
Comment 9 Paul Derscheid 2024-08-05 12:28:44 UTC
I've looked at the wrong page because it didn't read the title of this bug.

My sign-off is therefore invalid.
Comment 10 Paul Derscheid 2024-08-05 13:46:52 UTC
Created attachment 170063 [details] [review]
Bug 37141: (follow-up) Move filter_expired to outer scope

This allows access by the bookings-tab and the expired_filter click handlers
which are both required for the state change to work.
Comment 11 Paul Derscheid 2024-08-05 13:46:55 UTC
Created attachment 170064 [details] [review]
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table

We preserve the existing logic of this bug and add another case
for when we just encounter expired bookings.

In that case we render the fieldset without the 'filtered' class and
determine the value of filter_expired in bookings.js by the class being set.
Comment 12 David Nind 2024-08-06 08:19:53 UTC
Created attachment 170081 [details] [review]
Bug 37141: Add 'Show completed' option to bookings tab

This patch adds the 'Show completed' filter toggle option to the
bookings display tab on both the patron details and circulation pages.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Nind <david@davidnind.com>
Comment 13 David Nind 2024-08-06 08:19:56 UTC
Created attachment 170082 [details] [review]
Bug 37141: (follow-up) Move filter_expired to outer scope

This allows access by the bookings-tab and the expired_filter click handlers
which are both required for the state change to work.

Signed-off-by: David Nind <david@davidnind.com>
Comment 14 David Nind 2024-08-06 08:19:58 UTC
Created attachment 170083 [details] [review]
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table

We preserve the existing logic of this bug and add another case
for when we just encounter expired bookings.

In that case we render the fieldset without the 'filtered' class and
determine the value of filter_expired in bookings.js by the class being set.

Signed-off-by: David Nind <david@davidnind.com>
Comment 15 Nick Clemens (kidclamp) 2024-08-06 11:43:19 UTC
Created attachment 170088 [details] [review]
Bug 37141: Add 'Show completed' option to bookings tab

This patch adds the 'Show completed' filter toggle option to the
bookings display tab on both the patron details and circulation pages.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 16 Nick Clemens (kidclamp) 2024-08-06 11:43:21 UTC
Created attachment 170089 [details] [review]
Bug 37141: (follow-up) Move filter_expired to outer scope

This allows access by the bookings-tab and the expired_filter click handlers
which are both required for the state change to work.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 17 Nick Clemens (kidclamp) 2024-08-06 11:43:24 UTC
Created attachment 170090 [details] [review]
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table

We preserve the existing logic of this bug and add another case
for when we just encounter expired bookings.

In that case we render the fieldset without the 'filtered' class and
determine the value of filter_expired in bookings.js by the class being set.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 18 Nick Clemens (kidclamp) 2024-08-06 11:43:26 UTC
Created attachment 170091 [details] [review]
Bug 37141: Tidy JS

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 19 Martin Renvoize (ashimema) 2024-08-15 14:16:40 UTC
Thanks so much for taking this one over Paul.. you've done a great job with the follow-ups I hadn't managed to get on to yet!

Thanks for the testing and quick QA Nick!

Go teamwork!
Comment 20 Katrin Fischer 2024-08-26 08:29:13 UTC
Please keep in mind, we need to use double underscores for translatable strings in .js files. Fixed in a follow-up. Fixed in a follow-up.
Comment 21 Katrin Fischer 2024-08-26 15:43:45 UTC
Pushed for 24.11!

Well done everyone, thank you!