Bug 27994: Replace obsolete title-string sorting: Reports templates

This patch modifies several reports 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:

- Guided reports -> Saved SQL reports
- Guided reports -> Saved SQL reports -> New SQL from Mana -> Search
  results.
- Reports -> Items lost
- Reports -> Serials

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>
This commit is contained in:
Owen Leonard 2021-03-19 11:38:54 +00:00 committed by Jonathan Druart
parent 8bb9cb649b
commit 67a60c24a3
4 changed files with 20 additions and 29 deletions

View file

@ -38,7 +38,7 @@
<th class="anti-the">Notes</th>
<th>Type</th>
<th title="Number of libraries using this pattern"># of users</th>
<th class="title-string" title="Last time a library used this pattern">Last import</th>
<th title="Last time a library used this pattern">Last import</th>
<th> Comments </th>
[% UNLESS search_only %]
<th class="NoSort noExport">Actions</th>
@ -82,10 +82,8 @@
[% report.nbofusers | html %]
[% END %]
</td>
<td>
<span title="[% report.lastimport | html %]">
[% report.lastimport | $KohaDates %]
</span>
<td data-order="[% report.lastimport | html %]">
[% report.lastimport | $KohaDates %]
</td>
<td>
[% FOREACH comment IN report.comments %]
@ -124,4 +122,4 @@
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% INCLUDE 'intranet-bottom.inc' %]
[% INCLUDE 'intranet-bottom.inc' %]

View file

@ -276,9 +276,9 @@
<th>Subgroup</th>
<th>Notes</th>
<th>Author</th>
<th class="title-string">Creation date</th>
<th class="title-string">Last edit</th>
<th class="title-string">Last run</th>
<th>Creation date</th>
<th>Last edit</th>
<th>Last run</th>
<th class="report_public">Public</th>
<th class="report_json_url">JSON URL</th>
[% IF (usecache) %]
@ -333,14 +333,14 @@
[% END %]
([% savedreport.borrowernumber | html %])
</td>
<td>
<span title="[% savedreport.date_created | html %]">[% savedreport.date_created | $KohaDates %]</span>
<td data-order="[% savedreport.date_created | html %]">
[% savedreport.date_created | $KohaDates %]
</td>
<td>
<span title="[% savedreport.last_modified | html %]">[% savedreport.last_modified | $KohaDates with_hours => 1 %]</span>
<td data-order="[% savedreport.last_modified | html %]">
[% savedreport.last_modified | $KohaDates with_hours => 1 %]
</td>
<td>
<span title="[% savedreport.last_run | html %]">[% savedreport.last_run | $KohaDates with_hours => 1 %]</span>
<td data-order="[% savedreport.last_run | html %]">
[% savedreport.last_run | $KohaDates with_hours => 1 %]
</td>
<td class="report_public">
[% IF (savedreport.public) %]
@ -1653,8 +1653,6 @@
'sPaginationType': 'full',
'aaSorting': [[ 1, "asc" ]],
'aoColumnDefs': [
{ 'bSearchable': false, 'aTargets': [3] },
{ "aTargets": [ 1, 2 ], "sType": "natural" },
{ "visible": false, "aTargets" : [ "hidden" ] }
],
'oLanguage': {
@ -1979,7 +1977,6 @@
],
"aoColumnDefs": [
{ 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
{ "sType": "title-string", "aTargets" : [ "title-string" ] },
{ 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
]
}));

View file

@ -93,10 +93,10 @@
<th>Title</th>
<th>Author</th>
<th>Lost status</th>
<th class="title-string">Lost on</th>
<th>Lost on</th>
<th>Barcode</th>
<th>Call number</th>
<th class="title-string">Date last seen</th>
<th>Date last seen</th>
<th>Price</th>
<th>Rep.price</th>
<th>Library</th>
@ -121,12 +121,12 @@
</td>
<td>[% item.biblio.author | html %]</td>
<td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) | html %]
<td><span title="[% item.itemlost_on | html %]">[% item.itemlost_on | $KohaDates %]</span></td>
<td data-order="[% item.itemlost_on | html %]">[% item.itemlost_on | $KohaDates %]</td>
<td>
<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% item.biblionumber | uri %]">[% item.barcode | html %]</a>
</td>
<td>[% item.itemcallnumber | html %]</td>
<td><span title="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</span></td>
<td data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td>
<td>[% item.price | $Price %]</td>
<td>[% item.replacementprice | $Price %]</td>
<td>[% Branches.GetName(item.homebranch) | html %]</td>

View file

@ -42,7 +42,7 @@
<thead>
<tr>
<th>Vendor</th>
<th>Title</th>
<th class="anti-the">Title</th>
<th>Subscription ID</th>
<th>Library</th>
<th>Call number</th>
@ -59,8 +59,8 @@
<td>[% data.subscriptionid | html %]</td>
<td>[% Branches.GetName( data.branchcode ) | html %]</td>
<td>[% data.callnumber | html %]</td>
<td><span title="[% data.startdate | html %]">[% data.startdate | $KohaDates %]</span></td>
<td><span title="[% data.enddate | html %]">[% data.enddate | $KohaDates %]</span></td>
<td data-order="[% data.startdate | html %]">[% data.startdate | $KohaDates %]</td>
<td data-order="[% data.enddate | html %]">[% data.enddate | $KohaDates %]</td>
<td>
[% IF data.closed %]
Closed
@ -159,11 +159,7 @@
<script>
$(document).ready(function() {
$("#resulttable").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"bPaginate": false,
"aoColumns": [
null,{ "sType": "anti-the" },null,null,null,{ "sType": "title-string" },{ "sType": "title-string" },null
],
}));
});
</script>