From 6506ddd1e859c3afbb9519d6a956495c06d628ce 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=utf8 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 Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/members/moremember-brief.tt | 9 +++++---- .../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 6196df037f..34367d89e3 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 96f51aa2e5..97e547d7a8 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 f0b583f896..688215b8c6 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' ); -- 2.39.5