Merge branch 'bug_9423' into 3.12-master

This commit is contained in:
Jared Camins-Esakov 2013-03-19 22:23:21 -04:00
commit 9b95795edc
3 changed files with 35 additions and 3 deletions

View file

@ -36,7 +36,11 @@ use C4::Message;
use C4::Debug;
use C4::Branch; # GetBranches
use C4::Log; # logaction
use C4::Koha qw(GetAuthorisedValueByCode);
use C4::Koha qw(
GetAuthorisedValueByCode
GetAuthValCode
GetKohaAuthorisedValueLib
);
use C4::Overdues qw(CalcFine UpdateFine);
use Algorithm::CheckDigits;
@ -835,8 +839,10 @@ sub CanBookBeIssued {
{
if(!C4::Context->preference("AllowNotForLoanOverride")){
$issuingimpossible{NOT_FOR_LOAN} = 1;
$issuingimpossible{item_notforloan} = $item->{'notforloan'};
}else{
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
$needsconfirmation{item_notforloan} = $item->{'notforloan'};
}
}
else {
@ -850,16 +856,20 @@ sub CanBookBeIssued {
if ($notforloan->{'notforloan'}) {
if (!C4::Context->preference("AllowNotForLoanOverride")) {
$issuingimpossible{NOT_FOR_LOAN} = 1;
$issuingimpossible{itemtype_notforloan} = $item->{'itype'};
} else {
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
$needsconfirmation{itemtype_notforloan} = $item->{'itype'};
}
}
}
elsif ($biblioitem->{'notforloan'} == 1){
if (!C4::Context->preference("AllowNotForLoanOverride")) {
$issuingimpossible{NOT_FOR_LOAN} = 1;
$issuingimpossible{itemtype_notforloan} = $biblioitem->{'itemtype'};
} else {
$needsconfirmation{NOT_FOR_LOAN_FORCING} = 1;
$needsconfirmation{itemtype_notforloan} = $biblioitem->{'itemtype'};
}
}
}

View file

@ -286,6 +286,12 @@ if ($barcode) {
$template->param( alert => $alerts );
# Get the item title for more information
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
$template->param(
authvalcode_notforloan => C4::Koha::GetAuthValCode('items.notforloan', $getmessageiteminfo->{'frameworkcode'}),
);
delete $question->{'DEBT'} if ($debt_confirmed);
foreach my $impossible ( keys %$error ) {
$template->param(

View file

@ -1,4 +1,5 @@
[% USE KohaDates %]
[% USE KohaAuthorisedValues %]
[% INCLUDE 'doc-head-open.inc' %]
[% SET destination = "circ" %]
<title>Koha &rsaquo; Circulation
@ -350,7 +351,15 @@ function validate1(date) {
[% END %]
[% IF ( NOT_FOR_LOAN_FORCING ) %]
<li>Item is normally not for loan. Check out anyway?</li>
<li>
[% IF ( itemtype_notforloan ) %]
Item type is normally not for loan.
[% ELSIF ( item_notforloan ) %]
[% item_notforloan_lib = KohaAuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
Item is normally not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib %])[% END %].
[% END %]
Check out anyway?
</li>
[% END %]
[% IF ( USERBLOCKEDOVERDUE ) %]
@ -454,7 +463,14 @@ function validate1(date) {
[% END %]
[% IF ( NOT_FOR_LOAN ) %]
<li>Item not for loan</li>
<li>
[% IF ( itemtype_notforloan ) %]
Item type not for loan.
[% ELSIF ( item_notforloan ) %]
[% item_notforloan_lib = KohaAuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %]
Item not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib %])[% END %].
[% END %]
</li>
[% END %]
[% IF ( WTHDRAWN ) %]