From 716b74bf7116cfa2821f42e37a6d7a9619b98e03 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 18 Mar 2021 14:18:07 +0000 Subject: [PATCH] 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 Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- .../prog/en/modules/acqui/addorderiso2709.tt | 4 +- .../prog/en/modules/acqui/booksellers.tt | 42 ++++++++----------- .../prog/en/modules/acqui/duplicate_orders.tt | 18 ++++---- .../prog/en/modules/acqui/edifactmsgs.tt | 7 ++-- .../prog/en/modules/acqui/histsearch.tt | 14 +++---- .../prog/en/modules/acqui/invoice-files.tt | 7 ++-- .../prog/en/modules/acqui/invoice.tt | 4 +- .../prog/en/modules/acqui/invoices.tt | 20 +++------ 8 files changed, 45 insertions(+), 71 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index c730d3e1b2..1bbafd90eb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -398,7 +398,7 @@ File name Comments Status - Staged + Staged # Bibliographic records   @@ -425,7 +425,7 @@ [% batch_lis.import_status | html %] [% END %] - [% batch_lis.staged_date | $KohaDates with_hours => 1 %] + [% batch_lis.staged_date | $KohaDates with_hours => 1 %] [% batch_lis.num_records | html %] Add orders diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt index 470007ae7f..bfe850ebc6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -99,13 +99,13 @@ No. Name - Item count - Bibliographic record count + Item count + Bibliographic record count Items expected [% tp('basket created by', 'Created by') | html %] - Date + Date Basket group - Closed + Closed Actions @@ -118,19 +118,17 @@ [% END %] [% basket.basketno | html %] [% basket.basketname | html %] - - [% basket.total_items | html %] - [% IF basket.total_items_cancelled %] - ([% basket.total_items_cancelled | html %] cancelled) - [% END %] - + + [% basket.total_items | html %] + [% IF basket.total_items_cancelled %] + ([% basket.total_items_cancelled | html %] cancelled) + [% END %] - - [% basket.total_biblios | html %] - [% IF basket.total_biblios_cancelled %] - ([% basket.total_biblios_cancelled | html %] cancelled) - [% END %] - + + [% basket.total_biblios | html %] + [% IF basket.total_biblios_cancelled %] + ([% basket.total_biblios_cancelled | html %] cancelled) + [% END %] [% basket.expected_items | html %] @@ -139,7 +137,7 @@ [% basket.authorisedby.surname | html %] [% END %] - [% basket.creationdate | $KohaDates %] + [% basket.creationdate | $KohaDates %] [% IF basket.basketgroup %] [% basketgroup = basket.basketgroup %] @@ -150,12 +148,8 @@ [% END %] [% END %] - - [% IF ( basket.closedate ) %] - [% basket.closedate | $KohaDates %] - [% ELSE %] - - [% END %] + + [% basket.closedate | $KohaDates %] [% 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 } ] })); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt index 07ca0602e2..768d0adec1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/duplicate_orders.tt @@ -124,13 +124,9 @@ Basket [% basket.basketno | html %] › Duplicate existing orders
[% order.author | html %]
[% order.isbn | html %] [% order.name | html %] - [% order.creationdate | $KohaDates %] - - [% IF order.datereceived %] - [% order.datereceived | $KohaDates %] - [% ELSE %] - - [% END %] + [% order.creationdate | $KohaDates %] + + [% order.datereceived | $KohaDates %] [% order.quantityreceived | html %] [% order.quantity | html %] @@ -159,8 +155,8 @@ Basket [% basket.basketno | html %] › Duplicate existing orders Invoice number Summary Vendor - Placed on - Received on + Placed on + Received on Quantity received Quantity ordered Unit cost @@ -280,8 +276,8 @@ Basket [% basket.basketno | html %] › Duplicate existing orders Invoice number Summary Vendor - Placed on - Received on + Placed on + Received on Quantity received Quantity ordered Unit cost diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt index 058f6e6591..546e03f719 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/edifactmsgs.tt @@ -41,7 +41,7 @@ Type -Transferred +Transferred Status Vendor Details @@ -53,7 +53,7 @@ [% FOREACH msg IN messages %] [% msg.message_type | html %] -[% msg.transfer_date | $KohaDates %] +[% msg.transfer_date | $KohaDates %] [% msg.status | html %] @@ -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 } ] })); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt index a0611aeba7..7c4d2c3f1d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.tt @@ -70,8 +70,8 @@ Invoice number Summary Vendor - Placed on - Received on + Placed on + Received on Quantity received Quantity ordered Unit cost @@ -116,13 +116,9 @@
[% order.author | html %]
[% order.isbn | html %]
[% order.name | html %] - [% order.creationdate | $KohaDates %] - - [% IF order.datereceived %] - [% order.datereceived | $KohaDates %] - [% ELSE %] - - [% END %] + [% order.creationdate | $KohaDates %] + + [% order.datereceived | $KohaDates %] [% order.quantityreceived | html %] [% order.quantity | html %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt index 0e131f0007..da26c692dd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice-files.tt @@ -66,8 +66,8 @@ [% f.file_name | html %] [% f.file_type | html %] [% f.file_description | html %] - - [% f.date_uploaded | $KohaDates %] + + [% f.date_uploaded | $KohaDates %] [% f.file_size | html %] Delete @@ -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, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt index 9a60436dce..bd035fa198 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -455,8 +455,8 @@ [% f.file_name | html %] [% f.file_type | html %] [% f.file_description | html %] - - [% f.date_uploaded | $KohaDates %] + + [% f.date_uploaded | $KohaDates %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt index 0a4ffee271..892db4a992 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -51,8 +51,8 @@   Invoice no. Vendor - Shipment date - Billing date + Shipment date + Billing date Received bibliographic records Received items Status @@ -68,19 +68,11 @@ [% invoice.invoicenumber | html %] [% invoice.suppliername | html %] - - [% IF invoice.shipmentdate %] - [% invoice.shipmentdate | $KohaDates %] - [% ELSE %] - - [% END %] + + [% invoice.shipmentdate | $KohaDates %] - - [% IF invoice.billingdate %] - [% invoice.billingdate | $KohaDates %] - [% ELSE %] - - [% END %] + + [% invoice.billingdate | $KohaDates %] [% invoice.receivedbiblios | html %] [% invoice.receiveditems | html %] -- 2.39.5