From 09602496882c4202abd2de7b53d1f76ba36536f2 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 (cherry picked from commit 6506ddd1e859c3afbb9519d6a956495c06d628ce) Signed-off-by: Chris Cormack Conflicts: members/moremember.pl --- .../prog/en/modules/members/moremember-brief.tt | 9 +++++---- .../prog/en/modules/members/moremember.tt | 10 +++++----- members/moremember.pl | 16 +++++++--------- 3 files changed, 17 insertions(+), 18 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 b46424e71a..9713c4486b 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 ( printethnicityline ) %]
  • Ethnicity:[% ethnicity %]
  • @@ -74,12 +75,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 47ac879769..d3f0fa8453 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 %] @@ -341,13 +341,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 6a5adcccd6..2f2a18e608 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -130,15 +130,13 @@ my $category_type = $data->{'category_type'}; $debug and printf STDERR "dates (enrolled,expiry,birthdate) raw: (%s, %s, %s)\n", map {$data->{$_}} qw(dateenrolled dateexpiry dateofbirth); foreach (qw(dateenrolled dateexpiry dateofbirth)) { - my $userdate = $data->{$_}; - unless ($userdate) { - $debug and warn sprintf "Empty \$data{%12s}", $_; - $data->{$_} = ''; - next; - } - $userdate = C4::Dates->new($userdate,'iso')->output('syspref'); - $data->{$_} = $userdate || ''; - $template->param( $_ => $userdate ); + my $userdate = $data->{$_}; + unless ($userdate) { + $debug and warn sprintf "Empty \$data{%12s}", $_; + $data->{$_} = ''; + next; + } + $template->param( $_ => dt_from_string( $userdate ) ); } $data->{'IS_ADULT'} = ( $data->{'categorycode'} ne 'I' ); -- 2.39.5