From 30e5985aa1babc2f5c9ab2bc7c00e99c12a0d815 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Mon, 11 Mar 2019 14:25:46 +0000 Subject: [PATCH] Bug 15400: (follow-up) Restore 'years' string, remove untranslatable string Signed-off-by: Katrin Fischer Signed-off-by: Michal Denar Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- circ/ysearch.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc | 7 ++++++- koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc | 7 ++++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/circ/ysearch.pl b/circ/ysearch.pl index ee16d10b7e..c50f772599 100755 --- a/circ/ysearch.pl +++ b/circ/ysearch.pl @@ -85,7 +85,7 @@ while ( my $b = $borrowers_rs->next ) { firstname => $b->firstname // '', cardnumber => $b->cardnumber // '', dateofbirth => format_sqldatetime($b->dateofbirth, undef, undef, 1) // '', - age => $b->get_age // 'Age unknown', + age => $b->get_age // '', address => $b->address // '', city => $b->city // '', zipcode => $b->zipcode // '', diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index 7569a24efd..64bcdd547a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -106,9 +106,14 @@ // Display card number in parentheses if it exists cardnumber = " (" + item.cardnumber + ") "; } + var itemString = "" + item.surname + ", " + item.firstname + cardnumber + " "; + if( item.dateofbirth ) { + itemString += item.dateofbirth + " (" + item.age + " " + _("years") + "), "; + } + itemString += item.address + " " + item.city + " " + item.zipcode + " " + item.country + ""; return $( "
  • " ) .data( "ui-autocomplete-item", item ) - .append( "" + item.surname + ", " + item.firstname + cardnumber + " " + item.dateofbirth + " (" + item.age + ") " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "" ) + .append( itemString ) .appendTo( ul ); }; } 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 899ce163c3..4dc3c333f2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-age.inc @@ -1,8 +1,9 @@ [%- USE KohaDates -%] +[%- USE I18N -%] [%- IF ( patron ) -%] [%- IF ( patron.dateofbirth ) -%] - [% patron.dateofbirth | $KohaDates -%] - [%- IF ( patron.get_age ) %] ([% patron.get_age | html %]) - [%- ELSIF ( patron.age ) %] ([% patron.age | html %])[% END -%] + [%- patron.dateofbirth | $KohaDates %] + [%- SET age = (patron.get_age != undef) ? patron.get_age : patron.age -%] + [% I18N.tnx('({age} year)', '({age} years)', age, { age => age }) | html %] [%- END -%] [%- END -%] -- 2.39.5