Bug 27990: Replace obsolete title-string sorting: Patrons

This patch modifies several patron 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 a patron record in the staff
interface. Check the following pages to confirm that columns containing
dates sort correctly when using any setting of the "dateformat" system
preference:

- Details: DataTables initialization removed because it is obsolete.
  Confirm that table of holds in the holds tab is still a working
  DataTable.
- Accounting
- Accounting -> Transactions,
- Accounting -> Transactions -> Details of a fee (DataTables-related
  markup removed because there are no DataTables).
- Circulation history
- Holds history
- Notices

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 10:33:55 +00:00 committed by Jonathan Druart
parent 3937fcb143
commit 2ea68db08f
7 changed files with 38 additions and 67 deletions

View File

@ -69,7 +69,7 @@
<table id="table_account_fines">
<thead>
<tr>
<th class="title-string">Date</th>
<th>Date</th>
<th>Description of charges</th>
<th>Barcode</th>
<th>Due date</th>
@ -83,7 +83,7 @@
<tbody>
<tr>
<td>
<span title="[% accountline.date | html %]">[% accountline.date |$KohaDates %]</span>
[% accountline.date |$KohaDates %]
</td>
<td>
[%- PROCESS account_type_description account=accountline -%]

View File

@ -60,7 +60,7 @@
<table id="table_account_fines">
<thead>
<tr>
<th class="title-string">Date</th>
<th>Date</th>
<th>Credit number</th>
<th>Account type</th>
<th>Description of charges</th>
@ -81,7 +81,7 @@
[% FOREACH account IN accounts %]
<tr>
<td><span title="[% account.date | html %]">[% account.date |$KohaDates %]</span></td>
<td data-order="[% account.date | html %]">[% account.date |$KohaDates %]</td>
<td>[% account.credit_number | html %]</td>
<td>[% PROCESS account_type_description account=account %]</td>
<td>

View File

