Bugzilla – Attachment 45593 Details for
Bug 15206
Show patron's age when filling date of birth in memberentry.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15206 - Make string translatable and fix months calculation
Bug-15206---Make-string-translatable-and-fix-month.patch (text/plain), 2.45 KB, created by
Alex Arnaud
on 2015-12-11 10:03:15 UTC
(
hide
)
Description:
Bug 15206 - Make string translatable and fix months calculation
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2015-12-11 10:03:15 UTC
Size:
2.45 KB
patch
obsolete
>From 38586be09f95da0c9ca046da6a2edcd28a52b2cc Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Fri, 11 Dec 2015 10:59:18 +0100 >Subject: [PATCH] Bug 15206 - Make string translatable and fix months > calculation > >--- > .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 8 ++++---- > members/moremember.pl | 5 +++-- > 2 files changed, 7 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 6ca7570..4b5e2a3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -154,7 +154,7 @@ > var dob = new Date($("#dateofbirth").datepicker( 'getDate' )); > > var year = dob.getFullYear(); >- var month = dob.getMonth(); >+ var month = dob.getMonth() + 1; > var day = dob.getDate(); > > $.ajax({ >@@ -163,9 +163,9 @@ > data: 'dateofbirth=' + year + '-' + month + '-' + day, > dataType: 'json', > success : function(json, statut){ >- var age_string = "Age: "; >- if (json.years) { age_string += json.years + " year(s) "; } >- if (json.months) { age_string += json.months + " month(s) "; } >+ var age_string = _('Age: '); >+ if (json.years) { age_string += json.years + _(' year(s) '); } >+ if (json.months) { age_string += json.months + _(' month(s)'); } > var elem = $("#dateofbirth").siblings(".hint").first().html(age_string); > }, > }); >diff --git a/members/moremember.pl b/members/moremember.pl >index 9066993..7b43097 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -61,6 +61,7 @@ if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preferen > use DateTime; > use Koha::DateUtils; > use Koha::Database; >+use Koha::I18N; > > use vars qw($debug); > >@@ -141,8 +142,8 @@ $data->{'IS_ADULT'} = ( $data->{'categorycode'} ne 'I' ); > > my @age; > my ($years, $months) = GetAge($data->{dateofbirth}); >-push @age, "$years year(s)" if $years; >-push @age, "$months month(s)" if $months; >+push @age, $years . gettext(' year(s)') if $years; >+push @age, $months . gettext(' month(s)') if $months; > $template->param( age => join(', ', @age) ); > > for (qw(gonenoaddress lost borrowernotes)) { >-- >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 15206
:
44953
|
44978
|
45579
|
45580
|
45581
|
45589
|
45590
|
45591
|
45592
|
45593
|
45597
|
45598
|
45599
|
45600
|
45601
|
46228
|
46245
|
46396
|
47301
|
47505
|
47506
|
47540
|
47541
|
47542
|
49032
|
49033
|
49034