Bugzilla – Attachment 14695 Details for
Bug 9423
Add notforloan value to issue confirmation or blocking message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-Bug-9423-Add-notforloan-value-to-issue-confirmation-.patch (text/plain), 5.10 KB, created by
Fridolin Somers
on 2013-01-18 13:35:28 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-01-18 13:35:28 UTC
Size:
5.10 KB
patch
obsolete
>From d78312c3445ef46dd537eaf48266c2d9a41ca7f5 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Fri, 18 Jan 2013 14:32:06 +0100 >Subject: [PATCH] Bug 9423: Add notforloan value to issue confirmation or > blocking message > >When trying to checkout an item that is not for loan (due to items.notforloan value or because itemtype is not for loan), you get a confirmation or blocking message (depending on AllowNotForLoanOverride syspref). >This message tells "Item is normally not for loan". > >This patch adds some informations : >if itemtype is not for loan, tells "Item type is normally not for loan". >if item is not for loan due to items.notforloan value, adds notforloan description to message. >--- > C4/Circulation.pm | 12 +++++++++++- > circ/circulation.pl | 6 ++++++ > .../prog/en/modules/circ/circulation.tt | 20 ++++++++++++++++++-- > 3 files changed, 35 insertions(+), 3 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 71fe20f..e0ed7cc 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -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; > >@@ -833,8 +837,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'}; > } > } > elsif ( !$item->{'notforloan'} ){ >@@ -848,16 +854,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'}; > } > } > } >diff --git a/circ/circulation.pl b/circ/circulation.pl >index fe9ae60..d0275bf 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -287,6 +287,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( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 9c045cd..53b214c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1,4 +1,5 @@ > [% USE KohaDates %] >+[% USE KohaAuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] > [% SET destination = "circ" %] > <title>Koha › Circulation >@@ -359,7 +360,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 ) %] >@@ -463,7 +472,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 ) %] >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9423
:
14695
|
14696
|
16359