Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc
Martin Renvoize 35b5e29988 Bug 27717: Display date of birth even if the patron is under 1
This patch moves the 'age' condition to below the date of birth display,
allowing the date to display for babies.

Test plan
1/ Add a user with a date of birth within the last year
2/ Check that the date of birth appears on the patron details page
(under contact details) with the patch applied.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-05 13:38:58 +01:00

12 lines
530 B
PHP

[%# 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 ) -%]
[%- SET age = (patron.get_age != undef) ? patron.get_age : patron.age -%]
[%- IF age >= 0 %]
[%- patron.dateofbirth | $KohaDates -%]
<span class='age_years'>[% I18N.tnx('({age} year)', '({age} years)', age, { age => age }) | html %]</span>
[%- END -%]
[%- END -%]
[%- END -%]