From d8ed9130593d1d83be1674de076f7f2367039d9c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 10 Sep 2014 08:56:24 -0400 Subject: [PATCH] Bug 12899: Row grouping in checkouts table is alphabetical and depends on translation 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. Signed-off-by: Chris Cormack Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- .../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 99342016c9..3f8db2238c 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 4424d3af59..1755d6cdf4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -135,6 +135,15 @@ $(document).ready(function() { "bAutoWidth": false, "sDom": "<'row-fluid'<'span6'><'span6'>r>t<'row-fluid'>t", "aoColumns": [ + { + "mDataProp": function( oObj ) { + if ( oObj.issued_today ) { + return "0"; + } else { + return "100"; + } + } + }, { "mDataProp": function( oObj ) { if ( oObj.issued_today ) { @@ -327,8 +336,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 28381389f6..ae8ef28573 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -687,6 +687,7 @@ No patron matched [% message %] + -- 2.39.2
    Due date Due date