From 046e440182ee3d718fcff07b3665adc092aca12a Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 7 Feb 2024 15:21:04 +0000 Subject: [PATCH] Bug 35977: Set holddatefrom default to today This patch sets the holddatefrom date to today by default on the opac. Signed-off-by: Barbara Johnson Signed-off-by: Owen Leonard Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer (cherry picked from commit c341b2d37584aca52fcac7243f7ab68f324d002c) Signed-off-by: Fridolin Somers (cherry picked from commit 648feb2594ea9454ec7de4996cd6f39deb8450e7) Signed-off-by: Lucas Gass --- .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 2 +- opac/opac-reserve.pl | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 5f09aa53f7..bd708c67b2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -291,7 +291,7 @@ [% IF ( reserve_in_future ) %]
  • - + [% INCLUDE 'date-format.inc' %]
  • diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 6e845e17af..599894e334 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -35,6 +35,7 @@ use C4::Overdues; use Koha::AuthorisedValues; use Koha::Biblios; use Koha::CirculationRules; +use Koha::DateUtils qw( dt_from_string ); use Koha::Items; use Koha::ItemTypes; use Koha::Checkouts; @@ -617,12 +618,12 @@ $template->param(OpacHoldNotes=>$show_notes); # display infos $template->param(bibitemloop => $biblioLoop); # can set reserve date in future -if ( - C4::Context->preference( 'AllowHoldDateInFuture' ) && - C4::Context->preference( 'OPACAllowHoldDateInFuture' ) - ) { +if ( C4::Context->preference('AllowHoldDateInFuture') + && C4::Context->preference('OPACAllowHoldDateInFuture') ) +{ $template->param( - reserve_in_future => 1, + reserve_in_future => 1, + today => dt_from_string, ); } -- 2.39.5