From 8a0a8cf44cd6e18374ddae49ac4a884e4e248478 Mon Sep 17 00:00:00 2001 From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Date: Fri, 9 Oct 2015 09:14:33 +0100 Subject: [PATCH] [PASSED QA] Bug 14990: Format the date template-side for moremember MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test plan: print slip and show the member detail page, the 3 dates date of birth, date enrolled and date of expiry should be displayed correctly. Followed test pan, works as expected. Signed-off-by: Marc VĂ©ron <veron@veron.ch> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> --- .../intranet-tmpl/prog/en/modules/members/moremember-brief.tt | 9 +++++---- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 10 +++++----- members/moremember.pl | 4 +--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt index 6196df0..34367d8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt @@ -1,3 +1,4 @@ +[% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] <title>Koha › Check duplicate patron</title> [% INCLUDE 'doc-head-close.inc' %] @@ -47,7 +48,7 @@ [% IF ( emailpro ) %]<li><span class="label">Secondary email: </span><a href="mailto:[% emailpro %]">[% emailpro %]</a></li>[% END %] [% END %] <li><span class="label">Initials: </span>[% initials %]</li> - <li><span class="label">Date of birth:</span>[% dateofbirth %]</li> + <li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %]</li> <li><span class="label">Gender:</span>[% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %]</li>[% END %] [% IF ( isguarantee ) %] [% IF ( guaranteeloop ) %] @@ -70,12 +71,12 @@ <li><span class="label">Card number: </span>[% cardnumber %]</li> <li><span class="label">Borrowernumber: </span> [% borrowernumber %]</li> <li><span class="label">Category: </span>[% description %] ([% categorycode %])</li> - <li><span class="label">Registration date: </span>[% dateenrolled %]</li> + <li><span class="label">Registration date: </span>[% dateenrolled | $KohaDates %]</li> <li><span class="label">Expiration date: </span> [% IF ( was_renewed ) %] - <strong class="reregistrinfo">[% dateexpiry %]</strong> + <strong class="reregistrinfo">[% dateexpiry | $KohaDates %]</strong> [% ELSE %] - [% dateexpiry %] + [% dateexpiry | $KohaDates %] [% END %] </li> <li><span class="label">Library: </span>[% branchname %]</li> 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 96f51aa..97e547d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -166,7 +166,7 @@ function validate1(date) { [% IF ( unknowuser ) %] <div class="dialog message">This patron does not exist.</div> [% ELSE %] - [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry %]</div>[% END %] + [% IF ( was_renewed ) %]<div class="dialog message">Patron's account has been renewed until [% dateexpiry | $KohaDates %]</div>[% END %] [% IF ( flagged ) %] <div id="circmessages" class="circmessage attention"> @@ -225,7 +225,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 %]</li>[% END %] + [% IF ( dateofbirth ) %]<li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %]</li>[% END %] [% IF ( sex ) %]<li><span class="label">Gender:</span> [% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %] </li>[% END %][% END %] @@ -337,13 +337,13 @@ function validate1(date) { <li><span class="label">Card number: </span>[% cardnumber %]</li> <li><span class="label">Borrowernumber: </span> [% borrowernumber %]</li> <li><span class="label">Category: </span>[% description %] ([% categorycode %])</li> - <li><span class="label">Registration date: </span>[% dateenrolled %]</li> + <li><span class="label">Registration date: </span>[% dateenrolled | $KohaDates %]</li> <li><span class="label">Expiration date: </span> [% IF ( was_renewed ) %] - <strong class="reregistrinfo">[% dateexpiry %]</strong> + <strong class="reregistrinfo">[% dateexpiry | $KohaDates %]</strong> [% ELSE %] - [% dateexpiry %] + [% dateexpiry | $KohaDates %] [% END %] </li> diff --git a/members/moremember.pl b/members/moremember.pl index f0b583f..688215b 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -135,9 +135,7 @@ foreach (qw(dateenrolled dateexpiry dateofbirth)) { $data->{$_} = ''; next; } - $userdate = output_pref({ dt => dt_from_string( $userdate ), dateonly => 1 }); - $data->{$_} = $userdate || ''; - $template->param( $_ => $userdate ); + $template->param( $_ => dt_from_string( $userdate ) ); } $data->{'IS_ADULT'} = ( $data->{'categorycode'} ne 'I' ); -- 1.9.1