Bug 37574 - Add visual indicator that bookings are expired
Summary: Add visual indicator that bookings are expired
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Paul Derscheid
QA Contact: Martin Renvoize
URL:
Keywords: release-notes-needed
Depends on: 37141
Blocks:
  Show dependency treegraph
 
Reported: 2024-08-06 11:45 UTC by Nick Clemens (kidclamp)
Modified: 2024-08-26 15:43 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function: bookings


Attachments
Bug 37574: Add visual indicator that bookings are expired (5.64 KB, patch)
2024-08-07 11:08 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37574: (follow-up) disable ordering and searching on status column (1.96 KB, patch)
2024-08-08 07:43 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37574: Add visual indicator that bookings are expired (5.69 KB, patch)
2024-08-08 14:01 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37574: (follow-up) disable ordering and searching on status column (2.01 KB, patch)
2024-08-08 14:01 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 37574: Add visual indicator that bookings are expired (5.76 KB, patch)
2024-08-15 14:24 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 37574: (follow-up) disable ordering and searching on status column (2.08 KB, patch)
2024-08-15 14:24 UTC, Martin Renvoize
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-08-06 11:45:13 UTC
We should add a text and possibly a color to highlight expired bookings when displayed to make it more obvious.

Bug 37141 will display expired bookings by default on a patron with no active bookings, the filter button does say 'Hide expired' but making the rows more obviously expired would be nice
Comment 1 Paul Derscheid 2024-08-07 11:08:34 UTC
Created attachment 170132 [details] [review]
Bug 37574: Add visual indicator that bookings are expired

Adds a status column to the table configuration that displays whether a booking is active or expired (at the moment).
This column is conditionally shown in the 'Show Expired' state, meaning after expired bookings are loaded into the table.

To test:
1) Create a couple booking for any item for a single patron.
2) Open a db shell with `koha-mysql <INSTANCE>`
3) Update one or two of the created bookings 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) Click the 'Show Expired' option in the top left of the table.
6) Note that bookings are tagged with 'Expired' and 'Active'.
7) Repeat 5 and 6 for the bookings tab in the patron's details view.
8) Sign off.

Note: the bootstrap classes for v5 are already included so they become colored once the patch is in.
Comment 2 Owen Leonard 2024-08-07 14:18:14 UTC
I'm getting an error when I try to reorder the table by status:

==> /var/log/koha/kohadev/plack-api-error.log <==
[2024/08/07 14:14:59] [ERROR] GET /api/v1/bookings: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me' in 'order clause' at /kohadevbox/koha/Koha/Objects.pm line 403>>
Comment 3 Paul Derscheid 2024-08-07 14:21:04 UTC
Ah, thought that was client side.
Will remove the 'orderable' property until there's a db column for it.
Comment 4 Paul Derscheid 2024-08-08 07:43:28 UTC
Created attachment 170151 [details] [review]
Bug 37574: (follow-up) disable ordering and searching on status column
Comment 5 Owen Leonard 2024-08-08 14:01:13 UTC
Created attachment 170159 [details] [review]
Bug 37574: Add visual indicator that bookings are expired

Adds a status column to the table configuration that displays whether a
booking is active or expired (at the moment).
This column is conditionally shown in the 'Show Expired' state, meaning
after expired bookings are loaded into the table.

To test:
1) Create a couple booking for any item for a single patron.
2) Open a db shell with `koha-mysql <INSTANCE>`
3) Update one or two of the created bookings 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) Click the 'Show Expired' option in the top left of the table.
6) Note that bookings are tagged with 'Expired' and 'Active'.
7) Repeat 5 and 6 for the bookings tab in the patron's details view.
8) Sign off.

Note: the bootstrap classes for v5 are already included so they become
colored once the patch is in.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2024-08-08 14:01:15 UTC
Created attachment 170160 [details] [review]
Bug 37574: (follow-up) disable ordering and searching on status column

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Martin Renvoize 2024-08-15 14:24:24 UTC
Created attachment 170382 [details] [review]
Bug 37574: Add visual indicator that bookings are expired

Adds a status column to the table configuration that displays whether a
booking is active or expired (at the moment).
This column is conditionally shown in the 'Show Expired' state, meaning
after expired bookings are loaded into the table.

To test:
1) Create a couple booking for any item for a single patron.
2) Open a db shell with `koha-mysql <INSTANCE>`
3) Update one or two of the created bookings 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) Click the 'Show Expired' option in the top left of the table.
6) Note that bookings are tagged with 'Expired' and 'Active'.
7) Repeat 5 and 6 for the bookings tab in the patron's details view.
8) Sign off.

Note: the bootstrap classes for v5 are already included so they become
colored once the patch is in.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2024-08-15 14:24:26 UTC
Created attachment 170383 [details] [review]
Bug 37574: (follow-up) disable ordering and searching on status column

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2024-08-15 14:25:03 UTC
Nice addition, all working as expected and doesn't block any future developments or cause any regressions.

Passing QA, Thanks Paul!
Comment 10 Katrin Fischer 2024-08-26 08:26:17 UTC
1) Translatability

This is in a .tt file, so we need the single underscore:

+                title: __("Status"),

Fixed in a follow-up patch.

I notice we have almost the same code in a .js as well, with the correct double underscore.
Comment 11 Katrin Fischer 2024-08-26 15:43:51 UTC
Pushed for 24.11!

Well done everyone, thank you!