diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js
index d2433926af..cca389d8db 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js
+++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js
@@ -471,6 +471,7 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, {
} );
}());
+
/* Plugin to allow sorting on data stored in a span's title attribute
*
* Ex:
[% formatted_date %] |
@@ -495,7 +496,6 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, {
}
} );
-
/* Plugin to allow sorting on numeric data stored in a span's title attribute
*
* Ex:
@@ -566,3 +566,17 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, {
});
}());
+
+// 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 7e5b0af340..d8d370e392 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
|