Bug 14925: Remove C4::Dates from members/moremember.pl
authorMarc Véron <veron@veron.ch>
Tue, 29 Sep 2015 16:14:30 +0000 (18:14 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 9 Oct 2015 12:42:11 +0000 (09:42 -0300)
This patch removes C4::Dates from members/moremember.pl

To test:
- Go to Details page of several members
- Verify that all dates display OK, including restrictions

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised. All dates displayed OK

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
members/moremember.pl

index 309efe6..d7932de 100755 (executable)
@@ -42,7 +42,6 @@ use C4::Output;
 use C4::Members;
 use C4::Members::Attributes;
 use C4::Members::AttributeTypes;
-use C4::Dates;
 use C4::Reserves;
 use C4::Circulation;
 use C4::Koha;
@@ -136,7 +135,7 @@ foreach (qw(dateenrolled dateexpiry dateofbirth)) {
                        $data->{$_} = '';
                        next;
                }
-               $userdate = C4::Dates->new($userdate,'iso')->output('syspref');
+                $userdate =  output_pref({ dt => dt_from_string( $userdate ), dateonly => 1 });
                $data->{$_} = $userdate || '';
                $template->param( $_ => $userdate );
 }
@@ -150,7 +149,7 @@ if ( IsDebarred($borrowernumber) ) {
     $template->param( 'userdebarred' => 1, 'flagged' => 1 );
     my $debar = $data->{'debarred'};
     if ( $debar ne "9999-12-31" ) {
-        $template->param( 'userdebarreddate' => C4::Dates::format_date($debar) );
+        $template->param( 'userdebarreddate' => output_pref( { dt => dt_from_string( $debar ), dateonly => 1 } ) );
         $template->param( 'debarredcomment'  => $data->{debarredcomment} );
     }
 }
@@ -344,7 +343,7 @@ $template->param(
     categoryname    => $data->{'description'},
     was_renewed     => $input->param('was_renewed') ? 1 : 0,
     branch          => $branch,
-    todaysdate      => C4::Dates->today(),
+    todaysdate      =>  output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
     totalprice      => sprintf("%.2f", $totalprice),
     totaldue        => sprintf("%.2f", $total),
     totaldue_raw    => $total,