From 1acf3d98919da45a1b7590fa1f153dd2b02debd3 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 28 Aug 2023 22:24:24 +0000 Subject: [PATCH] Bug 34634: Show expirationdate of expired holds on reserve/request.pl To test: 1. Place some holds and go to /reserve/request.pl for that bib. 2. If the reserves.expirationdate is set to today or some date in the past the date does not display in the Flatpickr instance. 3. Change the reserves.expirationdate to sometime in the future, the date displays. 4. Aply patch, restart_all 5. Try steps 2-3 again. 6. This time if the expiration date is in the past you should see it displayed. However it will be uneditable. 7. Make sure holds with a expiration date in the future can still be properly edited. Signed-off-by: Matt Blenkinsop Signed-off-by: Christine Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 0710ccb606faba126acb7b7e62b2868b6a28cbb5) Signed-off-by: Fridolin Somers (cherry picked from commit 0594b63baebe2f8c0ff1acf605aa32da6f3e2a39) Signed-off-by: Matt Blenkinsop --- koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc | 6 +++++- reserve/request.pl | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc index d5b9a67a4f..d17639e41e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -125,7 +125,11 @@ [% END %] - + [% UNLESS hold.expired %] + + [% ELSE %] + [% hold.expirationdate | $KohaDates %] + [% END %] [%- IF ( hold.found ) -%] diff --git a/reserve/request.pl b/reserve/request.pl index be406d2420..efa352aa51 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -615,8 +615,9 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) $reserve{'item_level_hold'} = 1; } } - $reserve{'expirationdate'} = $res->expirationdate; + $reserve{'expired'} = 1 + if ( DateTime->compare( dt_from_string( $res->expirationdate ), dt_from_string() ) == -1 ); $reserve{'date'} = $res->reservedate; $reserve{'borrowernumber'} = $res->borrowernumber(); $reserve{'biblionumber'} = $res->biblionumber(); -- 2.39.2