Bug 5549 : Format due dates in opac
[koha.git] / opac / opac-detail.pl
index 6073d34..b45250d 100755 (executable)
@@ -47,6 +47,7 @@ use MARC::Record;
 use MARC::Field;
 use List::MoreUtils qw/any none/;
 use C4::Images;
+use Koha::DateUtils;
 
 BEGIN {
        if (C4::Context->preference('BakerTaylorEnabled')) {
@@ -75,6 +76,17 @@ if ( ! $record ) {
 }
 $template->param( biblionumber => $biblionumber );
 
+# get biblionumbers stored in the cart
+my @cart_list;
+
+if($query->cookie("bib_list")){
+    my $cart_list = $query->cookie("bib_list");
+    @cart_list = split(/\//, $cart_list);
+    if ( grep {$_ eq $biblionumber} @cart_list) {
+        $template->param( incart => 1 );
+    }
+}
+
 
 SetUTF8Flag($record);
 
@@ -483,7 +495,7 @@ for my $itm (@items) {
         # I can't actually find any case in which this is defined. --amoore 2008-12-09
         $itm->{ $itm->{'publictype'} } = 1;
     }
-    $itm->{datedue}      = format_date($itm->{datedue});
+    $itm->{datedue}      = format_sqlduedatetime($itm->{datedue});
     $itm->{datelastseen} = format_date($itm->{datelastseen});
 
     # get collection code description, too