From da51081465637bc894641e456df7ec288d680ba7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 9 Oct 2015 09:14:33 +0100 Subject: [PATCH] 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 --- .../prog/en/modules/members/moremember-brief.tt | 9 +++++---- .../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' %] Koha › Check duplicate patron [% INCLUDE 'doc-head-close.inc' %] @@ -47,7 +48,7 @@ [% IF ( emailpro ) %]
  • Secondary email: [% emailpro %]
  • [% END %] [% END %]
  • Initials: [% initials %]
  • -
  • Date of birth:[% dateofbirth %]
  • +
  • Date of birth:[% dateofbirth | $KohaDates %]
  • Gender:[% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %]
  • [% END %] [% IF ( isguarantee ) %] [% IF ( guaranteeloop ) %] @@ -70,12 +71,12 @@
  • Card number: [% cardnumber %]
  • Borrowernumber: [% borrowernumber %]
  • Category: [% description %] ([% categorycode %])
  • -
  • Registration date: [% dateenrolled %]
  • +
  • Registration date: [% dateenrolled | $KohaDates %]
  • Expiration date: [% IF ( was_renewed ) %] - [% dateexpiry %] + [% dateexpiry | $KohaDates %] [% ELSE %] - [% dateexpiry %] + [% dateexpiry | $KohaDates %] [% END %]
  • Library: [% branchname %]
  • 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 5a8c5a9..21e5d91 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 ) %]
    This patron does not exist.
    [% ELSE %] - [% IF ( was_renewed ) %]
    Patron's account has been renewed until [% dateexpiry %]
    [% END %] + [% IF ( was_renewed ) %]
    Patron's account has been renewed until [% dateexpiry | $KohaDates %]
    [% END %] [% IF ( flagged ) %]
    @@ -225,7 +225,7 @@ function validate1(date) { [% IF ( emailpro ) %]
  • Secondary email: [% emailpro %]
  • [% END %] [% END %] [% IF ( initials ) %]
  • Initials: [% initials %]
  • [% END %] - [% IF ( dateofbirth ) %]
  • Date of birth:[% dateofbirth %]
  • [% END %] + [% IF ( dateofbirth ) %]
  • Date of birth:[% dateofbirth | $KohaDates %]
  • [% END %] [% IF ( sex ) %]
  • Gender: [% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %]
  • [% END %][% END %] @@ -337,13 +337,13 @@ function validate1(date) {
  • Card number: [% cardnumber %]
  • Borrowernumber: [% borrowernumber %]
  • Category: [% description %] ([% categorycode %])
  • -
  • Registration date: [% dateenrolled %]
  • +
  • Registration date: [% dateenrolled | $KohaDates %]
  • Expiration date: [% IF ( was_renewed ) %] - [% dateexpiry %] + [% dateexpiry | $KohaDates %] [% ELSE %] - [% dateexpiry %] + [% dateexpiry | $KohaDates %] [% END %]
  • 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.7.10.4