Bug 27982: Replace obsolete title-string sorting: Acquisitions templates part 1

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

- Acquisitions -> Vendor search
- Acquisitions -> Vendor -> Basket -> Add to basket
   -> From a staged file
   -> From existing orders (copy)
- Acquisitions -> EDIFACT messages
- Acquisitions -> Order search
- With AcqEnableFiles enabled, attach some files to an invoice:
  - Acquisitions -> Invoices
    Acquisitions -> Invoices -> Manage invoice files

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Owen Leonard 2021-03-18 14:18:07 +00:00 committed by Jonathan Druart
parent c7fef23763
commit 716b74bf71
8 changed files with 45 additions and 71 deletions

View file

@ -398,7 +398,7 @@
<th>File name</th>
<th>Comments</th>
<th>Status</th>
<th class="title-string">Staged</th>
<th>Staged</th>
<th># Bibliographic records</th>
<th class="NoSort">&nbsp;</th>
</tr>
@ -425,7 +425,7 @@
[% batch_lis.import_status | html %]
[% END %]
</td>
<td><span title="[% batch_lis.staged_date | html %]">[% batch_lis.staged_date | $KohaDates with_hours => 1 %]</span></td>
<td data-order="[% batch_lis.staged_date | html %]">[% batch_lis.staged_date | $KohaDates with_hours => 1 %]</td>
<td>[% batch_lis.num_records | html %]</td>
<td class="actions">
<a href="[% batch_lis.scriptname | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Add orders</a>

View file

@ -99,13 +99,13 @@
<tr>
<th>No.</th>
<th>Name</th>
<th class="title-numeric">Item count</th>
<th class="title-numeric">Bibliographic record count</th>
<th>Item count</th>
<th>Bibliographic record count</th>
<th>Items expected</th>
<th>[% tp('basket created by', 'Created by') | html %]</th>
<th class="title-string">Date</th>
<th>Date</th>
<th>Basket group</th>
<th class="title-string">Closed</th>
<th>Closed</th>
<th class="noExport">Actions</th>
</tr>
</thead>
@ -118,19 +118,17 @@
[% END %]
<td>[% basket.basketno | html %]</td>
<td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno | uri %]">[% basket.basketname | html %]</a></td>
<td>
<span title="[% basket.total_items | html %]">[% basket.total_items | html %]
[% IF basket.total_items_cancelled %]
([% basket.total_items_cancelled | html %] cancelled)
[% END %]
</span>
<td data-order="[% basket.total_items | html %]">
[% basket.total_items | html %]
[% IF basket.total_items_cancelled %]
([% basket.total_items_cancelled | html %] cancelled)
[% END %]
</td>
<td>
<span title="[% basket.total_biblios | html %]">[% basket.total_biblios | html %]
[% IF basket.total_biblios_cancelled %]
([% basket.total_biblios_cancelled | html %] cancelled)
[% END %]
</span>
<td data-order="[% basket.total_biblios | html %]">
[% basket.total_biblios | html %]
[% IF basket.total_biblios_cancelled %]
([% basket.total_biblios_cancelled | html %] cancelled)
[% END %]
</td>
<td>[% basket.expected_items | html %]</td>
<td>
@ -139,7 +137,7 @@
[% basket.authorisedby.surname | html %]
[% END %]
</td>
<td><span title="[% basket.creationdate | html %]">[% basket.creationdate | $KohaDates %]</span></td>
<td data-order="[% basket.creationdate | html %]">[% basket.creationdate | $KohaDates %]</td>
<td>
[% IF basket.basketgroup %]
[% basketgroup = basket.basketgroup %]
@ -150,12 +148,8 @@
[% END %]
[% END %]
</td>
<td>
[% IF ( basket.closedate ) %]
<span title="[% basket.closedate | html %]">[% basket.closedate | $KohaDates %]</span>
[% ELSE %]
<span title="9999-99-99"></span>
[% END %]
<td data-order="[% basket.closedate | html %]">
[% basket.closedate | $KohaDates %]
</td>
<td class="actions">
[% IF not basket.closedate and supplier.active %]
@ -229,8 +223,6 @@
'bInfo': false,
"aaSorting": [[ 1, "asc" ]],
"aoColumnDefs": [
{ "sType": "title-string", "aTargets" : [ "title-string" ] },
{ "sType": "title-numeric", "aTargets" : [ "title-numeric" ] },
{ 'aTargets': [-1], 'bSortable': false }
]
}));

View file

