Bugzilla – Attachment 46645 Details for
Bug 14763
show patron's age
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14763: Calculate and display patron age
Bug-14763-Calculate-and-display-patron-age.patch (text/plain), 2.69 KB, created by
Marc Véron
on 2016-01-14 09:46:43 UTC
(
hide
)
Description:
Bug 14763: Calculate and display patron age
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-01-14 09:46:43 UTC
Size:
2.69 KB
patch
obsolete
>From d75dd07ea7835540330f8a05610011347d6620a9 Mon Sep 17 00:00:00 2001 >From: Aleisha <aleishaamohia@hotmail.com> >Date: Wed, 13 Jan 2016 23:36:21 +0000 >Subject: [PATCH] Bug 14763: Calculate and display patron age >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >To test: >1) Go to patron Details page (ie http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51) >2) Confirm that '(x years)' is showing next to the Date of Birth and is correct according to DOB (ie if DOB: 30/11/1996, Age: 19 years) >3) Edit date of birth to be a month later (ie from 30 November to 30 December) so that, as of the date you are testing, the patron has not had their birthday yet >4) Confirm that age changes to be one year younger >5) Edit date of birth to be a different year >6) Confirm that age changes accordingly > >Works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 2 +- > members/moremember.pl | 5 +++++ > 2 files changed, 6 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 57bd588..afae749 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -226,7 +226,7 @@ function validate1(date) { > [% IF ( emailpro ) %]<li><span class="label">Secondary email: </span><a href="mailto:[% emailpro %]">[% emailpro %]</a></li>[% END %] > [% END %] > [% IF ( initials ) %]<li><span class="label">Initials: </span>[% initials %]</li>[% END %] >- [% IF ( dateofbirth ) %]<li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %]</li>[% END %] >+ [% IF ( dateofbirth ) %]<li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %] ([% age %] years)</li>[% END %] > [% IF ( sex ) %]<li><span class="label">Gender:</span> > [% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %] > </li>[% END %][% END %] >diff --git a/members/moremember.pl b/members/moremember.pl >index 482f2a2..46c7d45 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -254,6 +254,11 @@ $today->truncate(to => 'day'); > my $overdues_exist = 0; > my $totalprice = 0; > >+# Calculate and display patron's age >+my $dateofbirth = $data->{ 'dateofbirth' }; >+my $age = GetAge($dateofbirth); >+$template->param( age => $age ); >+ > ### ############################################################################### > # BUILD HTML > # show all reserves of this borrower, and the position of the reservation .... >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14763
:
45790
|
46570
|
46626
|
46645
|
46647