Bug 11513: fix log warning noise in patron category editor
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / categorie.tt
index e7e00d4..6106e5f 100644 (file)
@@ -1,3 +1,4 @@
+[% USE KohaDates -%]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Administration &rsaquo; Patron categories &rsaquo; [% IF ( add_form ) %][% IF ( categorycode ) %]Modify category '[% categorycode |html %]'[% ELSE %]New category[% END %][% END %]
 [% IF ( add_validate ) %]Data recorded[% END %]
@@ -5,23 +6,28 @@
 [% IF ( delete_confirmed ) %]Category deleted[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.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.tablesorter.pager.js"></script>
-<script type="text/javascript" id="js">$(document).ready(function() {
-       $("#table_categorie").tablesorter({
-               sortList: [[0,0]],
-               widgets: ['zebra'],
-               headers: { 11: { sorter: false}}
-       }).tablesorterPager({container: $("#pagertable_categorie"),positionFixed: false,size: 20});
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
+<script type="text/javascript" id="js">
+//<![CDATA[
+    $(document).ready(function() {
+        $("#table_categorie").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "aoColumnDefs": [
+                { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
+                { "aTargets": [ 3,4,5 ], "sType": "natural" },
+            ],
+            "aaSorting": [[ 1, "asc" ]],
+            "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
+            "iDisplayLength": 20,
+            "sPaginationType": "four_button"
+        }));
+
     $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
 
     if ( $("#branches option:selected").length < 1 ) {
         $("#branches option:first").attr("selected", "selected");
     }
-}); </script>
-<script type="text/javascript">
-//<![CDATA[
-       //
+});
        function isNotNull(f,noalert) {
                if (f.value.length ==0) {
    return false;
        [% END %]
        <fieldset class="rows">
        <ol>[% IF ( categorycode ) %]
-       <li><span class="label">Category code</span>[% categorycode |html %]
+    <li><span class="label">Category code: </span>[% categorycode |html %]
                                <input type="hidden" name="categorycode" value="[% categorycode |html %]" /><input type="hidden" name="is_a_modif" value="1" /></li>
        [% ELSE %]
-       <li><label for="categorycode">Category code: </label> <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
+    <li><label for="categorycode" class="required">Category code: </label> <input type="text" name="categorycode" id="categorycode" size="10" maxlength="10" onblur="toUC(this)" /></li>
        [% END %]
-       <li><label for="description">Description: </label> <input type="text" name="description" id="description" size="40" maxlength="80" value="[% description |html %]" /></li>
-       <li><label for="enrolmentperiod">Enrollment period: </label>
+    <li><label for="description" class="required">Description: </label> <input type="text" name="description" id="description" size="40" maxlength="80" value="[% description |html %]" /></li>
+    <li><label for="enrolmentperiod" class="required">Enrollment period: </label>
        <fieldset>
        <legend>Choose one</legend>
        <ol>
        <li><label for="enrolmentperiod" style="width:6em;">In months: </label>
                <input type="text" name="enrolmentperiod" id="enrolmentperiod" size="3" maxlength="3" value="[% IF ( enrolmentperiod ) %][% enrolmentperiod %][% END %]" /> months</li>
        <li><label for="enrolmentperioddate" style="width:6em;">Until date: </label>
-        <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate %]" />
+        <input type="text" name="enrolmentperioddate" id="enrolmentperioddate" value="[% enrolmentperioddate | $KohaDates %]" />
                <div id="enrolmentmessage" class="hint" style="margin-left:0;">Cannot have "months" and "until date" at the same time</div>
        </li>
        </ol>
                                                <option value="1">Yes</option>
                        [% END %]
                                        </select></li>
-       <li><label for="hidelostitems">Lost items in staff client</label> <select name="hidelostitems" id="hidelostitems">
+    <li><label for="hidelostitems">Lost items in staff client: </label> <select name="hidelostitems" id="hidelostitems">
                        [% IF ( hidelostitems ) %]
                                                <option value="0">Shown</option>
                                                <option value="1" selected="selected">Hidden by default</option>
                        [% END %]
                                        </select></li>
        <li><label for="reservefee">Hold fee: </label><input type="text" name="reservefee" id="reservefee" size="6" value="[% reservefee %]" /></li>
-       <li><label for="category_type">Category type: </label> <select name="category_type" id="category_type">
+    <li><label for="category_type" class="required">Category type: </label> <select name="category_type" id="category_type">
                         [% IF ( type_n ) %]<option value="" selected="selected">Select a category type</option>[% ELSE %]<option value="">Select a category type</option>[% END %]
                                        [% IF ( type_A ) %]<option value="A" selected="selected">Adult</option>[% ELSE %]<option value="A">Adult</option>[% END %]
                                        [% IF ( type_C ) %]<option value="C" selected="selected">Child</option>[% ELSE %]<option value="C">Child</option>[% END %]
@@ -276,10 +282,10 @@ Confirm deletion of category [% categorycode |html %][% END %]</legend>
        [% END %]
 [% IF ( loop ) %]
 <div id="pagertable_categorie">
-[% INCLUDE 'table-pager.inc' perpage='20' %]
 </div>
         <table id="table_categorie">
                <thead>
+        <tr>
                        <th scope="col">Code</th>
                        <th scope="col">Category name</th>
                        <th scope="col">Type</th>
@@ -294,8 +300,11 @@ Confirm deletion of category [% categorycode |html %][% END %]</legend>
             <th scope="col">Messaging</th>
             [% END %]
             <th scope="col">Branches limitations</th>
-                       <th scope="col" colspan="2">&nbsp; </th>
+            <th scope="col">&nbsp; </th>
+            <th scope="col">&nbsp; </th>
+        </tr>
                </thead>
+        <tbody>
                [% FOREACH loo IN loop %]
                        <tr>
                         <td>[% loo.categorycode |html %]</td>
@@ -368,6 +377,7 @@ Confirm deletion of category [% categorycode |html %][% END %]</legend>
                         <td><a href="[% loo.script_name %]?op=delete_confirm&amp;categorycode=[% loo.categorycode |uri %]">Delete</a></td>
                </tr>
                [% END %]
+        </tbody>
        </table>
 [% ELSE %]
        <div class="dialog alert">No categories have been defined. <a href="/cgi-bin/koha/admin/categorie.pl?op=add_form">Create a new category</a>.</div>