Bug 18349: If a confirmation is required, consider as blocker
Only RENEW_ISSUE should not be considered as blocker, others should. Note that this code is not robust and the whole script as well as the return of CanBookBeIssued should be rewrittent completely. We need a small patch to easy backport to stable releases Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> (cherry picked from commitd28d5a280d) Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> (cherry picked from commit9062df67c8) Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
parent
bfffe0da9e
commit
1d2da76287
|
|
@ -141,16 +141,22 @@ elsif ( $op eq "checkout" ) {
|
|||
0,
|
||||
C4::Context->preference("AllowItemsOnHoldCheckout")
|
||||
);
|
||||
$confirm_required = scalar keys %$needconfirm;
|
||||
my $issue_error;
|
||||
if ( $confirm_required = scalar keys %$needconfirm ) {
|
||||
for my $error ( qw( UNKNOWN_BARCODE max_loans_allowed ISSUED_TO_ANOTHER NO_MORE_RENEWALS NOT_FOR_LOAN DEBT WTHDRAWN RESTRICTED RESERVED ITEMNOTSAMEBRANCH EXPIRED DEBARRED CARD_LOST GNA INVALID_DATE UNKNOWN_BARCODE TOO_MANY DEBT_GUARANTEES USERBLOCKEDOVERDUE PATRON_CANT PREVISSUE NOT_FOR_LOAN_FORCING ITEM_LOST) ) {
|
||||
if ( $needconfirm->{$error} ) {
|
||||
$issue_error = $error;
|
||||
$confirmed = 0;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#warn "confirm_required: " . $confirm_required ;
|
||||
if (scalar keys %$impossible) {
|
||||
|
||||
# warn "impossible: numkeys: " . scalar (keys(%$impossible));
|
||||
#warn join " ", keys %$impossible;
|
||||
my $issue_error = (keys %$impossible)[0];
|
||||
my $issue_error = (keys %$impossible)[0]; # FIXME This is wrong, we assume only one error and keys are not ordered
|
||||
|
||||
# FIXME we assume only one error.
|
||||
$template->param(
|
||||
impossible => $issue_error,
|
||||
"circ_error_$issue_error" => 1,
|
||||
|
|
@ -184,9 +190,8 @@ elsif ( $op eq "checkout" ) {
|
|||
}
|
||||
} elsif ( $confirm_required && !$confirmed ) {
|
||||
#warn "failed confirmation";
|
||||
my $issue_error = (keys %$needconfirm)[0];
|
||||
$template->param(
|
||||
impossible => (keys %$needconfirm)[0],
|
||||
impossible => 1,
|
||||
"circ_error_$issue_error" => 1,
|
||||
hide_main => 1,
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue