From 2430acd7851ae4b2121a6a9bd01ad5e4f1f8d880 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 10 Sep 2018 13:45:32 -0700 Subject: [PATCH] Bug 7534: (QA follow-up) Use Koha.Preference template plugin to fetch the pref's value Signed-off-by: Jonathan Druart --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 4 ++-- opac/opac-reserve.pl | 7 +------ 2 files changed, 3 insertions(+), 8 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 d1bf7ee78a..aca8342f30 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -221,7 +221,7 @@ [% UNLESS ( singleBranchMode ) %] - [% IF ( bibitemloo.holdable && choose_branch ) %] + [% IF ( bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch')) %]
  • [% UNLESS ( bibitemloo.holdable ) %] @@ -248,7 +248,7 @@ [% END %] [% END # / UNLESS bibitemloo.holdable %]
  • - [% END # / IF bibitemloo.holdable && choose_branch %] + [% END # / IF bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch') %] [% END # / UNLESS singleBranchMode %] diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 684e57d1c3..153a1be6a7 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -140,11 +140,6 @@ if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) { my $branch = $query->param('branch') || $patron->branchcode || C4::Context->userenv->{branch} || '' ; $template->param( branch => $branch ); -# Is the person allowed to choose their branch -my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0; - -$template->param( choose_branch => $OPACChooseBranch); - # # # Build hashes of the requested biblio(item)s and items. @@ -240,7 +235,7 @@ if ( $query->param('place_reserve') ) { my $canreserve = 0; my $singleBranchMode = Koha::Libraries->search->count == 1; - if ( $singleBranchMode || !$OPACChooseBranch ) + if ( $singleBranchMode || ! C4::Context->preference("OPACAllowUserToChooseBranch") ) { # single branch mode or disabled user choosing $branch = $patron->branchcode; } -- 2.11.0