Bug 9945: Changed display: inline to inline-block on the inline CSS styling on the...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / authorised_values.tt
index 4acaac3..44906a9 100644 (file)
@@ -5,24 +5,45 @@
 [% IF ( delete_confirm ) %] › Confirm deletion[% END %]
 [% IF ( else ) %]Authorized values[% 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_authorized_values").tablesorter({
-               sortList: [[1,0]],
-               headers: { 4: { sorter: false}, 5: { sorter: false}}
-                               }).tablesorterPager({container: $("#pagertable_authorized_values"),positionFixed: false,size: 50});
-       
-}); </script>
 
-<script type="text/JavaScript" language="JavaScript">
+<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[
-     $(document).ready(function() {
-        $('#icons').tabs();
-     });
+ $(document).ready(function() {
+    $("#table_authorized_values").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
+        ],
+        "aaSorting": [[ 1, "asc" ]],
+        "iDisplayLength": 20,
+        "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
+        "sPaginationType": "four_button"
+    }));
+
+    if ( $("#branches option:selected").length < 1 ) {
+        $("#branches option:first").attr("selected", "selected");
+    }
+    $('#icons').tabs();
+});
 //]]>
 </script>
+
+[% IF ( else ) %]
+<script type="text/javascript">
+//<![CDATA[
+$(document).ready(function() {
+    $('#category').find("input:submit").hide();
+    $('#searchfield').change(function() {
+        $('#category').submit();
+    });
+});
+//]]>
+</script>
+[% END %]
+
 <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 : #F4F8F9; }
@@ -60,7 +81,7 @@
         <fieldset class="rows"><ol>
         <li>
                         [% IF ( action_add_category ) %]<label for="category">Category</label>
-               <input type="text" name="category"  id="category" size="10" maxlength="10" />
+            <input type="text" name="category"  id="category" size="10" maxlength="10" class="focus" />
                         [% ELSE %]<span class="label">Category</span>
                <input type="hidden" name="category" value="[% category %]" />   [% category %]
                         [% END %]
         <li>
             <label for="authorised_value">Authorized value</label>
      [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id %]" />[% END %]
+            [% IF ( action_add_category ) %]
             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" />
+            [% ELSE %]
+            <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" class="focus" />
+            [% END %]
         </li>
         <li>
             <label for="lib">Description</label>
             <label for="lib_opac">Description (OPAC)</label>
             <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="200" />
         </li>
+        <li><label for="branches">Branches limitation: </label>
+            <select id="branches" name="branches" multiple size="10">
+                <option value="">All branches</option>
+                [% FOREACH branch IN branches_loop %]
+                  [% IF ( branch.selected ) %]
+                    <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                  [% ELSE %]
+                    <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                  [% END %]
+                [% END %]
+            </select>
+            <span>Select All if this authorised value must to be displayed all the time. Otherwise select librairies you want to associate with this value.
+            </span>
+        </li>
+
                </ol>
         <div id="icons" class="toptabs" style="clear:both">
         <h5 style="margin-left:10px;">Choose an icon:</h5>
   [% 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 %]
 
 [% IF ( else ) %]
 
-<div id="toolbar">
-       <script type="text/javascript">
-       //<![CDATA[
-
-       // prepare DOM for YUI Toolbar
-
-        $(document).ready(function() {
-           yuiToolbar();
-               $('#category').find("input:submit").hide();
-               $('#searchfield').change(function() {
-               $('#category').submit();
-               });
-        });
-
-       // YUI Toolbar Functions
-
-       function yuiToolbar() {
-           new YAHOO.widget.Button("addauth");
-           new YAHOO.widget.Button("addcat");
-       }
-
-       //]]>
-       </script>
-       <ul class="toolbar">
-     <li><a id="addauth" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;category=[% category %]">New authorized value for [% category %]</a></li>
-    <li><a id="addcat" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form">New category</a></li>
-</ul></div>
+<div id="toolbar" class="btn-toolbar">
+    <a id="addauth" class="btn btn-small" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;category=[% category %]">New authorized value for [% category %]</a>
+    <a id="addcat" class="btn btn-small" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form">New category</a>
+</div>
 
 <h1>Authorized values</h1>
 <div class="note"><strong>NOTE:</strong> If you change an authorized value, existing records using it won't be updated.</div>
 <h3>Authorized values for category [% category %]:</h3>
 
 [% IF ( loop ) %]<div id="pagertable_authorized_values">
-[% INCLUDE 'table-pager.inc' perpage='50' %]
 </div>[% END %]
 
 [% IF ( loop ) %]<table id="table_authorized_values" class="tablesorter">
        <th>Description</th>
        <th>Description (OPAC)</th>
        <th>Icon</th>
+    <th>Branches limitations</th>
        <th>Edit</th>
        <th>Delete</th>
        </tr>
        <td>[% loo.lib %]</td>
        <td>[% loo.lib_opac %]</td>
        <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
+    <td>
+        [% IF loo.branches.size > 0 %]
+            [% branches_str = "" %]
+            [% FOREACH branch IN loo.branches %]
+                [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
+            [% END %]
+            <span href="#" title="[% branches_str %]">
+                [% IF loo.branches.size > 1 %]
+                    [% loo.branches.size %] branches limitations
+                [% ELSE %]
+                    [% loo.branches.size %] branch limitation
+                [% END %]
+        [% ELSE %]
+            No limitation
+        [% END %]
+    </td>
        <td><a href="[% loo.edit %]">Edit</a></td>
        <td><a href="[% loo.delete %]">Delete</a></td>
 </tr>