Bugzilla – Attachment 33523 Details for
Bug 13237
Regression: List of previous checkouts should be ordered by due date ascending
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13237 - Regression: List of previous checkouts should be ordered by due date ascending
Bug-13237---Regression-List-of-previous-checkouts-.patch (text/plain), 5.35 KB, created by
Kyle M Hall (khall)
on 2014-11-13 16:18:28 UTC
(
hide
)
Description:
Bug 13237 - Regression: List of previous checkouts should be ordered by due date ascending
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-11-13 16:18:28 UTC
Size:
5.35 KB
patch
obsolete
>From 52459cc0c0088d45c331644b111d72608e953f77 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 13 Nov 2014 09:54:45 -0500 >Subject: [PATCH] Bug 13237 - Regression: List of previous checkouts should be ordered by due date ascending > >Before Bug 11703 the list of previous checkouts on a patrons account >were ordered with the oldest checkouts first. Now previous checkouts are >shown with the newest checkouts first, breaking a sorting default which >has been in place for years. > >Note, the sorting of the checkouts was previously controlled by >previousIssuesDefaultSortOrder & todaysIssuesDefaultSortOrder. > >These settings were taken into account in svc/checkouts but at some >point the datatables took over the initial sorting, which broke the >feature afaict. > >Test Plan: >1) Find a patron with a set of previous and today's checkouts >2) Note the system preferences previousIssuesDefaultSortOrder > and todaysIssuesDefaultSortOrder are ignored for the initial sorting > view. Also not the sorting by due date does not work correctly. >3) Apply this patch >4) Test both system preferences with each setting, note the correct > sort order. >5) Sort the checkouts by due date, note the correct sort order. >--- > .../prog/en/includes/checkouts-table.inc | 7 ++++--- > koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 16 ++++++++++++++-- > svc/checkouts | 7 +++++++ > 3 files changed, 25 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >index fc6d4ed..94e90ac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc >@@ -9,9 +9,10 @@ > <table id="issues-table" style="width: 100% !Important;"> > <thead> > <tr> >- <th scope="col"> </th> >- <th scope="col"> </th> >- <th scope="col">Due date</th> >+ <th scope="col">Date sorting (hidden)</th> >+ <th scope="col">Today or previous (hidden)</th> >+ <th scope="col">Due date, unformatted (hidden)</th> >+ <th scope="col">Initial sort order (hidden)</th> > <th scope="col">Due date</th> > <th scope="col">Title</th> > <th scope="col">Item type</th> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >index e333776..bdd67aa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js >@@ -159,6 +159,7 @@ $(document).ready(function() { > "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t", > "aoColumns": [ > { >+ "bVisible": false, > "mDataProp": function( oObj ) { > if ( oObj.issued_today ) { > return "1" + oObj.timestamp; >@@ -168,6 +169,7 @@ $(document).ready(function() { > } > }, > { >+ "bVisible": false, > "mDataProp": function( oObj ) { > if ( oObj.issued_today ) { > return "<strong>" + TODAYS_CHECKOUTS + "</strong>"; >@@ -177,11 +179,21 @@ $(document).ready(function() { > } > }, > { >+ "bVisible": false, > "mDataProp": "date_due", >+ }, >+ { > "bVisible": false, >+ "mDataProp": function( oObj ) { >+ if ( oObj.issued_today ) { >+ return "1" + oObj.sort_order; >+ } else { >+ return "0" + oObj.sort_order; >+ } >+ } > }, > { >- "iDataSort": 1, // Sort on hidden unformatted date due column >+ "iDataSort": 0, // Sort on hidden unformatted date due column > "mDataProp": function( oObj ) { > if ( oObj.date_due_overdue ) { > return "<span class='overdue'>" + oObj.date_due_formatted + "</span>"; >@@ -379,7 +391,7 @@ $(document).ready(function() { > }).rowGrouping( > { > iGroupingColumnIndex: 1, >- iGroupingOrderByColumnIndex: 0, >+ iGroupingOrderByColumnIndex: 3, > sGroupingColumnSortDirection: "desc" > } > ); >diff --git a/svc/checkouts b/svc/checkouts >index 9dc4881..ef66cd0 100755 >--- a/svc/checkouts >+++ b/svc/checkouts >@@ -191,10 +191,17 @@ while ( my $c = $sth->fetchrow_hashref() ) { > } > } > >+my $i; >+ > @checkouts_today = reverse(@checkouts_today) > if ( C4::Context->preference('todaysIssuesDefaultSortOrder') eq 'desc' ); >+$i = 0; >+map { $_->{sort_order} = $i++ } @checkouts_today; >+ > @checkouts_previous = reverse(@checkouts_previous) > if ( C4::Context->preference('previousIssuesDefaultSortOrder') eq 'desc' ); >+$i = 0; >+map { $_->{sort_order} = $i++ } @checkouts_previous; > > my @checkouts = ( @checkouts_today, @checkouts_previous ); > >-- >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 13237
: 33523 |
33569