From 364b9a2da9c28eeff5451dad7b394cb4fafb9ab9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 17 Feb 2012 15:55:18 +0100 Subject: [PATCH] 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 Signed-off-by: Paul Poulain --- .../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 e0cc888f59..7eb70d4012 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 7a4442049a..fa6ae53ed7 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' %] + -- 2.39.5