From 2e9c66ba5b39a5c2205e2a4c348b35b9edab958c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 22 Apr 2015 10:47:15 +0200 Subject: [PATCH] Bug 13887: Display the due date as a due date + sort on info 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 Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- C4/Circulation.pm | 2 ++ .../prog/en/modules/reserve/request.tt | 21 ++++++++++++------- reserve/request.pl | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index d3f8668d33..f9916809c0 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index f072fb92bb..80be359044 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -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 %] Vol no. [% END %] - Information + Information @@ -504,14 +507,16 @@ function checkMultiHold() { [% END %] - [% IF ( itemloo.onloan ) %] - Due [% itemloo.date_due %] + [% IF ( itemloo.onloan ) %] + Due [% itemloo.date_due | $KohaDates as_due_date => 1 %] [% ELSE %] - [% IF ( itemloo.transfertwhen ) %] - In transit from [% itemloo.transfertfrom %], - to [% itemloo.transfertto %], since [% itemloo.transfertwhen %] - [% END %] - [% END %] + + [% IF ( itemloo.transfertwhen ) %] + In transit from [% itemloo.transfertfrom %], + to [% itemloo.transfertto %], since [% itemloo.transfertwhen %] + [% END %] + + [% END %] [% IF ( itemloo.message ) %] Unavailable (lost or missing) diff --git a/reserve/request.pl b/reserve/request.pl index d849a48fd6..c30fb21220 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -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'; } -- 2.39.5