Bug 28016: Replace obsolete title-string sorting: Assorted templates
authorOwen Leonard <oleonard@myacpl.org>
Mon, 22 Mar 2021 16:55:13 +0000 (16:55 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 6 Apr 2021 13:56:31 +0000 (15:56 +0200)
This patch modifies various templates to replace the use of the
"title-string" DataTables sorting method with the newer "data-order"
attribute.

To test, apply the patch and view the following pages to confirm that
columns containing dates sort correctly when using any setting of the
"dateformat" system preference:

- Cataloging -> Edit items
  - Easiest to test with an title with many items. You can follow the
    "Edit items" link from search results.
- Tools -> Patron lists
  - View the contents of a patron list
- Catalog -> Place hold
  - Locate a title with multiple items and check out each item with a
    different due date.
  - Start the process of placing a hold on that title for a patron.
  - On the "Place hold" screen, check the table of "specific" items and
    test sorting of the "Information" column by date due.
- Tools -> Tags

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/list.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt

index 1744ec3..152d640 100644 (file)
                         <th>Address</th>
                         <th>Category</th>
                         <th>Library</th>
-                        <th class="title-string">Expires on</th>
+                        <th>Expires on</th>
                         <th>Circ notes</th>
                     </tr>
                 </thead>
                             </td>
                             <td>[% p.borrowernumber.categorycode.description | html %] ([% p.borrowernumber.categorycode.categorycode | html %])</td>
                             <td>[% p.borrowernumber.branchcode.branchname | html %]</td>
-                            <td><span title="[% p.borrowernumber.dateexpiry | html %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</span></td>
+                            <td data-order="[% p.borrowernumber.dateexpiry | html %]">[% p.borrowernumber.dateexpiry | $KohaDates %]</td>
                             <td>[% p.borrowernumber.borrowernotes | html %]</td>
                         </tr>
                     [% END %]
index b9a3986..60fb888 100644 (file)
                                             [% IF itemdata_enumchron %]
                                                 <th>Vol no.</th>
                                             [% END %]
-                                            <th class="title-string">Information</th>
-                                            <th class="title-string">Allowed pickup locations</th>
+                                            <th>Information</th>
+                                            <th>Allowed pickup locations</th>
                                         </tr>
                                     </thead>
                                     <tbody>
                                                             [% itemloo.enumchron | html %]
                                                         </td>
                                                     [% END %]
-                                                    <td>
-                                                        [% IF ( itemloo.onloan ) %]
-                                                            <span title="[% itemloo.date_due | html %]" class="checkedout">Due [% itemloo.date_due | $KohaDates  as_due_date => 1 %]</span>
-                                                        [% ELSE %]
-                                                            <span title="0000-00-00">
-                                                                [% IF ( itemloo.transfertwhen ) %]
-                                                                    In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
-                                                                    to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
-                                                                [% END %]
-                                                            </span>
-                                                        [% END %]
+                                                    [% IF ( itemloo.onloan ) %]
+                                                        <td data-order="[% itemloo.date_due | html %]">
+                                                            <span class="checkedout">Due [% itemloo.date_due | $KohaDates  as_due_date => 1 %]</span>
+                                                    [% ELSE %]
+                                                        <td>
+                                                            [% IF ( itemloo.transfertwhen ) %]
+                                                                In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
+                                                                to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
+                                                            [% END %]
+                                                    [% END %]
 
                                                         [% IF ( itemloo.reservedate ) %]
                                                             [% IF ( itemloo.nocancel ) %]
             var my_table = $("#requestspecific").dataTable($.extend(true, {}, dataTablesDefaults, {
                 'bPaginate': false,
                 "sDom": '<"top pager"ilf>t',
-                "aoColumnDefs": [
-                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
-                ]
             }));
 
             //Override fieldset styling for dataTables search box
index 487e022..e955e60 100644 (file)
@@ -96,7 +96,7 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
                <th>Weight</th>
             <th class="NoSort noExport">Actions</th>
             [% UNLESS ( filter_approved_pending ) %]<th>Reviewer</th>[% END %]
-        <th class="title-string">Date</th>
+        <th>Date</th>
        </tr>
     </thead>
     <tbody>
@@ -151,8 +151,8 @@ tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; }
             </td>
             [% UNLESS ( filter_approved_pending ) %]<td>&nbsp;</td>[% END %]
             [% END %]
-            <td>
-                <span title="[% tagloo.date_approved | html %]">[% tagloo.date_approved | $KohaDates %]</span>
+            <td data-order="[% tagloo.date_approved | html %]">
+                [% tagloo.date_approved | $KohaDates %]
             </td>
         </tr>
     [% END %]