Bug 14890: Remove C4::Dates from circ/bookcount.pl
authorMarc Véron <veron@veron.ch>
Wed, 23 Sep 2015 08:19:42 +0000 (10:19 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 8 Oct 2015 13:58:58 +0000 (10:58 -0300)
This patch removes deprecated C4::Dates from circ/bookcount.pl

To test:
- Search for biblio with an item that has been checked out several
  times and that has been transferred
- In left navigation click on 'Items'
- In list of items click on 'View item's checkout history'
- Verify that dates in 'Date arrived at current library' and in
  column 'Last seen' display properly.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
circ/bookcount.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt

index 6869c39..610fd5e 100755 (executable)
@@ -31,7 +31,7 @@ use C4::Koha;
 use C4::Auth;
 use C4::Branch; # GetBranches
 use C4::Biblio; # GetBiblioItemData
-use C4::Dates qw/format_date/;
+use Koha::DateUtils;
 
 my $input        = new CGI;
 my $itm          = $input->param('itm');
@@ -86,7 +86,7 @@ $template->param(
     biblioitemnumber        => $bi,
     homebranch              => $homebranch,
     holdingbranch           => $holdingbranch,
-    lastdate                => $lastdate ?  format_date($lastdate) : 0,
+    lastdate                => $lastdate ? $lastdate : 0,
     count                   => $count,
     branchloop              => $branchloop,
 );
@@ -177,7 +177,7 @@ sub slashdate {
     my ($date) = @_;
     $date or return;
     return (
-        format_date($date),
+        output_pref({ dt => dt_from_string( $date ), dateonly => 1 }),
         substr($date,11,5)
     );
 }
index 725ca4b..e83955f 100644 (file)
@@ -1,3 +1,4 @@
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Circulation &rsaquo; Circulation statistics for [% title |html %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -28,7 +29,7 @@ $(document).ready(function(){
                
                <tr><td>[% homebranch %]</td>
             <td>[% holdingbranch %]</td>
-            <td>[% IF ( lastdate ) %][% lastdate %][% ELSE %]Item has no transfer record[% END %]</td>
+            <td>[% IF ( lastdate ) %][% lastdate | $KohaDates %][% ELSE %]Item has no transfer record[% END %]</td>
             <td>[% count %]</td>
         </tr>
 </table>