Bugzilla – Attachment 37225 Details for
Bug 13908
Checkouts table sorting is not honoring default sort preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13908 - Checkouts table sorting is not honoring default sort preferences
Bug-13908---Checkouts-table-sorting-is-not-honorin.patch (text/plain), 2.99 KB, created by
Kyle M Hall (khall)
on 2015-03-25 16:04:57 UTC
(
hide
)
Description:
Bug 13908 - Checkouts table sorting is not honoring default sort preferences
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-03-25 16:04:57 UTC
Size:
2.99 KB
patch
obsolete
>From 6891dedc4b9b05d57066c8463f4cf4d9ddcd3cce Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 25 Mar 2015 11:33:48 -0400 >Subject: [PATCH] Bug 13908 - Checkouts table sorting is not honoring default sort preferences > >The checkouts table no longer honors the system preferences >todaysIssuesDefaultSortOrder and previousIssuesDefaultSortOrder. > >This causes much frustration for librarians who prefer a different sort >order. In particular, many librarians prefer to see the oldest previous >issues at the top of the list so those overdue items are visible "above >the fold". > >Test Plan: >1) Apply this patch >2) Find a patron with many previous checkouts due on different days >3) Try all 4 combinations of todaysIssuesDefaultSortOrder and previousIssuesDefaultSortOrder >4) Note they all sort correctly > >Signed-off-by: Sean McGarvey <seanm@pascolibraries.org> >--- > koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 8 ++------ > svc/checkouts | 10 +++++++++- > 2 files changed, 11 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >index e8f6f44..ad79414 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >@@ -174,11 +174,7 @@ $(document).ready(function() { > "aoColumns": [ > { > "mDataProp": function( oObj ) { >- if ( oObj.issued_today ) { >- return "1" + oObj.timestamp; >- } else { >- return "0" + oObj.date_due; >- } >+ return oObj.sort_order; > } > }, > { >@@ -414,7 +410,7 @@ $(document).ready(function() { > { > iGroupingColumnIndex: 1, > iGroupingOrderByColumnIndex: 0, >- sGroupingColumnSortDirection: "desc" >+ sGroupingColumnSortDirection: "asc" > } > ); > >diff --git a/svc/checkouts b/svc/checkouts >index 51fd861..66965c2 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -204,13 +204,21 @@ while ( my $c = $sth->fetchrow_hashref() ) { > } > } > >+ >+@checkouts_today = sort { $a->{timstamp} cmp $b->{timestamp} } @checkouts_today; > @checkouts_today = reverse(@checkouts_today) >- if ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' ); >+ unless ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' ); >+ >+@checkouts_previous = sort { $a->{date_due} cmp $b->{date_due} } @checkouts_previous; > @checkouts_previous = reverse(@checkouts_previous) > if ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' ); > > my @checkouts = ( @checkouts_today, @checkouts_previous ); > >+my $i = 1; >+map { $_->{sort_order} = $i++ } @checkouts; >+ >+ > my $data; > $data->{'iTotalRecords'} = scalar @checkouts; > $data->{'iTotalDisplayRecords'} = scalar @checkouts; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13908
:
37223
|
37224
|
37225
|
37514