@ -124,13 +124,9 @@ Basket [% basket.basketno | html %] &rsaquo; Duplicate existing orders
<br />[% order.author | html %] <br /> [% order.isbn | html %]
</td>
<td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | uri %]">[% order.name | html %]</a></td>
<td><span title="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</span></td>
<td>
[% IF order.datereceived %]
<span title="[% order.datereceived | html %]">[% order.datereceived | $KohaDates %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
<td data-order="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</td>
<td data-order="[% order.datereceived | html %]">
[% order.datereceived | $KohaDates %]
</td>
<td>[% order.quantityreceived | html %]</td>
<td>[% order.quantity | html %]</td>
@ -159,8 +155,8 @@ Basket [% basket.basketno | html %] &rsaquo; Duplicate existing orders
<th>Invoice number</th>
<th class="anti-the">Summary</th>
<th>Vendor</th>
<th class="title-string">Placed on</th>
<th class="title-string">Received on</th>
<th>Placed on</th>
<th>Received on</th>
<th>Quantity received</th>
<th>Quantity ordered</th>
<th>Unit cost</th>
@ -280,8 +276,8 @@ Basket [% basket.basketno | html %] &rsaquo; Duplicate existing orders
<th>Invoice number</th>
<th class="anti-the">Summary</th>
<th>Vendor</th>
<th class="title-string">Placed on</th>
<th class="title-string">Received on</th>
<th>Placed on</th>
<th>Received on</th>
<th>Quantity received</th>
<th>Quantity ordered</th>
<th>Unit cost</th>

View file

@ -41,7 +41,7 @@
<thead>
<tr>
<th>Type</th>
<th class="title-string">Transferred</th>
<th>Transferred</th>
<th>Status</th>
<th>Vendor</th>
<th>Details</th>
@ -53,7 +53,7 @@
[% FOREACH msg IN messages %]
<tr>
<td>[% msg.message_type | html %]</td>
<td><span title="[% msg.transfer_date | html %]">[% msg.transfer_date | $KohaDates %]</span></td>
<td data-order="[% msg.transfer_date | html %]">[% msg.transfer_date | $KohaDates %]</td>
<td>[% msg.status | html %]</td>
<td>
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% msg.vendor_id | uri %]">
@ -132,8 +132,7 @@
'aaSorting': [[1, "desc" ]],
'sPaginationType': "full",
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }
]
}));

View file

@ -70,8 +70,8 @@
<th>Invoice number</th>
<th class="anti-the">Summary</th>
<th>Vendor</th>
<th class="title-string">Placed on</th>
<th class="title-string">Received on</th>
<th>Placed on</th>
<th>Received on</th>
<th>Quantity received</th>
<th>Quantity ordered</th>
<th>Unit cost</th>
@ -116,13 +116,9 @@
<br />[% order.author | html %] <br /> [% order.isbn | html %]
</td>
<td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | uri %]">[% order.name | html %]</a></td>
<td><span title="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</span></td>
<td>
[% IF order.datereceived %]
<span title="[% order.datereceived | html %]">[% order.datereceived | $KohaDates %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
<td data-order="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</td>
<td data-order="[% order.datereceived | html %]">
[% order.datereceived | $KohaDates %]
</td>
<td>[% order.quantityreceived | html %]</td>
<td>[% order.quantity | html %]</td>

View file

@ -66,8 +66,8 @@
<td><a href="?invoiceid=[% invoiceid | uri %]&amp;op=download&amp;view=1&amp;file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a></td>
<td>[% f.file_type | html %]</td>
<td>[% f.file_description | html %]</td>
<td class="title-string">
<span title="[% f.date_uploaded | html %]">[% f.date_uploaded | $KohaDates %]</span>
<td data-order="[% f.date_uploaded | html %]">
[% f.date_uploaded | $KohaDates %]
</td>
<td>[% f.file_size | html %]</td>
<td><a class="delete_file" href="?invoiceid=[% invoiceid | html %]&amp;op=delete&amp;file_id=[% f.file_id | html %]">Delete</a></td>
@ -114,8 +114,7 @@
$(document).ready(function() {
$("#invoice_files_details_table").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
{ "aTargets": [ "title-string" ], "sType": "title-string" }
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }
],
bInfo: false,
bPaginate: false,

View file

@ -455,8 +455,8 @@
<td><a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid | uri %]&amp;op=download&amp;view=1&amp;file_id=[% f.file_id | uri %]">[% f.file_name | html %]</a></td>
<td>[% f.file_type | html %]</td>
<td>[% f.file_description | html %]</td>
<td class="title-string">
<span title="[% f.date_uploaded | html %]">[% f.date_uploaded | $KohaDates %]</span>
<td data-order="[% f.date_uploaded | html %]">
[% f.date_uploaded | $KohaDates %]
</td>
</tr>
[% END %]

View file

@ -51,8 +51,8 @@
<th>&nbsp;</th>
<th>Invoice no.</th>
<th>Vendor</th>
<th class="title-string">Shipment date</th>
<th class="title-string">Billing date</th>
<th>Shipment date</th>
<th>Billing date</th>
<th>Received bibliographic records</th>
<th>Received items</th>
<th>Status</th>
@ -68,19 +68,11 @@
<td><input type="checkbox" class="select-invoice" value="[% invoice.invoiceid | html %]" /></td>
<td><a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid | uri %]">[% invoice.invoicenumber | html %]</a></td>
<td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% invoice.booksellerid | uri %]">[% invoice.suppliername | html %]</a></td>
<td>
[% IF invoice.shipmentdate %]
<span title="[% invoice.shipmentdate | html %]">[% invoice.shipmentdate | $KohaDates %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
<td data-order="[% invoice.shipmentdate | html %]">
[% invoice.shipmentdate | $KohaDates %]
</td>
<td>
[% IF invoice.billingdate %]
<span title="[% invoice.billingdate | html %]">[% invoice.billingdate | $KohaDates %]</span>
[% ELSE %]
<span title="0000-00-00"></span>
[% END %]
<td data-order="[% invoice.billingdate | html %]">
[% invoice.billingdate | $KohaDates %]
</td>
<td>[% invoice.receivedbiblios | html %]</td>
<td>[% invoice.receiveditems | html %]</td>