From c341b2d37584aca52fcac7243f7ab68f324d002c 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 --- .../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 bacd8b77cb..8813367702 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -288,7 +288,7 @@ [% IF ( reserve_in_future ) %]
  • - + [% INCLUDE 'date-format.inc' %]
  • diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 783b95f027..fe1d38fbe9 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; @@ -618,12 +619,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