From 648feb2594ea9454ec7de4996cd6f39deb8450e7 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 --- .../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 04db63f6f6..8aa08b268d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -287,7 +287,7 @@ [% IF ( reserve_in_future ) %]
  • - + [% INCLUDE 'date-format.inc' %]
  • diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index fb1fcfe345..ab492c8834 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