From 9d198990cc793a0c30d58d89c9e55fa41e3feea2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 17 Feb 2012 15:55:18 +0100 Subject: [PATCH] [SIGNED-OFF] Bug 8099: DataTables integration in acquisition module [2] acqui-home.tt http://bugs.koha-community.org/show_bug.cgi?id=8099 Signed-off-by: Katrin Fischer --- koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 16 +++++++++++++++ .../prog/en/modules/acqui/acqui-home.tt | 21 ++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js index e0cc888..7eb70d4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js @@ -220,6 +220,22 @@ function dt_overwrite_html_sorting_localeCompare() { return (b > a) ? 1 : ((b < a) ? -1 : 0); } }; + + jQuery.fn.dataTableExt.oSort['num-html-asc'] = function(a,b) { + var x = a.replace( /<.*?>/g, "" ); + var y = b.replace( /<.*?>/g, "" ); + x = parseFloat( x ); + y = parseFloat( y ); + return ((x < y) ? -1 : ((x > y) ? 1 : 0)); + }; + + jQuery.fn.dataTableExt.oSort['num-html-desc'] = function(a,b) { + var x = a.replace( /<.*?>/g, "" ); + var y = b.replace( /<.*?>/g, "" ); + x = parseFloat( x ); + y = parseFloat( y ); + return ((x < y) ? 1 : ((x > y) ? -1 : 0)); + }; } // Sorting on string without accentued characters diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt index 7a44420..fa6ae53 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt @@ -1,8 +1,15 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions + [% INCLUDE 'doc-head-close.inc' %] + +[% INCLUDE 'datatables-strings.inc' %] + -- 1.7.9.5