Bug 7523: Improve checks for routing permissions
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / serials-home.tt
index 56a8214..bb0f9d3 100644 (file)
@@ -1,18 +1,22 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Serials [% biblionumber %]</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.tablesorter.min.js"></script>
+<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() {
-        $("#srlt").tablesorter({
-            headers: {
-                2: { sorter: false },
-                4: { sorter: false },
-                               5: { sorter: false }
-            }
-        }); 
- }); 
+    var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
+        ],
+        "sPaginationType": "four_button"
+    } ) );
+
+    srlt.fnAddFilters("filter", 750);
+ });
  //]]>
 </script>
 </head>
@@ -80,28 +84,34 @@ Serials updated :
             <th>Title</th>
             <th> Notes </th>
             <th>
-                Library (Callnumber)
+                Library (callnumber)
             </th>
-            [% IF ( routing ) %]
+            [% IF ( routing && CAN_user_serials_routing ) %]
               <th>Routing list</th>
             [% END %]        
-            <th colspan="2">&nbsp;</th>
+            <th>&nbsp;</th>
+            <th>&nbsp;</th>
         </tr>
        </thead>
+    <tfoot>
+        <tr>
+            <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
+            <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
+            <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
+            <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
+            [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
+            <td></td>
+            <td></td>
+        </tr>
+    </tfoot>
        <tbody> 
         [% FOREACH subscription IN subscriptions %]
-        [% UNLESS ( loop.odd ) %]
-            <tr class="highlight">
-        [% ELSE %]
             <tr>
-        [% END %]
                 <td>
                 [% IF ( subscription.issn ) %][% subscription.issn %]
                 [% END %]
                 </td>
-                <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% IF ( subscription.title ) %][% subscription.title |html %][% ELSE %]
-                    ---
-                [% END %]</a>
+                <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
                 </td>
                 <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
                 [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
@@ -110,20 +120,20 @@ Serials updated :
                 [% IF ( subscription.branchcode ) %][% subscription.branchcode %][% END %]
                 [% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %]
                 </td>
-                [% IF ( subscription.routing ) %]
+                [% IF ( routing && CAN_user_serials_routing ) %]
                 <td>
-                [% IF ( subscription.cannotedit ) %]
-                  &nbsp;        
-                [% ELSE %]
-                    [% IF ( subscription.routingedit ) %]
-                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
-                       [% ELSE %]
-                                               <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
-                                       [% END %]
-                [% END %]
+                    [% IF ( subscription.cannotedit ) %]
+                        &nbsp;
+                    [% ELSE %]
+                        [% IF ( subscription.routingedit ) %]
+                            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
+                        [% ELSE %]
+                            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
+                        [% END %]
+                    [% END %]
                 </td>
                 [% END %]
-                <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue History</a>
+                <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
                 </td>
                 <td>
                 [% IF ( subscription.cannotedit ) %]