From ddd8d9cd3e3aa6661320f2c0a2f1f60d09ef3a8c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 4 Mar 2020 14:51:40 +0100 Subject: [PATCH] Bug 15400: Clarify usage of patron-age.inc Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc index adc14161fa..f55a54b0bd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc @@ -1,9 +1,12 @@ +[%# The variable patron must be passed, with either a Koha::Patron, or a HASHREF with the 'age' key -%] [%- USE KohaDates -%] [%- USE I18N -%] [%- IF ( patron ) -%] [%- IF ( patron.dateofbirth ) -%] - [%- patron.dateofbirth | $KohaDates %] [%- SET age = (patron.get_age != undef) ? patron.get_age : patron.age -%] - [% I18N.tnx('({age} year)', '({age} years)', age, { age => age }) | html %] + [%- IF age %] + [%- patron.dateofbirth | $KohaDates %] + [% I18N.tnx('({age} year)', '({age} years)', age, { age => age }) | html %] + [%- END -%] [%- END -%] [%- END -%] -- 2.11.0