From 12dd65fda95fbf40f2d58c0a79197b1435b50430 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 6 Mar 2018 12:26:19 +0100 Subject: [PATCH] Bug 20341: Show authorized value description for withdrawn like damaged and lost Actually catalog detail page shows for damaged and lost items the authorized value description if exists. We must do the same for withdrawn information. Test plan : 1) Set for items a subfield linked to items.withdrawn and using the authorized value category 'WITHDRAWN' 2) Edit the authorized value category to add value '2' and description 'Eaten by dog' 3) Edit an item to set this withdrawn value 4) Go to staff interface and look at items in record detail page /cgi-bin/koh/catalogue/detail.pl : => Without patch you see 'Withdrawn' and with patch you see 'Eaten by dog' 5) Go to OPAc and look at items in record detail page /cgi-bin/koha/opac-detail.pl : => Without patch you see 'Withdrawn' and with patch you see 'Eaten by dog' Signed-off-by: delaye Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens (cherry picked from commit 830ce35795f7bbd68d6b68c4795cb36f27fe2b6d) Signed-off-by: Fridolin Somers --- catalogue/detail.pl | 4 ++++ .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 10 +++++++++- .../opac-tmpl/bootstrap/en/includes/item-status.inc | 7 ++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 865da68cae..495d2174cb 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -211,6 +211,10 @@ $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => if ( $mss->count ) { $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) ); } +$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => { not => undef } }); +if ( $mss->count ) { + $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) ); +} $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials', authorised_value => { not => undef } }); my %materials_map; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 33027172bc..8598951819 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -719,7 +719,15 @@ function verify_images() { [% END %] [% IF ( item.withdrawn ) %] - Withdrawn + [% IF itemwithdrawnloop %] + [% FOREACH itemwithdrawnloo IN itemwithdrawnloop %] + [% IF itemwithdrawnloo.authorised_value == item.withdrawn %] + [% itemwithdrawnloo.lib %] + [% END %] + [% END %] + [% ELSE %] + Withdrawn + [% END %] [% END %] [% IF ( item.damaged ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index f078463fb4..cb761f197b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -46,7 +46,12 @@ [% IF ( item.withdrawn ) %] [% SET itemavailable = 0 %] - Item withdrawn + [% av_lib_include = AuthorisedValues.GetByCode( 'WITHDRAWN', item.withdrawn, 1 ) %] + [% IF av_lib_include %] + [% av_lib_include %] + [% ELSE %] + Item withdrawn + [% END %] [% END %] [% IF ( item.itemnotforloan ) %] -- 2.39.5