From c3f16aa97dfc821473e890502624806f0fbe25b9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 7 Jun 2012 12:45:05 +0200 Subject: [PATCH] Bug : DataTables integration in acquisition module [1] parcel.tt http://bugs.koha-community.org/show_bug.cgi?id=8098 Signed-off-by: Katrin Fischer Fixed bug number. Signed-off-by: Paul Poulain --- .../intranet-tmpl/prog/en/js/datatables.js | 16 +++++ .../prog/en/modules/acqui/parcel.tt | 60 ++++++++++++------- 2 files changed, 55 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js index 7eb70d4012..bbb119ecd5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js @@ -398,3 +398,19 @@ $.fn.dataTableExt.oPagination.four_button = { } } }; + +$.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)); +}; + +$.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)); +}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index c3b169d830..7b0f7ca1e8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -1,26 +1,52 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Acquisitions › [% IF ( date ) %] Receipt summary for [% name %] [% IF ( invoice ) %]invoice [% invoice %][% END %] on [% formatteddatereceived %][% ELSE %]Receive orders from [% name %][% END %] + [% INCLUDE 'doc-head-close.inc' %] + +[% INCLUDE 'datatables-strings.inc' %] + [% INCLUDE 'greybox.inc' %] -