[Koha-bugs] [Bug 15206] Show patron's age when filling date of birth in memberentry.pl

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Nov 25 08:44:32 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15206

Frédéric Demians <frederic at tamil.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |frederic at tamil.fr

--- Comment #6 from Frédéric Demians <frederic at tamil.fr> ---
Code review:

You have:

    function CalculateAge(dateofbirth) {

Then, you don't use "dateofbirth".

You have:

  <input type="text" id="dateofbirth" name="dateofbirth" size="20"
   onchange="CalculateAge(document.form.dateofbirth);"
   value="[% UNLESS opduplicate %][% dateofbirth %][% END %]" />

You rather should use jQuery:

  $( "#dateofbirth" ).change(CalculateAge);

>From an UI point of view, it seems awkward to have displayed firstly
"DD/MM/YYYY" under the Date of birth text box, and then having this info
replaced by the age. This way, it's not possible to see the age without
modifying the date of birth. Wouldn't it be better/simpler to display the age
on the detail page (moremember.pl), rather than on the editing page
(memberentry.pl)?

Have you seen that there is already a Perl function calculating age in Koha?
C4::Members::GetAge(). There is a risk that your javascript code and Perl
GetAge() produce a different age.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list