Bugzilla – Attachment 7719 Details for
Bug 5345
DataTables in Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
parcel.tt
0001-Bug-5345-DataTables-integration-in-acquisition-modul.patch (text/plain), 5.51 KB, created by
Jonathan Druart
on 2012-02-17 15:02:30 UTC
(
hide
)
Description:
parcel.tt
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-02-17 15:02:30 UTC
Size:
5.51 KB
patch
obsolete
>From 5a5ec0c96408ec18ebbe50f3bbc1f5050c0cba51 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 17 Feb 2012 15:53:24 +0100 >Subject: [PATCH 01/16] Bug 5345: DataTables integration in acquisition module > [1] > >parcel.tt >--- > koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 16 ++++++ > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 58 +++++++++++++------- > 2 files changed, 54 insertions(+), 20 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..d435535 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js >@@ -382,3 +382,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 eb5492e..0a70181 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' %] > <title>Koha › Acquisitions › [% IF ( date ) %] > Receipt Summary for [% name %] [% IF ( invoice ) %]Invoice [% invoice %][% END %] on [% formatteddatereceived %][% ELSE %]Receive Orders from [% name %][% END %]</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> > [% INCLUDE 'greybox.inc' %] > <script type="text/javascript" src="[% yuipath %]/json/json-min.js"></script> >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> > <script type="text/javascript"> > //<![CDATA[ > > var rowsToCollapse = 5; > >- $.tablesorter.addParser({ >- id: 'articles', >- is: function(s) {return false; }, >- format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, >- type: 'text' >- }); >- > $(document).ready(function(){ >- $("#pendingt").tablesorter({ >- headers: { 2: { sorter: 'articles' },3: { sorter: false },7:{sorter:false}} >- }); >+ var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ 3, 7, 8 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aoColumns": [ >+ { "sType": "num-html" }, >+ { "sType": "num-html" }, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null, >+ ], >+ "sPaginationType": "four_button" >+ } ) ); >+ var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ 3 ], "bSortable": false, "bSearchable": false }, >+ ], >+ "aoColumns": [ >+ { "sType": "num-html" }, >+ { "sType": "num-html" }, >+ null, >+ null, >+ null, >+ null, >+ null, >+ null, >+ ], >+ "sPaginationType": "four_button" >+ } ) ); > > rowCountPending = $("#pendingt tbody.filterclass tr").length; > rowCountReceived = $("#receivedt tbody.filterclass tr").length; >@@ -229,11 +255,7 @@ > </tfoot> > <tbody class="filterclass"> > [% FOREACH loop_order IN loop_orders %] >- [% UNLESS ( loop.odd ) %] >- <tr class="highlight"> >- [% ELSE %] > <tr> >- [% END %] > <td class="basketfilterclass"><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketno %]</a></td> > <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&booksellerid=[% loop_order.supplierid %]">[% loop_order.ordernumber %]</a></td> > <td class="summaryfilterclass"> >@@ -313,7 +335,7 @@ > <th>TOTAL</th> > </tr> > </thead> >-<tfoot> >+ <tfoot> > <tr> > <td colspan="4" class="total">SUBTOTAL</td> > <td colspan="2"> </td> >@@ -350,11 +372,7 @@ > </tfoot> > <tbody class="filterclass"> > [% FOREACH loop_receive IN loop_received %] >- [% UNLESS ( loop.odd ) %] >- <tr class="highlight"> >- [% ELSE %] > <tr> >- [% END %] > <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_receive.basketno %]">[% loop_receive.basketno %]</a></td> > <td><a href="neworderempty.pl?ordernumber=[% loop_receive.ordernumber %]&booksellerid=[% supplierid %]">[% loop_receive.ordernumber %]</a></td> > <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_receive.biblionumber %]">[% loop_receive.title |html %]</a> >-- >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 5345
:
7719
|
7720
|
7721
|
7722
|
7723
|
7724
|
7725
|
7726
|
7727
|
7728
|
7729
|
7730
|
7731
|
7732
|
7733
|
7734
|
8039
|
8040
|
8057
|
8058
|
8292
|
8830
|
8831
|
8833
|
8834
|
8835
|
8836
|
8837
|
9519
|
9601
|
9602