Bug 12899 - Row grouping in checkouts table is alphabetical and layout depends on words chosen in translation
Summary: Row grouping in checkouts table is alphabetical and layout depends on words c...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 11703
Blocks: 12963
  Show dependency treegraph
 
Reported: 2014-09-10 12:45 UTC by Viktor Sarge
Modified: 2015-06-04 23:30 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12899 - Row grouping in checkouts table is alphabetical and depends on translation (3.26 KB, patch)
2014-09-10 13:23 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12899 - Row grouping in checkouts table is alphabetical and depends on translation (3.28 KB, patch)
2014-09-10 15:00 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12899 [Revised] Row grouping in checkouts table is alphabetical and depends on translation (4.06 KB, patch)
2014-09-15 12:27 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 12899 [Revised] Row grouping in checkouts table is alphabetical and depends on translation (4.10 KB, patch)
2014-09-16 09:01 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 12899: Row grouping in checkouts table is alphabetical and depends on translation (4.15 KB, patch)
2014-09-16 09:32 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Viktor Sarge 2014-09-10 12:45:14 UTC
In checkouts.js the checkouts table is being built and the rows are grouped ascending alphabetically into "Today's checkouts" and "Previous checkouts". The problem is that in translations where the words are different sorting "asc" can change the layout so that previous checkouts are on top and hides todays. Very impractical. 

.rowGrouping is the culprit. 

Thanks to Owen and Kyle for troubleshooting.
Comment 1 Owen Leonard 2014-09-10 13:23:21 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2014-09-10 15:00:48 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2014-09-10 15:11:37 UTC
If the export column is displayed (I didn't try without this column), the columns are misplaced.
Instead of adding a new column, what about a "<span title=''></span>", it does not work?
Comment 4 Owen Leonard 2014-09-15 12:27:04 UTC Comment hidden (obsolete)
Comment 5 Chris Cormack 2014-09-16 09:01:29 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2014-09-16 09:32:02 UTC
Created attachment 31621 [details] [review]
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>
Comment 7 Tomás Cohen Arazi 2014-09-16 18:36:50 UTC
Patch pushed to master.

Thanks Owen!
Comment 8 Galen Charlton 2014-09-23 20:31:54 UTC
Pushed to 3.16.x for inclusion in 3.16.4.