From a130131960b8da7e86445c5469618efae9ff8e56 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 8 Jul 2019 16:06:38 +0000 Subject: [PATCH] Bug 23279: In news management interface, sort news by publication date descending This patch makes a few changes to the configuration of the DataTable showing news items in the staff client. It adds a default sort on "Publication date," descending; It updates the way non-sortable columns are configured; It modifies sorting on the title and content columns so that articles are ignored. To test, apply the patch and go to Tools -> News. - When the page loads the table of news items should sort by default on publication date, descending. - There should be no sorting indicator on the first and last columns. - When sorting the "Title" or "News" columns, articles "A," "An," and "The" should be ignored. Signed-off-by: Claire Gravely Signed-off-by: frederik chenier Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize --- .../prog/en/modules/tools/koha-news.tt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index fe88908ff8..f7f90f470c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -104,16 +104,16 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]
- + - + - - + + [% FOREACH opac_new IN opac_news %] [% IF ( opac_new.expired ) %] @@ -240,10 +240,11 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] $(document).ready(function() { var newst = $("#newst").DataTable($.extend(true, {}, dataTablesDefaults, { + "order": [[ 4, "desc" ]], "aoColumnDefs": [ - { "aTargets": [ 0,-1,-2 ], "bSortable": false }, - { "aTargets": [ 0, -1 ], "bSearchable": false }, - { 'sType': "title-string", 'aTargets' : [ 'title-string'] } + { "sortable": false, "searchable": false, 'targets': [ 'NoSort' ] }, + { "type": "anti-the", "targets": [ "anti-the" ] }, + { "type": "title-string", "targets" : [ "title-string"] } ], "sPaginationType": "full_numbers" })); -- 2.39.5
   Location Library Number Publication date Expiration dateTitleTitle AuthorNewsActionsNewsActions