Bugzilla – Attachment 9782 Details for
Bug 8099
DataTables in Acquisision module: acqui-home.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5345: DataTables integration in acquisition module [2]
Bug-5345-DataTables-integration-in-acquisition-mod.patch (text/plain), 2.94 KB, created by
Jonathan Druart
on 2012-05-25 15:02:07 UTC
(
hide
)
Description:
Bug 5345: DataTables integration in acquisition module [2]
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-05-25 15:02:07 UTC
Size:
2.94 KB
patch
obsolete
>From 0a676baa8bc63e12137124ea6aa696907a5d21c2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >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' %] > <title>Koha › Acquisitions</title> >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> >+[% INCLUDE 'datatables-strings.inc' %] >+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> > <script type="text/javascript"> > //<![CDATA[ >+ >+dt_overwrite_html_sorting_localeCompare(); >+ > $(document).ready(function() { > $('#showallbudgets').click(function() { > if ( $('#showallbudgets:checked').val() !== undefined) { >@@ -18,6 +25,20 @@ $(document).ready(function() { > $('.bu_active').hide(); > } > }); >+ var srlt = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumns": [ >+ null, >+ null, >+ null, >+ null, >+ { "sType": "num-html" }, >+ { "sType": "num-html" }, >+ null, >+ ], >+ 'bPaginate': false, >+ 'bFilter': false, >+ 'bInfo': false, >+ } ) ); > }); > //]]> > </script> >-- >1.7.7.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8099
:
9605
|
9782
|
10193