@@ -, +, @@
includes
---
.../intranet-tmpl/prog/en/includes/item-status.inc | 14 +++++++++-----
.../bootstrap/en/includes/item-status.inc | 10 +++++++---
2 files changed, 16 insertions(+), 8 deletions(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc
+++ a/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 %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc
+++ a/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 %]
--