From 070c327c98ee49a882638be7a5d667b3ec6d4347 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 19 Mar 2018 15:40:09 -0300 Subject: [PATCH] Revert "Bug 20341: Use AuthorisedValues plugin on the staff side" This reverts commit a67fdf3bd498bf1c5a90c2847570ea8eff9c52da. I am not sure we already agreed on that: the UI let the ability to choose different AV category for each frameworks. I think it should be discussed widely before removing this possibility. Even if I am pretty sure it is not handle correctly everywhere. Signed-off-by: Jonathan Druart --- catalogue/detail.pl | 15 ++++++++++- .../prog/en/modules/catalogue/detail.tt | 27 ++++++++++++------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 1d61967ef0..f2e8fae5d0 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -203,7 +203,20 @@ my $copynumbers = my (@itemloop, @otheritemloop, %itemfields); my $norequests = 1; -my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials', authorised_value => { not => undef } }); +my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => { not => undef } }); +if ( $mss->count ) { + $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) ); +} +$mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => { not => undef } }); +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; if ($mss->count) { my $materials_authvals = GetAuthorisedValues($mss->next->authorised_value); 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 635781b25b..d3b12b455f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -393,28 +393,37 @@ In transit from [% Branches.GetName( item.transfertfrom ) %] to [% Branches.GetName( item.transfertto ) %] since [% item.transfertwhen | $KohaDates %] [% END %] - [% itemlost_desc = AuthorisedValues.GetByCode( 'LOST', item.itemlost ) %] [% IF ( item.itemlost ) %] - [% IF itemlost_desc %] - [% itemlost_desc %] + [% IF itemlostloop %] + [% FOREACH itemlostloo IN itemlostloop %] + [% IF itemlostloo.authorised_value == item.itemlost %] + [% itemlostloo.lib %] + [% END %] + [% END %] [% ELSE %] Unavailable (lost or missing) [% END %] [% END %] - [% withdrawn_desc = AuthorisedValues.GetByCode( 'WITHDRAWN', item.withdrawn ) %] [% IF ( item.withdrawn ) %] - [% IF withdrawn_desc %] - [% withdrawn_desc %] + [% IF itemwithdrawnloop %] + [% FOREACH itemwithdrawnloo IN itemwithdrawnloop %] + [% IF itemwithdrawnloo.authorised_value == item.withdrawn %] + [% itemwithdrawnloo.lib %] + [% END %] + [% END %] [% ELSE %] Withdrawn [% END %] [% END %] - [% damaged_desc = AuthorisedValues.GetByCode( 'DAMAGED', item.damaged ) %] [% IF ( item.damaged ) %] - [% IF damaged_desc %] - [% damaged_desc %] + [% IF itemdamagedloop %] + [% FOREACH itemdamagedloo IN itemdamagedloop %] + [% IF itemdamagedloo.authorised_value == item.damaged %] + [% itemdamagedloo.lib %] + [% END %] + [% END %] [% ELSE %] Damaged [% END %] -- 2.39.2