|
Lines 196-211
my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG");
Link Here
|
| 196 |
|
196 |
|
| 197 |
# Is the person allowed to choose their branch |
197 |
# Is the person allowed to choose their branch |
| 198 |
if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { |
198 |
if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { |
|
|
199 |
my $branchcode = $input->param('branchcode') || q{}; |
| 199 |
|
200 |
|
| 200 |
# pass the pickup branch along.... |
201 |
if ( !$branchcode && $borrowernumber ) { |
| 201 |
my $userbranch = ''; |
202 |
my $patron = Koha::Patrons->find($borrowernumber); |
| 202 |
if (C4::Context->userenv && C4::Context->userenv->{'branch'}) { |
203 |
$branchcode = $patron->branchcode; |
| 203 |
$userbranch = C4::Context->userenv->{'branch'}; |
|
|
| 204 |
} |
204 |
} |
| 205 |
my $branchcode = $input->param('branchcode'); |
205 |
|
| 206 |
unless ( $branchcode ) { |
206 |
if ( !$branchcode |
| 207 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
207 |
&& C4::Context->userenv |
| 208 |
$branchcode = $patron->branchcode || $userbranch || '' ; |
208 |
&& C4::Context->userenv->{branch} ) |
|
|
209 |
{ |
| 210 |
$branchcode = C4::Context->userenv->{branch}; |
| 209 |
} |
211 |
} |
| 210 |
|
212 |
|
| 211 |
$template->param( branchcode => $branchcode ); |
213 |
$template->param( branchcode => $branchcode ); |
| 212 |
- |
|
|