Bug 13887: Display the due date as a due date + sort on info
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 22 Apr 2015 08:47:15 +0000 (10:47 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 4 May 2015 14:24:07 +0000 (11:24 -0300)
The due dates should be displayed as due dates :)
i.e not displayed with 23:59

On the way, this patch fixes the sort on the info column.
The column is now sorted using the due dates

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Circulation.pm
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
reserve/request.pl

index d3f8668..f991680 100644 (file)
@@ -2402,6 +2402,8 @@ sub GetItemIssue {
     $sth->execute($itemnumber);
     my $data = $sth->fetchrow_hashref;
     return unless $data;
+    $data->{issuedate_sql} = $data->{issuedate};
+    $data->{date_due_sql} = $data->{date_due};
     $data->{issuedate} = dt_from_string($data->{issuedate}, 'sql');
     $data->{issuedate}->truncate(to => 'minute');
     $data->{date_due} = dt_from_string($data->{date_due}, 'sql');
index f072fb9..80be359 100644 (file)
@@ -45,6 +45,9 @@ $(document).ready(function() {
     var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
         'bPaginate': false,
         "sDom": '<"top pager"ilf>t',
+        "aoColumnDefs": [
+            { "sType": "title-string", "aTargets" : [ "title-string" ] }
+        ]
     }));
 
     //Override fieldset styling for dataTables search box
@@ -456,7 +459,7 @@ function checkMultiHold() {
                 [% IF itemdata_enumchron %]
                     <th>Vol no.</th>
                 [% END %]
-                    <th>Information</th>
+                    <th class="title-string">Information</th>
                 </tr>
             </thead>
             <tbody>
@@ -504,14 +507,16 @@ function checkMultiHold() {
                     </td>
                 [% END %]
                     <td>
-               [% IF ( itemloo.onloan ) %]
-                    <span class="checkedout">Due [% itemloo.date_due %]</span>
+                [% IF ( itemloo.onloan ) %]
+                    <span title="[% itemloo.date_due %]" class="checkedout">Due [% itemloo.date_due | $KohaDates as_due_date => 1 %]</span>
                 [% ELSE %]
-                    [% IF ( itemloo.transfertwhen ) %]
-                        In transit from [% itemloo.transfertfrom %],
-                        to [% itemloo.transfertto %], since [% itemloo.transfertwhen %]
-                    [% END %]
-               [% END %]
+                    <span title="0000-00-00">
+                        [% IF ( itemloo.transfertwhen ) %]
+                            In transit from [% itemloo.transfertfrom %],
+                            to [% itemloo.transfertto %], since [% itemloo.transfertwhen %]
+                        [% END %]
+                    </span>
+                [% END %]
 
                 [% IF ( itemloo.message ) %]
                    Unavailable (lost or missing)
index d849a48..c30fb21 100755 (executable)
@@ -347,7 +347,7 @@ foreach my $biblionumber (@biblionumbers) {
             # change the background color
             my $issues= GetItemIssue($itemnumber);
             if ( $issues->{'date_due'} ) {
-                $item->{date_due} = format_sqldatetime($issues->{date_due});
+                $item->{date_due} = $issues->{date_due_sql};
                 $item->{backgroundcolor} = 'onloan';
             }