Bug 11739 - Use new DataTables include in notices template
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / letter.tt
index dd32550..95c55e5 100644 (file)
@@ -1,24 +1,28 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Tools &rsaquo; Notices[% IF ( add_form ) %][% IF ( modify ) %] &rsaquo; Modify notice[% ELSE %] &rsaquo; Add notice[% END %][% END %][% IF ( add_validate ) %] &rsaquo; Notice added[% END %][% IF ( delete_confirm ) %] &rsaquo; Confirm deletion[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-       <script type="text/javascript">
-       //<![CDATA[
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
+<script type="text/javascript">
+//<![CDATA[
 $(document).ready(function() {
-       $("#lettert:has(tbody tr)").tablesorter({
-               widgets : ['zebra'],
-               sortList: [[0,0]],
-               headers: { 3: {sorter:false},4: { sorter: false }}
-       }); 
-
-    $('#branch').change(function() {
+    $("#lettert:has(tbody tr)").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "sDom": 't',
+        "aoColumnDefs": [
+            { "aTargets": [ -1,-2, -3 ], "bSortable": false, "bSearchable": false }
+        ],
+        "bPaginate": false
+    }));
+    [% IF no_op_set %]
+      $('#branch').change(function() {
             $('#op').val("");
             $('#selectlibrary').submit();
-    });
-    $('#newnotice').click(function() {
+      });
+      $('#newnotice').click(function() {
             $('#op').val("add_form");
             return true;
-    });
+      });
+    [% END %]
 }); 
 [% IF ( add_form ) %]
        
@@ -130,6 +134,7 @@ $(document).ready(function() {
        <div class="yui-b">
 
 [% IF ( no_op_set ) %]
+    <h1>Notices and Slips</h1>
     <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
       <input type="hidden" name="searchfield" value="[% searchfield %]" />
     [% UNLESS independant_branch %]
@@ -143,10 +148,10 @@ $(document).ready(function() {
             </select>
       </p>
     [% END %]
-      <p>
+      <div id="toolbar">
              <input type="submit" id="newnotice" value="New Notice" />
         <input type="hidden" id="op" name="op" />
-      </p>
+      </div>
     </form>
 
                [% IF ( search ) %]
@@ -156,18 +161,20 @@ $(document).ready(function() {
             [% select_for_copy = BLOCK %]
             <select name="branchcode">
                 [% FOREACH branchloo IN branchloop %]
-                <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
+                <option value="[% branchloo.value %]">Copy to [% branchloo.branchname %]</option>
                 [% END %]
             </select>
             [% END %]
         [% END %]
+
+[% IF ( letter ) %]
         <table id="lettert">
                <thead><tr>
                        <th>Library</th>
                        <th>Module</th>
                        <th>Code</th>
                        <th>Name</th>
-                       <th>&nbsp;</th>
+            <th>Copy notice</th>
                        <th>&nbsp;</th>
                        <th>&nbsp;</th>
                </tr></thead>
@@ -183,12 +190,7 @@ $(document).ready(function() {
                                <td>[% lette.module %]</td>
                                <td>[% lette.code %]</td>
                                <td>[% lette.name %]</td>
-                               <td>
-        [% IF can_edit %]
-                                       <a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;branchcode=[% lette.branchcode %]&amp;module=[% lette.module %]&amp;code=[% lette.code %]">Edit</a>
-        [% END %]
-                               </td>
-                               <td>
+                               <td style="white-space: nowrap">
         [% IF !independant_branch || !lette.branchcode %]
                     <form method="post" action="/cgi-bin/koha/tools/letter.pl">
                         <input type="hidden" name="op" value="copy" />
@@ -203,6 +205,11 @@ $(document).ready(function() {
                         <input type="submit" value="Copy" />
                     </form>
         [% END %]
+                </td>
+                <td>
+        [% IF can_edit %]
+                    <a href="/cgi-bin/koha/tools/letter.pl?op=add_form&amp;branchcode=[% lette.branchcode %]&amp;module=[% lette.module %]&amp;code=[% lette.code %]">Edit</a>
+        [% END %]
                                </td>
                                <td>
         [% IF !lette.protected && can_edit %]
@@ -213,11 +220,20 @@ $(document).ready(function() {
     [% END %]
         </tbody>
                </table>
+[% ELSE %]
+    <div class="dialog message">
+        [% IF ( branchcode ) %]
+           <p>There are no notices for this library.</p>
+        [% ELSE %]
+            <p>There are no notices.</p>
+        [% END %]
+    </div>
+[% END %]
 [% END %]
 
        
 [% IF ( add_form ) %]
-       
+<h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
                <form action="?" name="Aform" method="post">
                <input type="hidden" name="op" id="op" value="add_validate" />
                <input type="hidden" name="checked" value="0" />
@@ -227,7 +243,6 @@ $(document).ready(function() {
                <input type="hidden" name="add" value="1" />
                [% END %]
                <fieldset class="rows">
-               <legend>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</legend>
                                <input type="hidden" name="oldbranchcode" value="[% branchcode %]" />
             [% IF independant_branch %]
                 <input type="hidden" name="branchcode" value="[% independant_branch %]" />
@@ -319,6 +334,7 @@ $(document).ready(function() {
 
                </li>
                </ol>
+                [% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %]
                </fieldset>
                <fieldset class="action"><input type="button" value="Submit" onclick="Check(this.form)" class="button" /> <a class="cancel" href="/cgi-bin/koha/tools/letter.pl">Cancel</a></fieldset>
       <input type="hidden" name="searchfield" value="[% searchfield %]" />