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 // '',
// Display card number in parentheses if it exists
cardnumber = " (" + item.cardnumber + ") ";
}
+ var itemString = "<a href=\"" + item.link + "\">" + item.surname + ", " + item.firstname + cardnumber + " <small>";
+ if( item.dateofbirth ) {
+ itemString += item.dateofbirth + " (" + item.age + " " + _("years") + "), ";
+ }
+ itemString += item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>";
return $( "<li></li>" )
.data( "ui-autocomplete-item", item )
- .append( "<a href=\"" + item.link + "\">" + item.surname + ", " + item.firstname + cardnumber + " <small>" + item.dateofbirth + " (" + item.age + ") " + item.address + " " + item.city + " " + item.zipcode + " " + item.country + "</small></a>" )
+ .append( itemString )
.appendTo( ul );
};
}
[%- 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 -%]