From 31c15ed3ccd74b34070dd560db7302e317e0b474 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 Jan 2023 11:29:34 +0100 Subject: [PATCH] Bug 32445: Fix notforloan display Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- .../bootstrap/en/includes/item-status.inc | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) 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 fc457e816b..601cd8984e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -9,9 +9,9 @@ [% IF ( item.itemlost ) %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost, opac => 1 ) %] - [% IF ( av_lib_include ) %] - [% av_lib_include | html %] + [% itemlost_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost, opac => 1 ) %] + [% IF itemlost_lib %] + [% itemlost_lib | html %] [% ELSE %] Item lost [% END %] @@ -71,25 +71,27 @@ [% IF ( item.withdrawn ) %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %] - [% IF av_lib_include %] - [% av_lib_include | html %] + [% withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %] + [% IF withdrawn_lib %] + [% withdrawn_lib | html %] [% ELSE %] Item withdrawn [% END %] [% END %] -[% IF NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan %] +[% SET restricted_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %] +[% IF item.notforloan %] [% SET itemavailable = 0 %] - [% IF ( item.notforloanvalueopac ) %] - [% item.notforloanvalueopac | html %] [% IF ( item.restrictedvalueopac ) %]([% item.restrictedvalueopac | html %])[% END %] + [% notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %] + [% IF notforloan_lib %] + [% notforloan_lib | html %] [% IF restricted_lib %]([% restricted_lib | html %])[% END %] [% ELSE %] - Not for loan [% IF ( item.restrictedvalueopac ) %]([% item.restrictedvalueopac | html %])[% END %] + Not for loan [% IF restricted_lib %]([% restricted_lib | html %])[% END %] [% END %] -[% ELSIF NOT ( item.isa('Koha::Item') ) AND item.notforloan_per_itemtype %] +[% ELSIF item.itemtype.notforloan %] [% SET itemavailable = 0 %] - Not for loan [% IF ( item.restrictedvalueopac ) %]([% item.restrictedvalueopac | html %])[% END %] + Not for loan [% IF restricted_lib %]([% restricted_lib | html %])[% END %] [% END %] [% IF ( item.bundle_host ) %] @@ -122,6 +124,5 @@ [% END %] [% IF ( itemavailable ) %] - [% IF NOT item.isa('Koha::Item') %][% SET restrictedvalueopac = item.restrictedvalueopac %][% END %] - Available [% IF restrictedvalueopac %]([% restrictedvalueopac | html %])[% END %] + Available [% IF restricted_lib %]([% restricted_lib | html %])[% END %] [% END %] -- 2.39.5