Bug 11765 - Remove unused function isDate from templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / letter.tt
index c156e01..d4c864b 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: { 4: {sorter:false},5: { sorter: false },6: { 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 ) %]
        
@@ -34,13 +38,7 @@ $(document).ready(function() {
                        }
                        return true;
                }
-       
-               function toUC(f) {
-                       var x=f.value.toUpperCase();
-                       f.value=x;
-                       return true;
-               }
-       
+
                function isNum(v,maybenull) {
                var n = new Number(v.value);
                if (isNaN(n)) {
@@ -51,14 +49,7 @@ $(document).ready(function() {
                }
                return true;
                }
-       
-               function isDate(f) {
-                       var t = Date.parse(f.value);
-                       if (isNaN(t)) {
-                               return false;
-                       }
-               }
-       
+
                function Check(f) {
                        var ok=1;
                        var _alertString="";
@@ -162,6 +153,8 @@ $(document).ready(function() {
             </select>
             [% END %]
         [% END %]
+
+[% IF ( letter ) %]
         <table id="lettert">
                <thead><tr>
                        <th>Library</th>
@@ -184,7 +177,7 @@ $(document).ready(function() {
                                <td>[% lette.module %]</td>
                                <td>[% lette.code %]</td>
                                <td>[% lette.name %]</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" />
@@ -214,6 +207,15 @@ $(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 %]