From b2f1f850bef36229ac932382d3f7e7b96ae214bc Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Mon, 28 Apr 2025 10:50:08 +0200 Subject: [PATCH] Bug 39757: Fix default sort order Test plan: 1 - Have a notice with mutliple serials received on different days, notice they are not sorted by date by default 2 - Have a non-serial notice, notice there is no sort order 3 - Apply patch 4 - Go to the serials notice -> it is well ordered (by acquisition date) 5 - Go to the non-serial notice -> is is sorted by accession date Note: I picked accession date because it is how it works in Koha::Item::search_ordered which is not used anymore for this purpose. --- .../html_helpers/tables/items/catalogue_detail.inc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 84451e0a..1fe6a527 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -320,7 +320,16 @@ var items_table = $("#" + tab_id + '_table').kohaTable({ ajax: { url: item_table_url }, - order: [], + order: [ + { + name: 'enumchron', + dir: 'desc' + }, + { + name: 'dateaccessioned', + dir: 'desc' + }, + ], embed, autoWidth: false, bKohaColumnsUseNames: true, @@ -453,6 +462,7 @@ { data: "me.serial_issue_number", className: "enumchron", + name: "enumchron", searchable: true, orderable: true, render: function (data, type, row, meta) { @@ -623,6 +633,7 @@ data: "me.acquisition_date", type: "date", className: "dateaccessioned", + name: "dateaccessioned", searchable: true, orderable: true, render: function (data, type, row, meta) { -- 2.30.2