From 2ee82241ecfc28473b7dadb3e8cd5fad67be0c59 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 10 Sep 2014 08:56:24 -0400 Subject: [PATCH] Bug 12899 [Revised] Row grouping in checkouts table is alphabetical and depends on translation Content-Type: text/plain; charset="utf-8" The sort order of the "today's checkouts" and "previous checkouts" row groupings depends on the label, so in English "today's checkouts" comes first. However, in other languages the reverse alphabetical order is incorrect resulting in "previous checkouts" coming first. This patch adds a dummy column with numeric data on which the sorting can be done. This should make it translation-agnostic. To test, apply the patch and install or update a translation which will demostrate the problem (sv-SE for instance). - Clear your browser cache and switch to the English templates. - Check out some items to a patron who has checkouts from a previous day. - Confirm that the sorting of the "today's checkouts" and "previous checkouts" row groups is correct. - Switch to the new/updated translation and reload the circulation page for that patron. Confirm that the sort remains correct. - Confirm that the checkouts table looks correct and that other features (sorting, checkboxes) still work correctly. Revision: Corrected the table footer include to correct the colspan error causing column misalignment. --- .../prog/en/includes/checkouts-table-footer.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 12 +++++++++++- .../prog/en/modules/circ/circulation.tt | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc index 9934201..3f8db22 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -1,6 +1,6 @@ - Totals: + Totals: [% totaldue %] [% totalprice %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 6efe9f9..105648a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -138,6 +138,15 @@ $(document).ready(function() { { "mDataProp": function( oObj ) { if ( oObj.issued_today ) { + return "0"; + } else { + return "100"; + } + } + }, + { + "mDataProp": function( oObj ) { + if ( oObj.issued_today ) { return "" + TODAYS_CHECKOUTS + ""; } else { return "" + PREVIOUS_CHECKOUTS + ""; @@ -329,8 +338,9 @@ $(document).ready(function() { }, }).rowGrouping( { + iGroupingColumnIndex: 1, iGroupingOrderByColumnIndex: 0, - sGroupingColumnSortDirection: "desc" + sGroupingColumnSortDirection: "asc" } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 9734c0f..1204d1e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -688,6 +688,7 @@ No patron matched [% message %]   +   Due date Due date Title -- 1.7.9.5