Bug 7737: applies date filters on vendor pages
authorAdrien Saurat <adrien.saurat@biblibre.com>
Thu, 22 Mar 2012 09:20:14 +0000 (10:20 +0100)
committerPaul Poulain <paul.poulain@biblibre.com>
Thu, 22 Mar 2012 16:18:03 +0000 (17:18 +0100)
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
acqui/booksellers.pl
acqui/supplier.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tt

index 025fbd1..5a1c248 100755 (executable)
@@ -56,7 +56,6 @@ use C4::Biblio;
 use C4::Output;
 use CGI;
 
-use C4::Dates qw/format_date/;
 use C4::Acquisition qw/ GetBasketsInfosByBookseller /;
 use C4::Bookseller qw/ GetBookSellerFromId GetBookSeller /;
 use C4::Members qw/GetMember/;
@@ -126,11 +125,6 @@ for my $vendor (@suppliers) {
                    ) 
                 ) 
            ) { 
-            for my $date_field (qw( creationdate closedate)) {
-                if ( $basket->{$date_field} ) {
-                    $basket->{$date_field} = format_date( $basket->{$date_field} );
-                }
-            }
             foreach (qw(total_items total_biblios expected_items)) {
                 $basket->{$_} ||= 0;
             }
index fdeef06..6746d8d 100755 (executable)
@@ -46,7 +46,6 @@ use C4::Auth;
 use C4::Contract qw/GetContract/;
 use C4::Biblio;
 use C4::Output;
-use C4::Dates qw/format_date /;
 use CGI;
 
 use C4::Bookseller qw( GetBookSellerFromId DelBookseller );
@@ -79,11 +78,6 @@ if ( $op eq 'display' ) {
 
     my $contracts = GetContract( { booksellerid => $booksellerid } );
 
-    for ( @{$contracts} ) {
-        $_->{contractstartdate} = format_date( $_->{contractstartdate} );
-        $_->{contractenddate}   = format_date( $_->{contractenddate} );
-    }
-
     $template->param(
         booksellerid  => $booksellerid,
         name          => $supplier->{'name'},
index 0e6aaa3..b17bc54 100644 (file)
@@ -1,3 +1,4 @@
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Search for vendor [% supplier %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -110,10 +111,10 @@ $(document).ready(function() {
                                             [% basket.authorisedby_firstname %]
                                             [% basket.authorisedby_surname %]
                                         </td>
-                                        <td>[% basket.creationdate %]</td>
+                                        <td>[% basket.creationdate | $KohaDates %]</td>
                                         <td>
                                             [% IF ( basket.closedate ) %]
-                                                closed on [% basket.closedate %]
+                                                closed on [% basket.closedate | $KohaDates %]
                                                 <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
                                             [% ELSE %]
                                                 [% IF ( basket.active ) %]
index 05b7fac..7260f55 100644 (file)
@@ -1,3 +1,4 @@
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Vendor [% bookselname %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -217,8 +218,8 @@ if (f.company.value == "") {
                             <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% contract.contractnumber %]&amp;booksellerid=[% contract.booksellerid %]">[% contract.contractname %]</a>
                         </td>
                         <td>[% contract.contractdescription %]</td>
-                        <td>[% contract.contractstartdate %]</td>
-                        <td>[% contract.contractenddate %]</td>
+                        <td>[% contract.contractstartdate | $KohaDates %]</td>
+                        <td>[% contract.contractenddate | $KohaDates %]</td>
                         <td><a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% contract.contractnumber %]&amp;booksellerid=[% contract.booksellerid %]">Edit</a></td>
                         <td><a href="/cgi-bin/koha/admin/aqcontract.pl?op=delete_confirm&amp;contractnumber=[% contract.contractnumber %]&amp;booksellerid=[% contract.booksellerid %]">Delete</a></td>
                         </tr>