From 99ae41250bdc994f850988618f055bc6535e6cc2 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 9 Apr 2013 08:55:45 -0400 Subject: [PATCH] Bug 9903 - Sort by date broken on patron detail page Content-Type: text/plain; charset="utf-8" When the patron detail page switched to DataTables no accommodation was made for metric date formats in sorting. This patch adds sorting based on data in a span's title attribute, and thus requires that the patch for Bug 9887 be applied. To test, view the detail page for a patron who has assorted checkouts, relatives' checkouts, and holds. Sorting of date columns should be correct with the dateformat preference set to any value. --- .../prog/en/modules/members/moremember.tt | 20 +++++++++++++------- members/moremember.pl | 3 +++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index b3eef3a..8bb96c3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -33,12 +33,15 @@ $(document).ready(function() { "aoColumnDefs": [ { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false } ], + "aoColumns": [ + { "sType": "title-string" },null,null,{ "sType": "title-string" },null,null,null,null,null,null + ], "bPaginate": false })); $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, { "sDom": 't', - "aoColumnDefs": [ - { "aTargets": [ 0,8 ], "bSortable": false, "bSearchable": false } + "aoColumns": [ + { "sType": "title-string" },null,null,{ "sType": "title-string" },null,null,null,null,null ], "bPaginate": false })); @@ -47,6 +50,9 @@ $(document).ready(function() { "aoColumnDefs": [ { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false } ], + "aoColumns": [ + { "sType": "title-string" },null,null,null,null,null,null + ], "bPaginate": false })); [% IF ( picture ) %] @@ -468,7 +474,7 @@ function validate1(date) { [% ELSE %] [% END %] - [% issueloo.date_due %] + [% issueloo.date_due %] [% IF ( issueloo.itemlost ) %] [% issueloo.itemlost %] [% END %] @@ -478,7 +484,7 @@ function validate1(date) { [% issueloo.title |html %][% IF ( issueloo.author ) %], by [% issueloo.author %][% END %] [% IF ( issueloo.publishercode ) %]; [% issueloo.publishercode %] [% END %] [% IF ( issueloo.publicationyear ) %], [% issueloo.publicationyear %][% END %] [% issueloo.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( issueloo.itemtype_image ) %][% END %][% END %][% issueloo.itemtype_description %] - [% issueloo.issuedate %] + [% issueloo.issuedate %] [% issueloo.issuingbranchname %] [% issueloo.itemcallnumber %] [% issueloo.charge %] @@ -576,7 +582,7 @@ function validate1(date) { [% ELSE %] [% END %] - [% relissueloo.date_due %] + [% relissueloo.date_due %] [% IF ( relissueloo.itemlost ) %] [% relissueloo.itemlost %] [% END %] @@ -586,7 +592,7 @@ function validate1(date) { [% relissueloo.title |html %][% IF relissueloo.author %], by [% relissueloo.author %][% END %] [% IF relissueloo.publishercode %]; [% relissueloo.publishercode %] [% END %] [% IF relissueloo.publicationyear %], [% relissueloo.publicationyear %][% END %] [% relissueloo.barcode %] [% UNLESS ( noItemTypeImages ) %] [% IF ( relissueloo.itemtype_image ) %][% END %][% END %][% relissueloo.itemtype_description %] - [% relissueloo.issuedate %] + [% relissueloo.issuedate %] [% relissueloo.issuingbranchname %] [% relissueloo.itemcallnumber %] [% relissueloo.charge %] @@ -624,7 +630,7 @@ function validate1(date) { [% FOREACH reservloo IN reservloop %] - [% reservloo.reservedate %] + [% reservloo.reservedate %] [% reservloo.title |html %][% IF ( reservloo.author ) %], by [% reservloo.author %][% END %] diff --git a/members/moremember.pl b/members/moremember.pl index df6a664..52da918 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -274,6 +274,7 @@ if ($borrowernumber) { foreach (qw(waiting transfered nottransfered)) { $getreserv{$_} = 0; } + $getreserv{reservedate_sort} = $num_res->{'reservedate'}; $getreserv{reservedate} = C4::Dates->new($num_res->{'reservedate'},'iso')->output('syspref'); foreach (qw(biblionumber title author itemcallnumber )) { $getreserv{$_} = $getiteminfo->{$_}; @@ -447,7 +448,9 @@ sub build_issue_data { $issuedate = $issue->{issuedate}->clone(); } + $issue->{date_due_sort} = $issue->{date_due}; $issue->{date_due} = output_pref( $issue->{date_due} ); + $issue->{issuedate_sort} = $issue->{issuedate}; $issue->{issuedate} = output_pref( $issue->{issuedate} ) if defined $issue->{issuedate}; my $biblionumber = $issue->{biblionumber}; $issue->{issuingbranchname} = GetBranchName($issue->{branchcode}); -- 1.7.9.5