Bug 10513: display a warning/message when returning a chosen item type
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / itemtypes.tt
index 16cd705..7d8f781 100644 (file)
@@ -18,16 +18,10 @@ Data deleted
 [% 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" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
-<script type="text/javascript" id="js">$(document).ready(function() {
-       // call the tablesorter plugin
-       $("#table_item_type").tablesorter({
-               sortList: [[1,0]],
-               headers: { 0: { sorter: false},5: { sorter: false}}
-                               }).tablesorterPager({container: $("#pagertable_item_type"),positionFixed: false,size: 10});
-       
-}); </script>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+<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[
 
@@ -85,14 +79,23 @@ function Check(f) {
        }
 }
      $(document).ready(function() {
-        $('#icons > ul').tabs();
+        $('#icons').tabs();
+        $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "aoColumnDefs": [
+                { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+            ],
+            "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
+            "aaSorting": [[ 2, "asc" ]],
+            "iDisplayLength": 10
+        }));
      });
 //]]>
 </script>
 <style type="text/css">
        fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
-       fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-selected {background-color : transparent; }
+  fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-selected {background-color : #F4F8F9; }
        fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
+  fieldset.rows .ui-tabs-nav { margin-left : 10px; }
 </style>
 </head>
 <body id="admin_itemtypes" class="admin">
@@ -126,27 +129,9 @@ Item types administration
        <div id="yui-main">
        <div class="yui-b">
        
-[% IF ( else ) %]<div id="toolbar">
-       <script type="text/javascript">
-       //<![CDATA[
-
-       // prepare DOM for YUI Toolbar
-
-        $(document).ready(function() {
-           yuiToolbar();
-        });
-
-       // YUI Toolbar Functions
-
-       function yuiToolbar() {
-           new YAHOO.widget.Button("newitemtype");
-       }
-
-       //]]>
-       </script>
-       <ul class="toolbar">
-    <li><a id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form">New item type</a></li>
-</ul></div>[% ELSE %]&nbsp;[% END %]
+[% IF ( else ) %]<div id="toolbar" class="btn-toolbar">
+    <a class="btn btn-small" id="newitemtype" href="/cgi-bin/koha/admin/itemtypes.pl?op=add_form"><i class="icon-plus"></i> New item type</a>
+</div>[% END %]
 
 [% IF ( add_form ) %]
   [% IF ( itemtype ) %]
@@ -162,38 +147,41 @@ Item types administration
        <ol>
   [% IF ( itemtype ) %]
       <li>
-          <span class="label">Item type</span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
+          <span class="label">Item type</span> <input type="hidden" name="itemtype" value="[% itemtype %]" />
           [% itemtype %]
      </li>
   [% ELSE %]
       <li>
-          <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" />
+          <label for="itemtype">Item type: </label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" class="focus" />
       </li>
   [% END %]
       <li>
-          <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" />      </li>
+      [% IF ( itemtype ) %]
+          <label for="description">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" class="focus" /></li>
+      [% ELSE %]
+          <label for="description">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" /></li>
+      [% END %]
      [% IF ( noItemTypeImages ) %]
         <li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
         [% ELSE %]</ol>
-               <div id="icons" class="toptabs">
+    <div id="icons" class="toptabs" style="clear:both">
         <h5 style="margin-left:10px;">Choose an icon:</h5>
                        <ul>
-                                       <li><a href="/cgi-bin/koha/admin/itemtypes.pl#none">None</a></li>
+          <li><a href="#none">None</a></li>
                                  [% FOREACH imageset IN imagesets %]
-            [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/admin/itemtypes.pl#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
+            [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
                                  [% END %]
-                  [% IF ( remote_image ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/admin/itemtypes.pl#remote">Remote image</a></li>
+                  [% IF ( remote_image ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="#remote">Remote image</a></li>
                        </ul>
-               </div>
   <div id="none"><ul>
   <li><label for="noimage">No image: </label><input type="radio" name="image" id="noimage" value="removeImage" /></li>
   </ul>
   <br class="clear" /></div>
-        
+
   [% FOREACH imageset IN imagesets %]
   <div id="[% imageset.imagesetname %]"><ul>
   [% FOREACH image IN imageset.images %]
-                       <li style="float: none; display: inline; clear : none; width: auto;">
+                       <li style="float: none; display: inline-block; clear : none; width: auto;">
             <label> [% IF ( image.StaffImageUrl ) %]
               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
         [% ELSE %]
@@ -225,9 +213,10 @@ Item types administration
   <br class="clear" />
 </div>
 [% END %]
+</div>
 <ol>
       <li>
-          <label for="notforloan">Not for loan</label>   [% IF ( notforloan ) %]
+          <label for="notforloan">Not for loan</label>   [% IF ( notforloan ) %]
                 <input type="checkbox" id="notforloan" name="notforloan" checked="checked" value="1" />
             [% ELSE %]
                 <input type="checkbox" id="notforloan" name="notforloan" value="1" />
@@ -239,6 +228,25 @@ Item types administration
           <label for="rentalcharge">Rental charge: </label>
                  <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% rentalcharge %]" />
          </li>
+      <li>
+          <label for="checkinmsg">Check in message: </label>
+          <input type="text" id="checkinmsg" name="checkinmsg" size="48" value="[% checkinmsg %]" />
+      </li>
+      <li>
+          <label for="checkinmsgtype">Check in message type: </label>
+          <select type="text" id="checkinmsgtype" name="checkinmsgtype">
+              [% IF ( checkinmsgtype == 'message' ) %]
+              <option value="message" selected="selected">Message</option>
+              [% ELSE %]
+                 <option value="message">Message</option>
+              [% END %]
+              [% IF ( checkinmsgtype == 'alert' ) %]
+              <option value="alert" selected="selected">Alert</option>
+              [% ELSE %]
+                  <option value="alert">Alert</option>
+              [% END %]
+          <select>
+      </li>
       <li>
           <label for="summary">Summary: </label>
          <textarea id="summary" name="summary" cols="55" rows="5">[% summary %]</textarea>
@@ -249,7 +257,7 @@ Item types administration
     </fieldset>
 
     <fieldset class="action">
-      <input type="button" value="Save Changes" onclick="Check(this.form)" />
+      <input type="button" value="Save changes" onclick="Check(this.form)" />
          <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
     </fieldset>
 </form>
@@ -285,9 +293,7 @@ Item types administration
 
 [% IF ( else ) %]
 <h2>Item types administration</h2>
-[% IF ( loop ) %]<div id="pagertable_item_type">
-[% INCLUDE 'table-pager.inc' perpage='10' %]
-</div>
+[% IF ( loop ) %]
 <table id="table_item_type">
   <thead>
     [% UNLESS ( noItemTypeImages ) %]<th>Image</th>[% END %]
@@ -295,6 +301,7 @@ Item types administration
     <th>Description</th>
     <th>Not for loan</th>
     <th>Charge</th>
+    <th>Check in message</th>
     <th>Actions</th>
   </thead>
   [% FOREACH loo IN loop %]
@@ -316,6 +323,7 @@ Item types administration
       [% loo.rentalcharge %]
     [% END %]
     </td>
+    <td>[% loo.checkinmsg %]</td>
     <td>
       <a href="[% loo.script_name %]?op=add_form&amp;itemtype=[% loo.itemtype |html %]">Edit</a>
       <a href="[% loo.script_name %]?op=delete_confirm&amp;itemtype=[% loo.itemtype |html %]">Delete</a>