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 <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Christine <chlee@pascolibraries.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0710ccb606)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0594b63bae)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
Lucas Gass 2023-08-28 22:24:24 +00:00 committed by Matt Blenkinsop
parent 755e4ee5f5
commit 1acf3d9891
2 changed files with 7 additions and 2 deletions

View file

@ -125,7 +125,11 @@
[% END %]
</td>
<td>
<input type="text" class="flatpickr" data-flatpickr-futuredate="true" value="[% hold.expirationdate | html %]" size="10" name="expirationdate" />
[% UNLESS hold.expired %]
<input type="text" class="flatpickr" data-flatpickr-futuredate="true" value="[% hold.expirationdate | html %]" size="10" name="expirationdate" />
[% ELSE %]
<span class="expiredon"><label>Expired:</label> [% hold.expirationdate | $KohaDates %]</span>
[% END %]
</td>
<td>
[%- IF ( hold.found ) -%]

View file

@ -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();