Lines 93-99
if (defined C4::Context->preference('SCOAllowCheckin')) {
Link Here
|
93 |
} |
93 |
} |
94 |
|
94 |
|
95 |
my $issuerid = $loggedinuser; |
95 |
my $issuerid = $loggedinuser; |
96 |
my ($op, $patronlogin, $patronpw, $barcode, $confirmed, $newissues) = ( |
96 |
my ($op, $patronlogin, $patronpw, $barcodestr, $confirmed, $newissues) = ( |
97 |
$query->param("op") || '', |
97 |
$query->param("op") || '', |
98 |
$query->param("patronlogin")|| '', |
98 |
$query->param("patronlogin")|| '', |
99 |
$query->param("patronpw") || '', |
99 |
$query->param("patronpw") || '', |
Lines 109-115
if ($op eq "logout") {
Link Here
|
109 |
undef $jwt; |
109 |
undef $jwt; |
110 |
} |
110 |
} |
111 |
|
111 |
|
112 |
$barcode = barcodedecode( $barcode ) if $barcode; |
112 |
my $barcodes = []; |
|
|
113 |
if ( $barcodestr ) { |
114 |
push @$barcodes, split( /\s\n/, $barcodestr ); |
115 |
$barcodes = [ map { $_ =~ /^\s*$/ ? () : barcodedecode( $_ ) } @$barcodes ]; |
116 |
} |
113 |
|
117 |
|
114 |
my @newissueslist = split /,/, $newissues; |
118 |
my @newissueslist = split /,/, $newissues; |
115 |
my $issuenoconfirm = 1; #don't need to confirm on issue. |
119 |
my $issuenoconfirm = 1; #don't need to confirm on issue. |
Lines 142-148
my $return_only = 0;
Link Here
|
142 |
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { |
146 |
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { |
143 |
my $success = 1; |
147 |
my $success = 1; |
144 |
|
148 |
|
145 |
|
149 |
foreach my $barcode ( @$barcodes ) { |
146 |
my $item = Koha::Items->find( { barcode => $barcode } ); |
150 |
my $item = Koha::Items->find( { barcode => $barcode } ); |
147 |
if ( $success && C4::Context->preference("CircConfirmItemParts") ) { |
151 |
if ( $success && C4::Context->preference("CircConfirmItemParts") ) { |
148 |
if ( defined($item) |
152 |
if ( defined($item) |
Lines 162-171
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) {
Link Here
|
162 |
($success) = AddReturn( $barcode, $branch ) |
166 |
($success) = AddReturn( $barcode, $branch ) |
163 |
} |
167 |
} |
164 |
|
168 |
|
165 |
$template->param( returned => $success ); |
169 |
$template->param( |
|
|
170 |
returned => $success, |
171 |
barcode => $barcode |
172 |
); |
173 |
} # foreach barcode in barcodes |
166 |
} |
174 |
} |
167 |
elsif ( $patron && ( $op eq 'checkout' ) ) { |
175 |
elsif ( $patron && ( $op eq 'checkout' ) ) { |
168 |
|
176 |
foreach my $barcode ( @$barcodes ) { |
169 |
my $item = Koha::Items->find( { barcode => $barcode } ); |
177 |
my $item = Koha::Items->find( { barcode => $barcode } ); |
170 |
my $impossible = {}; |
178 |
my $impossible = {}; |
171 |
my $needconfirm = {}; |
179 |
my $needconfirm = {}; |
Lines 208-221
elsif ( $patron && ( $op eq 'checkout' ) ) {
Link Here
|
208 |
barcode => $barcode, |
216 |
barcode => $barcode, |
209 |
); |
217 |
); |
210 |
} |
218 |
} |
|
|
219 |
last; |
211 |
} elsif ( $needconfirm->{RENEW_ISSUE} ){ |
220 |
} elsif ( $needconfirm->{RENEW_ISSUE} ){ |
212 |
$template->param( |
221 |
$template->param( |
213 |
renew => 1, |
222 |
renew => 1, |
214 |
barcode => $barcode, |
223 |
barcode => $barcode, |
215 |
confirm => 1, |
224 |
confirm => $item->biblio->title, |
216 |
confirm_renew_issue => 1, |
225 |
confirm_renew_issue => 1, |
217 |
hide_main => 1, |
226 |
hide_main => 1, |
218 |
); |
227 |
); |
|
|
228 |
last; |
219 |
} elsif ( $confirm_required && !$confirmed ) { |
229 |
} elsif ( $confirm_required && !$confirmed ) { |
220 |
$template->param( |
230 |
$template->param( |
221 |
impossible => 1, |
231 |
impossible => 1, |
Lines 225-230
elsif ( $patron && ( $op eq 'checkout' ) ) {
Link Here
|
225 |
if ($issue_error eq 'DEBT') { |
235 |
if ($issue_error eq 'DEBT') { |
226 |
$template->param(DEBT => $needconfirm->{DEBT}); |
236 |
$template->param(DEBT => $needconfirm->{DEBT}); |
227 |
} |
237 |
} |
|
|
238 |
last; |
228 |
} else { |
239 |
} else { |
229 |
if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. |
240 |
if ( $confirmed || $issuenoconfirm ) { # we'll want to call getpatroninfo again to get updated issues. |
230 |
my ( $hold_existed, $item ); |
241 |
my ( $hold_existed, $item ); |
Lines 273-281
elsif ( $patron && ( $op eq 'checkout' ) ) {
Link Here
|
273 |
); |
284 |
); |
274 |
} |
285 |
} |
275 |
} |
286 |
} |
|
|
287 |
} # foreach barcode in barcodes |
276 |
} # $op |
288 |
} # $op |
277 |
|
289 |
|
278 |
if ( $patron && ( $op eq 'renew' ) ) { |
290 |
if ( $patron && ( $op eq 'renew' ) ) { |
|
|
291 |
foreach my $barcode ( @$barcodes ) { |
279 |
my $item = Koha::Items->find({ barcode => $barcode }); |
292 |
my $item = Koha::Items->find({ barcode => $barcode }); |
280 |
|
293 |
|
281 |
if ( $patron->checkouts->find( { itemnumber => $item->itemnumber } ) ) { |
294 |
if ( $patron->checkouts->find( { itemnumber => $item->itemnumber } ) ) { |
Lines 294-299
if ( $patron && ( $op eq 'renew' ) ) {
Link Here
|
294 |
} else { |
307 |
} else { |
295 |
$template->param( renewed => 0 ); |
308 |
$template->param( renewed => 0 ); |
296 |
} |
309 |
} |
|
|
310 |
} # foreach barcode in barcodes |
297 |
} |
311 |
} |
298 |
|
312 |
|
299 |
if ( $patron) { |
313 |
if ( $patron) { |
300 |
- |
|
|