From a545ae44cc6b067b987cbca70e2f382dcc2ef020 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Mon, 9 Oct 2017 08:07:29 +0000 Subject: [PATCH] Bug 19438: Fix sorting by date due in overdues.pl Content-Type: text/plain; charset=utf-8 Test plan: 0) Do not apply the patch 1) Have some overdued checkouts in your database 2) Go to circulation -> overdues (overdues.pl) 3) Try to sort the overdues table by due date and notice it is sorted alphabetically, not by date 4) Apply the patch 5) Try again and confirm, it is sorted by date Signed-off-by: Owen Leonard Signed-off-by: Marcel de Rooy --- circ/overdue.pl | 3 +-- koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt | 10 +++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/circ/overdue.pl b/circ/overdue.pl index 68abc84..eea9e05 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -294,10 +294,9 @@ if ($noreport) { my @displayvalues = map { $_->[1] } @{ $pattrs->{$pattr_filter->{code}} }; # grab second value from each subarray push @patron_attr_value_loop, { value => join(', ', sort { lc $a cmp lc $b } @displayvalues) }; } - my $dt = dt_from_string($data->{date_due}, 'sql'); push @overduedata, { - duedate => output_pref($dt), + duedate => $data->{date_due}, borrowernumber => $data->{borrowernumber}, barcode => $data->{barcode}, cardnumber => $data->{cardnumber}, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt index 5e5f466..8bc2cee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt @@ -64,7 +64,11 @@ $(document).ready(function(){ $("#overduest").dataTable($.extend(true, {}, dataTablesDefaults, { - "sPaginationType": "four_button" + "sPaginationType": "four_button", + "aaSorting": [[0, 'asc']], + "aoColumnDefs": [ + { "sType": "title-string", "aTargets": [ "title-string" ] } + ] })); }); //]]> @@ -107,7 +111,7 @@ - + @@ -120,7 +124,7 @@ [% FOREACH overdueloo IN overdueloop %] - + -- 2.1.4
Due dateDue date Patron Library Title
[% overdueloo.duedate %][% overdueloo.duedate | $KohaDates %] [% overdueloo.surname %][% IF (overdueloo.firstname) %], [% overdueloo.firstname %][% END %] ([% overdueloo.cardnumber %]) [% IF ( overdueloo.email ) %][email][% END %] [% IF ( overdueloo.phone ) %]([% overdueloo.phone %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro %])[% END %]