Bug 14405: Add datatables to fines table in OPAC
authorAleisha Amohia <aleishaamohia@hotmail.com>
Thu, 2 Feb 2017 04:16:53 +0000 (04:16 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 17 Feb 2017 17:12:21 +0000 (17:12 +0000)
To test:
1) Apply patch
2) Go to OPAC -> Your account
3) Confirm you can now sort on all columns

Sponsored-by: Catalyst IT
NOTE: NICE!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt

index b46cae0..319029a 100644 (file)
@@ -3,11 +3,12 @@
 [% USE Price %]
 [% SET ENABLE_OPAC_PAYMENTS = Koha.Preference('EnablePayPalOpacPayments') %]
 [% SET DISPLAY_PAYMENT_BLOCK = 0 %]
-
 [% INCLUDE 'doc-head-open.inc' %]
 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your fines and charges</title>
 [% INCLUDE 'doc-head-close.inc' %]
-[% BLOCK cssinclude %][% END %]
+[% BLOCK cssinclude %]
+    <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
+[% END %]
 </head>
 
 [% INCLUDE 'bodytag.inc' bodyid='opac-account' bodyclass='scrollto' %]
@@ -66,7 +67,7 @@
 
                     [% IF ( ACCOUNT_LINES ) %]
                         <form method="post" action="opac-account-pay.pl" class="form-horizontal">
-                        <table class="table table-bordered table-striped">
+                        <table class="table table-bordered table-striped" id="finestable">
                             <thead>
                                 <tr>
                                     [% IF ENABLE_OPAC_PAYMENTS %]<th>&nbsp;</th>[% END %]
 
 [% INCLUDE 'opac-bottom.inc' %]
 [% BLOCK jsinclude %]
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 $( document ).ready(function() {
 
+    $("#finestable").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "sPaginationType": "four_button"
+    }));
+
     $(".paypal").on("click", function() {
         window.open('https://www.paypal.com/webapps/mpp/paypal-popup','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700');
         return false;