From bc008ee0619f25c5d0635eab329fa0605381a43a Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 10 Sep 2021 09:27:30 +0000 Subject: [PATCH] Bug 28762: (QA follow-up) A first attempt to sync the includes Content-Type: text/plain; charset=utf-8 This is just a start. Should we resolve all differences? --- .../intranet-tmpl/prog/en/includes/item-status.inc | 14 +++++++++----- .../bootstrap/en/includes/item-status.inc | 10 +++++++--- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc index ba7e9b9737..59e0e2087f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc @@ -1,3 +1,5 @@ +[%# Lets keep this include in sync between OPAC and staff: make your changes in that perspective at both sides please ! %] + [% USE Branches %] [% USE AuthorisedValues %] [% SET itemavailable = 1 %] @@ -7,9 +9,11 @@ [%#- structure is used by course reserves pages, which do -%] [%#- not use an API to fetch items that populates item.datedue. -%] +[% SET opac = staff ? 0 : 1 %] + [% IF ( item.itemlost ) %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %] + [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost, 'opac' => opac ) %] [% IF ( av_lib_include ) %] [% av_lib_include | html %] [% ELSE %] @@ -54,7 +58,7 @@ [% IF ( item.withdrawn ) %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %] + [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, 'opac' => opac ) %] [% IF av_lib_include %] [% av_lib_include | html %] [% ELSE %] @@ -62,9 +66,9 @@ [% END %] [% END %] -[% IF ( item.notforloan ) %] +[% IF ( NOT ( item.isa('Koha::Item') ) AND item.itemnotforloan ) OR item.notforloan %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %] + [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan, 'opac' => opac ) %] [% IF av_lib_include %] [% av_lib_include | html %] [% ELSE %] @@ -74,7 +78,7 @@ [% IF ( item.damaged ) %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) %] + [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged, 'opac' => opac ) %] [% IF av_lib_include %] [% av_lib_include | html %] [% ELSE %] 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 cd04f9f4a5..88c6e37477 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -1,3 +1,5 @@ +[%# Lets keep this include in sync between OPAC and staff: make your changes in that perspective at both sides please ! %] + [% USE Branches %] [% USE AuthorisedValues %] [% SET itemavailable = 1 %] @@ -7,9 +9,11 @@ [%#- structure is used by course reserves pages, which do -%] [%#- not use an API to fetch items that populates item.datedue. -%] +[% SET opac = staff ? 0 : 1 %] + [% IF ( item.itemlost ) %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost, opac => 1 ) %] + [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost, 'opac' => opac ) %] [% IF ( av_lib_include ) %] [% av_lib_include | html %] [% ELSE %] @@ -54,7 +58,7 @@ [% IF ( item.withdrawn ) %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, opac => 1 ) %] + [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn, 'opac' => opac ) %] [% IF av_lib_include %] [% av_lib_include | html %] [% ELSE %] @@ -77,7 +81,7 @@ [% IF ( item.damaged ) %] [% SET itemavailable = 0 %] - [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged, opac => 1 ) %] + [% av_lib_include = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged, 'opac' => opac ) %] [% IF av_lib_include %] [% av_lib_include | html %] [% ELSE %] -- 2.20.1