X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=opac%2Fopac-suggestions.pl;h=cf562fb97e4abe929649df6f215e8542eaeadd1c;hb=677fd902f377ef81b6623545f0e67bb10af64e93;hp=d300769b2c7daf857c186b05794affd2fdea873e;hpb=b59df2bce788bc5cc3b184c9c74688dd745a2fb0;p=koha.git diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index d300769b2c..cf562fb97e 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -15,8 +15,8 @@ # You should have received a copy of the GNU General Public License # along with Koha; if not, see . -use strict; -use warnings; +use Modern::Perl; + use CGI qw ( -utf8 ); use Encode qw( encode ); @@ -30,6 +30,7 @@ use C4::Scrubber; use Koha::AuthorisedValues; use Koha::Libraries; +use Koha::Patrons; use Koha::DateUtils qw( dt_from_string ); @@ -195,14 +196,14 @@ my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG"); # Is the person allowed to choose their branch if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { - my ( $borr ) = GetMember( borrowernumber => $borrowernumber ); + my $branchcode = $input->param('branchcode') || q{}; -# pass the pickup branch along.... - my $userbranch = ''; - if (C4::Context->userenv && C4::Context->userenv->{'branch'}) { - $userbranch = C4::Context->userenv->{'branch'}; + if ( !$branchcode + && C4::Context->userenv + && C4::Context->userenv->{branch} ) + { + $branchcode = C4::Context->userenv->{branch}; } - my $branchcode = $input->param('branchcode') || $borr->{'branchcode'} || $userbranch || '' ; $template->param( branchcode => $branchcode ); }