From 0a676baa8bc63e12137124ea6aa696907a5d21c2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 17 Feb 2012 15:55:18 +0100 Subject: [PATCH] Bug 5345: DataTables integration in acquisition module [2] acqui-home.tt http://bugs.koha-community.org/show_bug.cgi?id=8099 --- koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 16 +++++++++++++++ .../prog/en/modules/acqui/acqui-home.tt | 21 ++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) 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 f0e2942..0111ee2 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.7.3