Merge branch 'bug_7143' into 3.12-master
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / authorised_values.tt
index 0deebe1..e464617 100644 (file)
                sortList: [[1,0]],
                headers: { 4: { sorter: false}, 5: { sorter: false}}
                                }).tablesorterPager({container: $("#pagertable_authorized_values"),positionFixed: false,size: 50});
-       
+
+    if ( $("#branches option:selected").length < 1 ) {
+        $("#branches option:first").attr("selected", "selected");
+    }
 }); </script>
 
 <script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
      $(document).ready(function() {
-        $('#icons > ul').tabs();
+        $('#icons').tabs();
      });
 //]]>
 </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_authorised_values" class="admin">
@@ -59,7 +63,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>
-            <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="80" />
+            <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="200" />
         </li>
        <li>
             <label for="lib_opac">Description (OPAC)</label>
-            <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="80" />
+            <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">
+        <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/authorised_values.pl?op=add_form&amp;category=[% category %]#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/authorised_values.pl?op=add_form&amp;category=[% imageset.category %]#[% 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 %]
                        </ul>
-               </div>
   <div id="none"><ul>
   <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
   </ul>
   <br class="clear" />
   </div>
   [% END %]
-  
+  </div>
         </fieldset>
        <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
         <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category %]">Cancel</a></fieldset>
        <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>