From fe73ad1b93082dc3df3bcf760b4490b2e445cfbe Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 25 Jul 2012 16:20:30 +0200 Subject: [PATCH 1/1] Bug 4173: Followup: put the lib into a variable Prevent 2 calls instead of 1 --- .../opac-tmpl/prog/en/includes/item-status.inc | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc index c456675..51c2e9f 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc @@ -14,8 +14,9 @@ [% ELSIF ( item.wthdrawn ) %] Item withdrawn [% ELSIF ( item.itemlost ) %] - [% IF KohaAuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %] - [% KohaAuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %] + [% av_lib_include = KohaAuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %] + [% IF ( av_lib_include ) %] + [% av_lib_include %] [% ELSE %] [% IF ( item.lostimageurl ) %] [% item.lostimagelabel %] @@ -32,8 +33,9 @@ [% ELSIF ( item.notforloan_per_itemtype ) %] Not for loan [% IF ( item.restrictedopac ) %]([% item.restrictedopac %])[% END %] [% ELSIF ( item.damaged ) %] - [% IF KohaAuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %] - [% KohaAuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %] + [% av_lib_include = KohaAuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %] + [% IF av_lib_include %] + [% av_lib_include %] [% ELSE %] Item damaged [% END %] -- 1.7.7.3