bug 2893: extend conditions handled by AllowNotForLoanOverride

Prior to this patch, turning AllowNotForLoanOverride on
allowed the circ operator to permit the loan of an
item who's individual not-for-loan flag was set, but did
not allow the loan of an item whose item type's not-for-loan
flag was set.  This patch extends the definition of the
system preference so that both cases are covered.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Galen Charlton 2009-06-17 08:00:57 -05:00
parent 5dd3a9c157
commit 09279e2334
1 changed files with 11 additions and 3 deletions

View File

@ -771,12 +771,20 @@ sub CanBookBeIssued {
$sth->execute($item->{'itemtype'});
my $notforloan=$sth->fetchrow_hashref();
$sth->finish();
if ($notforloan->{'notforloan'} == 1){
$issuingimpossible{NOT_FOR_LOAN} = 1;
if ($notforloan->{'notforloan'}) {
if (!C4::Context->preference("AllowNotForLoanOverride")) {
$issuingimpossible{NOT_FOR_LOAN} = 1;
} else {
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
}
}
}
elsif ($biblioitem->{'notforloan'} == 1){
$issuingimpossible{NOT_FOR_LOAN} = 1;
if (!C4::Context->preference("AllowNotForLoanOverride")) {
$issuingimpossible{NOT_FOR_LOAN} = 1;
} else {
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
}
}
}
if ( $item->{'wthdrawn'} && $item->{'wthdrawn'} == 1 )