|
Lines 83-94
if (!C4::Context->userenv){
Link Here
|
| 83 |
|
83 |
|
| 84 |
my $barcodes = []; |
84 |
my $barcodes = []; |
| 85 |
my $barcode = $query->param('barcode'); |
85 |
my $barcode = $query->param('barcode'); |
|
|
86 |
my $findborrower; |
| 87 |
my $autoswitched; |
| 86 |
|
88 |
|
| 87 |
if (C4::Context->preference("AutoSwitchPatron") && $barcode) { |
89 |
if (C4::Context->preference("AutoSwitchPatron") && $barcode) { |
| 88 |
if (Koha::Patrons->search( { cardnumber => $barcode} )->count() > 0) { |
90 |
if (Koha::Patrons->search( { cardnumber => $barcode} )->count() > 0) { |
| 89 |
print $query->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$barcode&autoswitched=1"); |
91 |
$findborrower = $barcode; |
|
|
92 |
undef $barcode; |
| 93 |
$autoswitched = 1; |
| 90 |
} |
94 |
} |
| 91 |
} |
95 |
} |
|
|
96 |
$findborrower ||= $query->param('findborrower') || q{}; |
| 97 |
$findborrower =~ s|,| |g; |
| 92 |
|
98 |
|
| 93 |
# Barcode given by user could be '0' |
99 |
# Barcode given by user could be '0' |
| 94 |
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) { |
100 |
if ( $barcode || ( defined($barcode) && $barcode eq '0' ) ) { |
|
Lines 153-161
for (@failedreturns) { $return_failed{$_} = 1; }
Link Here
|
| 153 |
|
159 |
|
| 154 |
my $searchtype = $query->param('searchtype') || q{contain}; |
160 |
my $searchtype = $query->param('searchtype') || q{contain}; |
| 155 |
|
161 |
|
| 156 |
my $findborrower = $query->param('findborrower') || q{}; |
|
|
| 157 |
$findborrower =~ s|,| |g; |
| 158 |
|
| 159 |
my $branch = C4::Context->userenv->{'branch'}; |
162 |
my $branch = C4::Context->userenv->{'branch'}; |
| 160 |
|
163 |
|
| 161 |
if (C4::Context->preference("DisplayClearScreenButton")) { |
164 |
if (C4::Context->preference("DisplayClearScreenButton")) { |
|
Lines 664-670
$template->param(
Link Here
|
| 664 |
has_modifications => $has_modifications, |
667 |
has_modifications => $has_modifications, |
| 665 |
override_high_holds => $override_high_holds, |
668 |
override_high_holds => $override_high_holds, |
| 666 |
nopermission => scalar $query->param('nopermission'), |
669 |
nopermission => scalar $query->param('nopermission'), |
| 667 |
autoswitched => $query->param("autoswitched"), |
670 |
autoswitched => $autoswitched, |
| 668 |
); |
671 |
); |
| 669 |
|
672 |
|
| 670 |
output_html_with_http_headers $query, $cookie, $template->output; |
673 |
output_html_with_http_headers $query, $cookie, $template->output; |
| 671 |
- |
|
|