@ -58,10 +58,10 @@
<th>Author</th>
<th>Barcode</th>
<th>Library</th>
<th class="title-string">Hold date</th>
<th class="title-string">Expiration date</th>
<th class="title-string">Waiting date</th>
<th class="title-string">Cancellation date</th>
<th>Hold date</th>
<th>Expiration date</th>
<th>Waiting date</th>
<th>Cancellation date</th>
[% IF show_itemtype_column %]
<th>Requested item type</th>
[% END %]
@ -75,27 +75,15 @@
<td>[% hold.biblio.author | html %]</td>
<td>[% hold.item.barcode | html %]</td>
<td>[% Branches.GetName( hold.branchcode ) | html %]</td>
<td><span title="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %]</span></td>
<td>
[% IF hold.expirationdate %]
<span title="[% hold.expirationdate | html %]">[% hold.expirationdate | $KohaDates %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
<td data-order="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %]</td>
<td data-order="[% hold.expirationdate | html %]">
[% hold.expirationdate | $KohaDates %]
</td>
<td>
[% IF hold.waitingdate %]
<span title="[% hold.waitingdate | html %]">[% hold.waitingdate | $KohaDates %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
<td data-order="[% hold.waitingdate | html %]">
[% hold.waitingdate | $KohaDates %]
</td>
<td>
[% IF hold.cancellationdate %]
<span title="[% hold.cancellationdate | html %]">[% hold.cancellationdate | $KohaDates %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
<td data-order="[% hold.cancellationdate | html %]">
[% hold.cancellationdate | $KohaDates %]
</td>
[% IF show_itemtype_column %]
<td>
@ -156,8 +144,7 @@
[% END %]
var table = KohaTable("table_holdshistory", {
"sPaginationType": "full",
"aaSorting": [[4, 'desc']],
"sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
"aaSorting": [[4, 'desc']]
}, columns_settings);
});
</script>

View File

@ -987,17 +987,6 @@
$('#'+ui.newTab.context.id).click();
}
} );
$("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": 't',
"aoColumnDefs": [
{ "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false }
],
"aoColumns": [
{ "sType": "title-string" },{ "sType": "anti-the" },null,null,null,null,null,null
],
"bPaginate": false
}));
$("#view_restrictions").on("click",function(){
$('#debarments-tab-link').click();

View File

@ -49,8 +49,8 @@
<th>Notice</th>
<th>Type</th>
<th>Status</th>
<th class="title-string">Updated on</th>
<th class="title-string">Time created</th>
<th>Updated on</th>
<th>Time created</th>
</tr>
</thead>
<tbody>
@ -88,8 +88,8 @@
</div>
[% END %]
</td>
<td><span title="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</span></td>
<td><span title="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</span></td>
<td data-order="[% QUEUED_MESSAGE.updated_on | html %]">[% QUEUED_MESSAGE.updated_on | $KohaDates with_hours => 1 %]</td>
<td data-order="[% QUEUED_MESSAGE.time_queued | html %]">[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td>
</tr>
[% END %]
</tbody>
@ -114,7 +114,6 @@
$(document).ready(function() {
$("#noticestable").dataTable($.extend(true, {}, dataTablesDefaults, {
"aaSorting": [[ 3, "desc" ]],
"aoColumns": [ null,null,null, { "sType": "title-string" } ,{ "sType": "title-string" } ],
"sPaginationType": "full"
}));

View File

@ -62,7 +62,7 @@
<th class="NoSort noExport">Actions</th>
<th>Account type</th>
<th>Description</th>
<th class="title-string">Date</th>
<th>Date</th>
<th>Barcode</th>
<th>Due date</th>
<th>Checkin date</th>
@ -104,8 +104,8 @@
[%- IF line.description %][% line.description | html %][% END %]
[% IF line.itemnumber %]([% line.item.biblio.title | html %])[% END %]
</td>
<td>
<span title="[% line.date | html %]">[% line.date | $KohaDates %]</span>
<td data-order="[% line.date | html %]">
[% line.date | $KohaDates %]
</td>
<td>
[% IF line.itemnumber %]

View File

@ -64,19 +64,19 @@
<thead>
<tr>
<th style="display:none;">Type</th>
<th class="title-string">Date</th>
<th>Date</th>
<th class="anti-the">Title</th>
<th>Author</th>
<th>Call no.</th>
<th>Barcode</th>
<th>Number of renewals</th>
<th class="title-string">Checked out on</th>
<th>Checked out on</th>
<th>Checked out from</th>
[% IF Koha.Preference('RecordStaffUserOnCheckout') %]
<th>Checked out by</th>
[% END %]
<th class="title-string">Date due</th>
<th class="title-string">Return date</th>
<th>Date due</th>
<th>Return date</th>
</tr>
</thead>
<tbody>
@ -88,8 +88,8 @@
[% END %]
[% issuetype | html %]
</td>
<td>
<span title="[% issue.issuestimestamp | html %]">[% issue.issuestimestamp | $KohaDates with_hours => 1 %]</span>
<td data-order="[% issue.issuestimestamp | html %]">
[% issue.issuestimestamp | $KohaDates with_hours => 1 %]
</td>
<td>
[% INCLUDE 'biblio-title.inc' biblio=issue link = 1 %]
@ -107,25 +107,22 @@
<td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% issue.itemnumber | uri %]&amp;biblionumber=[% issue.biblionumber | uri %]&amp;bi=[% issue.biblioitemnumber | uri %]#item[% issue.itemnumber | uri %]">[% issue.barcode | html %]</a></td>
<td>[% issue.renewals | html %]</td>
<td>
<span title="[% issue.issuedate | html %]">[% issue.issuedate |$KohaDates with_hours => 1 %]</span>
<td data-order="[% issue.issuedate | html %]">
[% issue.issuedate |$KohaDates with_hours => 1 %]
</td>
<td>[% Branches.GetName( issue.branchcode ) | html %]</td>
[% IF Koha.Preference('RecordStaffUserOnCheckout') %]
<td><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% issue.issuer_id | uri %]">[% issue.firstname | html %] [% issue.surname | html %]</a></td>
[% END %]
<td>
[% IF issue.date_due %]
<span title="[% issue.date_due | html %]">[% issue.date_due |$KohaDates with_hours => 1 %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
<td data-order="[% issue.date_due | html %]">
[% issue.date_due |$KohaDates with_hours => 1 %]
</td>
<td>
[% IF issue.returndate %]
<span title="[% issue.returndate | html %]">[% issue.returndate |$KohaDates with_hours => 1 %]</span>
<td data-order="[% issue.returndate | html %]">
[% issue.returndate |$KohaDates with_hours => 1 %]
[% ELSE %]
<span title="Checked out"><small>Checked out</small></span>
<td data-order="checked out">
<small>Checked out</small>
[% END %]
</td>
</tr>
@ -156,8 +153,7 @@
var columns_settings = [% TablesSettings.GetColumns('members', 'checkouthistory', 'checkouthistory-table', 'json') %];
var table = KohaTable("table_readingrec", {
"sPaginationType": "full",
"aaSorting": [[10, 'desc']],
"sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
"aaSorting": [[10, 'desc']]
}, columns_settings);
var tabs = $("#tabs").tabs({