From cf47253a5a824ee26e01f4fd351b656c6219e672 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 7 Oct 2014 14:54:04 -0400 Subject: [PATCH] Bug 13039 - Vendor search: sorting of "item count" and "biblio count" columns can be incorrect Content-Type: text/plain; charset="utf-8" On the vendor search results page if some cells contain textual data the "item count" and "biblio count" columns will sort incorrectly. This patch sets an explicit numeric sort on these columns. In doing so this patch also changes the existing column sorting configuration to use table header cell classes instead of sorting based on index. This patch also corrects two instances of unescaped ampersands. To test, search for a vendor which has multiple baskets, at least one of which should contain canceled orders. Confirm that sorting by item count, biblio count, date, and closed all work correctly. --- .../prog/en/modules/acqui/booksellers.tt | 35 ++++++++++---------- 1 file changed, 18 insertions(+), 17 deletions(-) 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 546f597..3db9188 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt @@ -18,10 +18,9 @@ $(document).ready(function() { 'bFilter': false, 'bInfo': false, "aaSorting": [[ 1, "asc" ]], - "aoColumns": [ - null,null,null,null,null,null,{ "sType": "title-string" },null,{ "sType": "title-string" },null - ], - 'aoColumnDefs': [ + "aoColumnDefs": [ + { "sType": "title-string", "aTargets" : [ "title-string" ] }, + { "sType": "title-numeric", "aTargets" : [ "title-numeric" ] }, { 'aTargets': [-1], 'bSortable': false } ] })); @@ -97,13 +96,13 @@ $(document).ready(function() { No. Name - Item count - Biblio count + Item count + Biblio count Items expected Created by - Date + Date Basket group - Closed + Closed   @@ -117,16 +116,18 @@ $(document).ready(function() { [% basket.basketno %] [% basket.basketname %] - [% basket.total_items %] - [% IF basket.total_items_cancelled %] - ([% basket.total_items_cancelled %] cancelled) - [% END %] + [% basket.total_items %] + [% IF basket.total_items_cancelled %] + ([% basket.total_items_cancelled %] cancelled) + [% END %] + - [% basket.total_biblios %] - [% IF basket.total_biblios_cancelled %] - ([% basket.total_biblios_cancelled %] cancelled) - [% END %] + [% basket.total_biblios %] + [% IF basket.total_biblios_cancelled %] + ([% basket.total_biblios_cancelled %] cancelled) + [% END %] + [% basket.expected_items %] @@ -140,7 +141,7 @@ $(document).ready(function() { [% IF basketgroup.closed %] [% basketgroup.name %] (closed) [% ELSE %] - [% basketgroup.name %] + [% basketgroup.name %] [% END %] [% END %] -- 1.7.9.5