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 <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Owen Leonard 2014-09-10 08:56:24 -04:00 committed by Galen Charlton
parent 362c42e918
commit bab0e73588
3 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<tfoot>
<tr>
<td colspan="8" style="text-align: right; font-weight:bold;">Totals:</td>
<td colspan="9" style="text-align: right; font-weight:bold;">Totals:</td>
<td>[% totaldue %]</td>
<td>[% totalprice %]</td>
<td colspan="3"><div class="date-select">

View File

@ -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"
}
);

View File

@ -682,6 +682,7 @@ No patron matched <span class="ex">[% message %]</span>
<table id="issues-table">
<thead>
<tr>
<th scope="col">&nbsp;</th>
<th scope="col">&nbsp;</th>
<th scope="col">Due date</th>
<th scope="col">Due date</th>