Bug 5345: DataTables integration in acquisition module [12]
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / parcels.tt
index fb937f0..2e70f3c 100644 (file)
@@ -1,9 +1,22 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Acquisitions &rsaquo; Receive shipment from vendor [% name %]</title>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.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[
+ $(document).ready(function() {
+    var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "sPaginationType": "four_button"
+    } ) );
+ });
+ //]]>
+</script>
 </head>
-<body>
+<body id="acq_parcels" class="acq">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'acquisitions-search.inc' %]
 
 <div id="resultlist">
 <!-- Search Results Table -->
 
-<table class="small">
+<table class="small" id="parcelst">
+    <thead>
         <tr>
             <th>Line</th>
-            <th>Date Received</th>
-            <th>Invoice Number</th>
-            <th>Item Count</th>
+            <th>Date received</th>
+            <th>Invoice number</th>
+            <th>Item count</th>
             <th>Biblio count</th>
             <th>Items expected</th>
         </tr>
-<!-- Actual Search Results -->
-[% FOREACH searchresult IN searchresults %]
-    [% UNLESS ( loop.odd ) %]
-    <tr class="highlight">
-    [% ELSE %]
-    <tr>
+    </thead>
+    <tbody>
+    <!-- Actual Search Results -->
+    [% FOREACH searchresult IN searchresults %]
+        [% UNLESS ( loop.odd ) %]
+        <tr class="highlight">
+        [% ELSE %]
+        <tr>
+        [% END %]
+            <td>
+                [% searchresult.number %]
+            </td>
+            <td>
+                <a href="/cgi-bin/koha/acqui/parcel.pl?type=intra&amp;booksellerid=[% booksellerid |url %]&amp;datereceived=[% searchresult.raw_datereceived |url %][% IF ( searchresult.code ) %]&amp;invoice=[% searchresult.code |url %][% END %]">
+                    [% searchresult.datereceived %]</a>
+            </td>
+            <td>
+                [% IF ( searchresult.code ) %][% searchresult.code %][% ELSE %]<acronym title="not available">n/a</acronym>[% END %]
+            </td>
+            <td>
+                [% searchresult.reccount %]
+            </td>
+            <td>
+                [% searchresult.bibcount %]
+            </td>
+            <td>
+                [% searchresult.itemcount %]
+            </td>
+        </tr>
     [% END %]
-        <td>
-            [% searchresult.number %]
-        </td>
-        <td>
-            <a href="/cgi-bin/koha/acqui/parcel.pl?type=intra&amp;booksellerid=[% booksellerid |url %]&amp;datereceived=[% searchresult.raw_datereceived |url %][% IF ( searchresult.code ) %]&amp;invoice=[% searchresult.code |url %][% END %]">
-                [% searchresult.datereceived %]</a>
-        </td>
-        <td>
-            [% IF ( searchresult.code ) %][% searchresult.code %][% ELSE %]<acronym title="not available">n/a</acronym>[% END %]
-        </td>
-        <td>
-            [% searchresult.reccount %] 
-        </td>
-        <td>
-            [% searchresult.bibcount %]
-        </td>
-        <td>
-            [% searchresult.itemcount %]
-        </td>
-    </tr>
-[% END %]
+    </tbody>
 </table>
 
 <div id="resultnumber">
     <fieldset class="rows">
     <legend>Receive a new shipment</legend>
        <ol> <li>
-            <label for="invoice">Vendor Invoice </label>
+            <label for="invoice">Vendor invoice </label>
             <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
             <input type="hidden" name="op" value="new" />
                        <input type="text" size="20" id="invoice" name="invoice" />
                 <label for="dateto">To:</label><input type="text" size="9" id="dateto" name="dateto" value="[% dateto %]" /></li>
             <li><label for="orderby">Sort by :</label><select name="orderby" id="orderby">
                 <option value="aqorders.booksellerinvoicenumber">Invoice number</option>
-                <option value="datereceived"> Date Received</option>
-                <option value="datereceived desc"> Date Received reverse</option>
+                <option value="datereceived"> Date received</option>
+                <option value="datereceived desc"> Date received reverse</option>
                 <option value="aqorders.booksellerinvoicenumber desc"> Invoice number reverse</option>
                 </select><br />
                 <label for="resultsperpage">Results per page :</label><select name="resultsperpage" id="resultsperpage">