Lines 29-35
use CGI qw ( -utf8 );
Link Here
|
29 |
use URI::Escape qw( uri_escape_utf8 ); |
29 |
use URI::Escape qw( uri_escape_utf8 ); |
30 |
use DateTime; |
30 |
use DateTime; |
31 |
use DateTime::Duration; |
31 |
use DateTime::Duration; |
32 |
use Scalar::Util qw( looks_like_number ); |
32 |
use Scalar::Util qw( blessed looks_like_number ); |
|
|
33 |
use Try::Tiny; |
33 |
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); |
34 |
use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); |
34 |
use C4::Auth qw( get_session get_template_and_user ); |
35 |
use C4::Auth qw( get_session get_template_and_user ); |
35 |
use C4::Koha; |
36 |
use C4::Koha; |
Lines 298-313
if (@$barcodes) {
Link Here
|
298 |
}; |
299 |
}; |
299 |
|
300 |
|
300 |
# always check for blockers on issuing |
301 |
# always check for blockers on issuing |
301 |
my ( $error, $question, $alerts, $messages ) = CanBookBeIssued( |
302 |
my ( $error, $question, $alerts, $messages ); |
302 |
$patron, |
303 |
try { |
303 |
$barcode, $datedue, |
304 |
( $error, $question, $alerts, $messages ) = CanBookBeIssued( |
304 |
$inprocess, |
305 |
$patron, |
305 |
undef, |
306 |
$barcode, $datedue, |
306 |
{ |
307 |
$inprocess, |
307 |
onsite_checkout => $onsite_checkout, |
308 |
undef, |
308 |
override_high_holds => $override_high_holds || $override_high_holds_tmp || 0, |
309 |
{ |
|
|
310 |
onsite_checkout => $onsite_checkout, |
311 |
override_high_holds => $override_high_holds || $override_high_holds_tmp || 0, |
312 |
} |
313 |
); |
314 |
} catch { |
315 |
die $_ unless blessed $_ && $_->can('rethrow'); |
316 |
|
317 |
if ($_->isa('Koha::Exceptions::Calendar::NoOpenDays')) { |
318 |
$error = { NO_OPEN_DAYS => 1 }; |
319 |
} else { |
320 |
$_->rethrow; |
309 |
} |
321 |
} |
310 |
); |
322 |
}; |
311 |
|
323 |
|
312 |
my $blocker = $invalidduedate ? 1 : 0; |
324 |
my $blocker = $invalidduedate ? 1 : 0; |
313 |
|
325 |
|
Lines 354-360
if (@$barcodes) {
Link Here
|
354 |
# Only some errors will block when performing forced onsite checkout, |
366 |
# Only some errors will block when performing forced onsite checkout, |
355 |
# for other cases all errors will block |
367 |
# for other cases all errors will block |
356 |
my @blocking_error_codes = ($onsite_checkout and C4::Context->preference("OnSiteCheckoutsForce")) ? |
368 |
my @blocking_error_codes = ($onsite_checkout and C4::Context->preference("OnSiteCheckoutsForce")) ? |
357 |
qw( UNKNOWN_BARCODE ) : (keys %$error); |
369 |
qw( UNKNOWN_BARCODE NO_OPEN_DAYS ) : (keys %$error); |
358 |
|
370 |
|
359 |
foreach my $code ( @blocking_error_codes ) { |
371 |
foreach my $code ( @blocking_error_codes ) { |
360 |
if ($error->{$code}) { |
372 |
if ($error->{$code}) { |