From 411849f2f4751f8b697edaee80b30516347faefb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Sun, 4 Sep 2022 10:46:16 +0300 Subject: [PATCH] Bug 31519: Move preference fetching directly to be done in the template Since we are not in a loop or using this multiple times it's simple to do it this way, helps with changing the template code in the future too since if we want to remove this syspref variable we know it is only used in this one particular place. To test: 1) Grep for reserve_in_future and make sure there are no matches after applying this patch --- koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 2 +- reserve/request.pl | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index eb37dbc00e..d4818aa865 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -581,7 +581,7 @@ [% END %] [% END # /UNLESS multi_hold %] - [% IF ( reserve_in_future ) %] + [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
  • diff --git a/reserve/request.pl b/reserve/request.pl index a15bc53bcc..6264b78a45 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -713,10 +713,6 @@ $template->param( # pass the userenv branch if no pickup location selected $template->param( pickup => $pickup || C4::Context->userenv->{branch} ); -if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) { - $template->param( reserve_in_future => 1 ); -} - $template->param(borrowernumber => $borrowernumber_hold); # printout the page -- 2.30.2