[Koha-patches] [PATCH] Bug 7744: use of TT date filters on basket pages

Adrien Saurat adrien.saurat at biblibre.com
Mon Mar 19 16:03:15 CET 2012


TT date filters added on basket.pl and neworderempty.pl
---
 acqui/basket.pl                                    |   10 ++++------
 acqui/neworderempty.pl                             |    5 ++---
 .../intranet-tmpl/prog/en/modules/acqui/basket.tt  |    5 +++--
 .../prog/en/modules/acqui/neworderempty.tt         |    5 +++--
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/acqui/basket.pl b/acqui/basket.pl
index 7864fee..4386125 100755
--- a/acqui/basket.pl
+++ b/acqui/basket.pl
@@ -29,7 +29,6 @@ use CGI;
 use C4::Acquisition;
 use C4::Budgets;
 use C4::Bookseller qw( GetBookSellerFromId);
-use C4::Dates qw/format_date/;
 use C4::Debug;
 use C4::Biblio;
 use C4::Members qw/GetMember/;  #needed for permissions checking for changing basketgroup of a basket
@@ -126,10 +125,10 @@ if ( $op eq 'delete_confirm' ) {
         basketbooksellernote => $basket->{booksellernote},
         basketcontractno     => $basket->{contractnumber},
         basketcontractname   => $contract->{contractname},
-        creationdate         => format_date( $basket->{creationdate} ),
+        creationdate         => $basket->{creationdate},
         authorisedby         => $basket->{authorisedby},
         authorisedbyname     => $basket->{authorisedbyname},
-        closedate            => format_date( $basket->{closedate} ),
+        closedate            => $basket->{closedate},
         active               => $bookseller->{'active'},
         booksellerid         => $bookseller->{'id'},
         name                 => $bookseller->{'name'},
@@ -364,14 +363,13 @@ my $total_est_gste;
         basketbooksellernote => $basket->{booksellernote},
         basketcontractno     => $basket->{contractnumber},
         basketcontractname   => $contract->{contractname},
-        creationdate         => C4::Dates->new($basket->{creationdate},'iso')->output,
+        creationdate         => $basket->{creationdate},
         authorisedby         => $basket->{authorisedby},
         authorisedbyname     => $basket->{authorisedbyname},
-        closedate            => C4::Dates->new($basket->{closedate},'iso')->output,
+        closedate            => $basket->{closedate},
         active               => $bookseller->{'active'},
         booksellerid         => $bookseller->{'id'},
         name                 => $bookseller->{'name'},
-        entrydate            => C4::Dates->new($results[0]->{'entrydate'},'iso')->output,
         books_loop           => \@books_loop,
         cancelledorders_loop => \@cancelledorders,
         gist_rate            => sprintf( "%.2f", $gist * 100 ) . '%',
diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl
index 7fee382..b3468e8 100755
--- a/acqui/neworderempty.pl
+++ b/acqui/neworderempty.pl
@@ -75,7 +75,6 @@ use C4::Input;
 use C4::Auth;
 use C4::Budgets;
 use C4::Input;
-use C4::Dates;
 
 use C4::Bookseller  qw/ GetBookSellerFromId /;
 use C4::Acquisition;
@@ -340,10 +339,10 @@ $template->param(
     basketbooksellernote => $basket->{booksellernote},
     basketcontractno     => $basket->{contractnumber},
     basketcontractname   => $contract->{contractname},
-    creationdate         => C4::Dates->new($basket->{creationdate},'iso')->output,
+    creationdate         => $basket->{creationdate},
     authorisedby         => $basket->{'authorisedby'},
     authorisedbyname     => $basket->{'authorisedbyname'},
-    closedate            => C4::Dates->new($basket->{'closedate'},'iso')->output,
+    closedate            => $basket->{'closedate'},
     # order details
     suggestionid         => $suggestion->{suggestionid},
     surnamesuggestedby   => $suggestion->{surnamesuggestedby},
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
index 88578b2..90e583a 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
@@ -1,3 +1,4 @@
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; [% UNLESS ( basketno ) %]New [% END %][% IF ( delete_confirm ) %]Delete [% END %]Basket [% basketname|html %] ([% basketno %]) for [% name|html %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -178,8 +179,8 @@
                     <li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]&amp;booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
                 [% END %]
                 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
-                [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate %]</li>[% END %]
-                [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate %]</li>[% END %]
+                [% IF ( creationdate ) %]<li><span class="label">Opened on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
+                [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
 
                 </ol>
                 </div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
index e6464f2..c68dde9 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
@@ -1,3 +1,4 @@
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; Basket [% basketno %] &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -180,10 +181,10 @@ $(document).ready(function()
             <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
         [% END %]
         [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
-        [% IF ( creationdate ) %]<li><span class="label">Open on:</span>  [% creationdate %]</li>[% END %]
+        [% IF ( creationdate ) %]<li><span class="label">Open on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
         [% IF ( closedate ) %]
         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
-        <li><span class="label">Closed on:</span>  [% closedate %]</li>
+        <li><span class="label">Closed on:</span>  [% closedate | $KohaDates %]</li>
         [% IF ( basketgroups ) %]
             <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
                 [% FOREACH basketgroup IN basketgroups %]
-- 
1.7.4.1



More information about the Koha-patches mailing list