[biblibre-newacq](bug #3611) use jquery table sorter
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Mon, 14 Sep 2009 15:40:28 +0000 (17:40 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 30 Sep 2009 09:30:32 +0000 (11:30 +0200)
This patch, modify tables to use the jquery plugin to sort tables.

koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl

index 7232ea9..8fbc961 100644 (file)
@@ -3,6 +3,7 @@
 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
 
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/acq.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">
 // #################################################################################
 // Javascript
                     alert(alertString2);
             }
     }
+       $(document).ready(function() { 
+                $("#periodsh").tablesorter({
+                   widgets : ['zebra'],
+                   sortList: [[0,0]]
+            });
+       });
 </script>
 
 <title>
 <!-- TMPL_IF name="else" -->
     <h2>Budget periods administration</h2>
     <!-- TMPL_IF name="cur" --><b>Currency = <!-- TMPL_VAR name="cur" --></b><!-- /TMPL_IF -->
-    <table>
-    <tr>
-        <th>Period Name</th>
-        <th>Start Date</th>
-        <th>End Date</th>
-        <th>Active</th>
-        <th>Locked</th>
-        <th>Total</th>
-        <th>Actions</th>
-    </tr>
-
+    <table id="periodsh">
+    <thead>
+           <tr>
+               <th>Period Name</th>
+               <th>Start Date</th>
+               <th>End Date</th>
+               <th>Active</th>
+               <th>Locked</th>
+               <th>Total</th>
+               <th>Actions</th>
+           </tr>
+       </thead>
+       <tbody>
     <!-- TMPL_LOOP name="period_loop" -->
         <!-- TMPL_IF NAME="__odd__" -->
             <tr>
         </td>
         </tr>
     <!-- /TMPL_LOOP -->
+    </tbody>
     </table>
     <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
 <!-- /TMPL_IF -->
index b48fd65..21464c7 100644 (file)
@@ -6,6 +6,7 @@
 <script type="text/javascript">
 //<![CDATA[
        //
+       
         var actTotal ="";
 
        function ownerRemove(f) {
        }
 //]]>
 </script>
+<!-- TMPL_ELSE -->
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript">
+//<![CDATA[
+       //
+       $(document).ready(function() { 
+                $("#budgeth").tablesorter({
+                   widgets : ['zebra'],
+                   sortList: [[0,0]]
+            });
+       });
+//]]>
+</script>
 <!-- /TMPL_IF -->
 
 </head>
 </fieldset>
 </form>
 
-<table>
-    <tr>
-    <th>Budget hierarchy</th>
-    <th>Budget name</th>
-    <th>Total<br>allocated</th>
-    <th>Base-level<br>allocated</th>
-    <th>Sub-level<br>allocated (unallocated)</th>
-    <th>Base-level<br>spent</th>
-    <th>Base-level<br>remaining</th>
-    <!--
-    <th>Sub-level<br>spent</th>
-    <th>Encum%</th>
-    <th>Expend%</th>
-    -->
-    <th>Owner</th>
-    <th>Branch</th>
-    <th>Note</th>
-    <th colspan="3">Actions</th>
-    </tr>
-
+<table id="budgeth">
+    <thead>
+       <tr>
+                   <th>Budget hierarchy</th>
+                   <th>Budget name</th>
+                   <th>Total<br>allocated</th>
+                   <th>Base-level<br>allocated</th>
+                   <th>Sub-level<br>allocated (unallocated)</th>
+                   <th>Base-level<br>spent</th>
+                   <th>Base-level<br>remaining</th>
+                   <!--
+                   <th>Sub-level<br>spent</th>
+                   <th>Encum%</th>
+                   <th>Expend%</th>
+                   -->
+                   <th>Owner</th>
+                   <th>Branch</th>
+                   <th>Note</th>
+                   <th colspan="3">Actions</th>
+       </tr>
+    </thead>
+       <tbody>
 <!-- TMPL_LOOP name="budget" -->
     <!-- TMPL_IF NAME="toggle" -->
     <tr class="highlight">
     <!-- /TMPL_IF -->
     </tr>
 <!-- /TMPL_LOOP -->
-
+       </tbody>
     <tfoot>
     <tr>
     <th colspan='2' style='text-align: left;' nowrap>Period allocated <!--TMPL_IF NAME="budget_period_total" --><!-- TMPL_VAR NAME='budget_period_total'--><!-- /TMPL_IF -->  </th>