Bugzilla – Attachment 15889 Details for
Bug 9747
sort issue for the z3950 results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9747: Fix sorting issues on z3950 search results
Bug-9747-Fix-sorting-issues-on-z3950-search-result.patch (text/plain), 2.53 KB, created by
Jonathan Druart
on 2013-03-05 13:01:17 UTC
(
hide
)
Description:
Bug 9747: Fix sorting issues on z3950 search results
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-03-05 13:01:17 UTC
Size:
2.53 KB
patch
obsolete
>From 7773462b511f616aa74481ca11d2d56644de2699 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 5 Mar 2013 13:52:20 +0100 >Subject: [PATCH] Bug 9747: Fix sorting issues on z3950 search results >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >At least the BNF server returns results containing non-sorting >characters (NSB SNE). >In order to sort results according these characters, this patch adds a >new Datatable function. > >Test plan: >- search 'tintin' on the z3950 search (cataloguing/z3950_search.pl) >- sort on title (default sort) and check that results are not well > sorted. >- apply this patch >- do the same search and check that the first result is "Hergé. Les > Aventures de Tintin..." > The value of the cell is: > <td>ÂHergé. Les ÂAventures de Tintin...</td> >--- > koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 14 ++++++++++++++ > .../prog/en/modules/cataloguing/z3950_search.tt | 1 + > 2 files changed, 15 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js >index b43f2f8..710bdd8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js >@@ -414,3 +414,17 @@ $.fn.dataTableExt.oSort['num-html-desc'] = function(a,b) { > y = parseFloat( y ); > return ((x < y) ? 1 : ((x > y) ? -1 : 0)); > }; >+ >+// Remove string between NSB NSB characters >+$.fn.dataTableExt.oSort['nsb-nse-asc'] = function(a,b) { >+ var pattern = new RegExp("\x88.*\x89"); >+ a = a.replace(pattern, ""); >+ b = b.replace(pattern, ""); >+ return (a > b) ? 1 : ((a < b) ? -1 : 0); >+} >+$.fn.dataTableExt.oSort['nsb-nse-desc'] = function(a,b) { >+ var pattern = new RegExp("\x88.*\x89"); >+ a = a.replace(pattern, ""); >+ b = b.replace(pattern, ""); >+ return (b > a) ? 1 : ((b < a) ? -1 : 0); >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >index c30d23b..abeb441 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt >@@ -33,6 +33,7 @@ $(document).ready(function(){ > "sDom": 't', > "aoColumnDefs": [ > { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [ 1 ], "sType": "nsb-nse" }, > ], > "aaSorting": [[ 1, "asc" ]], > "bPaginate": false >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9747
:
15889
|
16361
|
16461
|
18655
|
18656
|
18657
|
18669