Merge branch 'bug_7143' into 3.12-master
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / authorised_values.tt
index 3af0724..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">
@@ -60,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" style="clear:both">
         <h5 style="margin-left:10px;">Choose an icon:</h5>
        <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>