Bug 19338: Fix sorting by dates in opac-account.tt
authorLiz Rea <liz@catalyst.net.nz>
Tue, 19 Sep 2017 03:29:22 +0000 (15:29 +1200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 26 Dec 2017 15:52:34 +0000 (12:52 -0300)
To test:
Find an account with lots of fines/payments
load up the borrower's account in the OPAC
note that the sort on the dates sorts by day, and not by date.
apply this patch
reload the page, note that the sort on the dates is now correct.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt

index 44c8555..7e2d7b9 100644 (file)
@@ -71,7 +71,7 @@
                             <thead>
                                 <tr>
                                     [% IF ENABLE_OPAC_PAYMENTS %]<th>&nbsp;</th>[% END %]
-                                    <th>Date</th>
+                                    <th class="title-string">Date</th>
                                     <th>Description</th>
                                     <th>Fine amount</th>
                                     <th>Amount outstanding</th>
                                                 [% END %]
                                             </td>
                                         [% END %]
-                                        <td>[% ACCOUNT_LINE.date | $KohaDates %]</td>
+                                        <td><span title="[% ACCOUNT_LINE.date %]">[% ACCOUNT_LINE.date | $KohaDates %]</span></td>
                                         <td>
                                             [% SWITCH ACCOUNT_LINE.accounttype %]
                                             [% CASE 'Pay' %]Payment, thanks
 <script type="text/javascript">
 $( document ).ready(function() {
 
-    $("#finestable").dataTable($.extend(true, {}, dataTablesDefaults ));
+    $("#finestable").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+             { "sType": "title-string", "aTargets" : [ "title-string" ] }
+         ]
+    } ));
 
     $(".paypal").on("click", function() {
         window.open('https://www.paypal.com/webapps/mpp/paypal-popup','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700');