Bugzilla – Attachment 84449 Details for
Bug 21877
Show authorized value description for withdrawn in checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21877: Use AuthorisedValues.GetDescriptionByKohaField for notforloan in checkout
Bug-21877-Use-AuthorisedValuesGetDescriptionByKoha.patch (text/plain), 3.64 KB, created by
Katrin Fischer
on 2019-01-26 13:31:44 UTC
(
hide
)
Description:
Bug 21877: Use AuthorisedValues.GetDescriptionByKohaField for notforloan in checkout
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-01-26 13:31:44 UTC
Size:
3.64 KB
patch
obsolete
>From 9e511e075c186c1a6953b4eca3d61923dc62175a Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 22 Jan 2019 09:45:02 +0100 >Subject: [PATCH] Bug 21877: Use AuthorisedValues.GetDescriptionByKohaField for > notforloan in checkout > >Using only TT plugin for authorised value description is a better code. > >Test plan : >Part 1: >1.1) On a catalog with items.notforloan defined with authorized values category NOT_LOAN >1.2) Define in NOT_LOAN an authorized values 1 with description 'at the beach' >1.3) Define in NOT_LOAN an authorized values 2 with description empty >Part 2: >2.1) Set preference 'AllowNotForLoanOverride' to 'Don't allow' >2.2) Edit an item with notforloan=1 >2.3) Checkout this item => You see 'Item not for loan (at the beach)' >2.4) Edit an item with notforloan=2 >2.5) Checkout this item => You see 'Item not for loan' >Part 3: >3.1) Set preference 'AllowNotForLoanOverride' to 'Allow' >3.2) Edit an item with notforloan=1 >3.3) Checkout this item => You see 'Item is normally not for loan (at the beach)' >3.4) Edit an item with notforloan=2 >3.5) Checkout this item => You see 'Item is normally not for loan' > >Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > circ/circulation.pl | 4 +--- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++-- > 2 files changed, 3 insertions(+), 5 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 6b8708ae06..cb18867c46 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -349,12 +349,10 @@ if (@$barcodes) { > $template_params->{messages} = $messages; > > my $item = Koha::Items->find({ barcode => $barcode }); >- my ( $biblio, $mss ); > >+ my $biblio; > if ( $item ) { > $biblio = $item->biblio; >- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] }); >- $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef; > } > > # Fix for bug 7494: optional checkout-time fallback search for a book >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 c71f127881..8c363133e0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -155,7 +155,7 @@ > [% IF ( itemtype_notforloan ) %] > Item type is normally not for loan. > [% ELSIF ( item_notforloan ) %] >- [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %] >+ [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %] > Item is normally not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib | html %])[% END %]. > [% END %] > [% IF CAN_user_circulate_force_checkout %] >@@ -341,7 +341,7 @@ > [% IF ( itemtype_notforloan ) %] > Item type not for loan. > [% ELSIF ( item_notforloan ) %] >- [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, item_notforloan, 0 ) %] >+ [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %] > Item not for loan [% IF (item_notforloan_lib) %]([% item_notforloan_lib | html %])[% END %]. > [% END %] > </li> >-- >2.11.0
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 21877
:
82616
|
82624
|
83400
|
84273
|
84274
|
84436
|
84437
|
84448
| 84449 |
121747