Bug 18985 - SQL reports 'Last edit' and 'Last run' columns sort alphabetically, not...
authorOwen Leonard <oleonard@myacpl.org>
Tue, 1 Aug 2017 17:07:33 +0000 (17:07 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 10 Aug 2017 19:25:35 +0000 (16:25 -0300)
This patch alters the DataTables configuration of the SQL reports list
so that date columns are identified via class rather than position.

To test, apply the patch and go to Reports -> Use saved.

Test the re-ordering of the creation date, last edit, and last run
columns. Each should sort correctly based on the date.

Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt

index 4c3b47e..5902b92 100644 (file)
@@ -101,10 +101,8 @@ $("#delColumn").on("click",function(){
         'aoColumnDefs': [
             { 'bSortable': false, 'bSearchable':false, 'aTargets': [0, -1] },
             { 'bSearchable': false, 'aTargets': [3] },
-            { "aTargets": [ 1, 2 ], "sType": "natural"  }
-        ],
-        "aoColumns": [
-            null,null,null,null,null,null,null,null,{ "sType": "title-string" },null,null,null,[% IF (usecache) %]null,[% END %]null,null[% IF has_obsolete_reports %],null[% END %]
+            { "aTargets": [ 1, 2 ], "sType": "natural"  },
+            { "sType": "title-string", "aTargets" : [ "title-string" ] }
         ],
         'oLanguage': {
             'sZeroRecords': _("No matching reports found")
@@ -387,9 +385,9 @@ canned reports and writing custom SQL reports.</p>
                     <th>Subgroup</th>
                     <th>Notes</th>
                     <th>Author</th>
-                    <th>Creation date</th>
-                    <th>Last edit</th>
-                    <th>Last run</th>
+                    <th class="title-string">Creation date</th>
+                    <th class="title-string">Last edit</th>
+                    <th class="title-string">Last run</th>
                     <th>Public</th>
                     [% IF (usecache) %] <th>Cache expiry (seconds)</th> [% END %]
                     <th>Saved results</th>