From b6f79d5a697f6a2dc935c1a911e578d446664e54 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 19 Dec 2018 15:30:58 -0300 Subject: [PATCH] Bug 21877: Display authorized value description for withdrawn in checkout --- circ/circulation.pl | 6 ------ koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 8 ++++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 98b011bd11..a35741a7bf 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -350,12 +350,6 @@ if (@$barcodes) { my $item = Koha::Items->find({ barcode => $barcode }); my ( $biblio, $mss ); - 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 if ( $error->{'UNKNOWN_BARCODE'} 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 6700b0e581..951ec90070 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -341,14 +341,18 @@ [% 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 %] [% END %] [% IF ( WTHDRAWN ) %] -
  • Item has been withdrawn
  • +
  • + Item has been withdrawn + [% item_withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %] + [% IF (item_withdrawn_lib) %]([% item_withdrawn_lib | html %])[% END %] +
  • [% END %] [% IF ( RESTRICTED ) %] -- 2.11.0