Merge branch 'bug_8557' into 3.12-master
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / authorised_values.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Authorized values [% IF ( add_form ) %] &rsaquo; [% IF ( action_modify ) %]Modify authorized value[% END %]
3            [% IF ( action_add_value ) %] &rsaquo;  New authorized value[% END %]
4            [% IF ( action_add_category ) %] &rsaquo; New category[% END %][% END %]
5 [% IF ( delete_confirm ) %] &rsaquo; Confirm deletion[% END %]
6 [% IF ( else ) %]Authorized values[% END %]</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
9 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
10 <script type="text/javascript" id="js">$(document).ready(function() {
11         // call the tablesorter plugin
12         $("#table_authorized_values").tablesorter({
13                 sortList: [[1,0]],
14                 headers: { 4: { sorter: false}, 5: { sorter: false}}
15                                 }).tablesorterPager({container: $("#pagertable_authorized_values"),positionFixed: false,size: 50});
16
17     if ( $("#branches option:selected").length < 1 ) {
18         $("#branches option:first").attr("selected", "selected");
19     }
20 }); </script>
21
22 <script type="text/JavaScript" language="JavaScript">
23 //<![CDATA[
24      $(document).ready(function() {
25         $('#icons').tabs();
26      });
27 //]]>
28 </script>
29 <style type="text/css">
30         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
31     fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-selected {background-color : #F4F8F9; }
32         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
33     fieldset.rows .ui-tabs-nav { margin-left : 10px; }
34 </style>
35 </head>
36 <body id="admin_authorised_values" class="admin">
37 [% INCLUDE 'header.inc' %]
38 [% INCLUDE 'cat-search.inc' %]
39 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a> &rsaquo; [% IF ( action_modify ) %]Modify authorized value[% END %]
40            [% IF ( action_add_value ) %]New authorized value[% END %]
41            [% IF ( action_add_category ) %]New category[% END %][% END %]
42 [% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a> &rsaquo; Confirm deletion[% END %]
43 [% IF ( else ) %]Authorized values[% END %]</div>
44
45 <div id="doc3" class="yui-t2">
46    
47    <div id="bd">
48         <div id="yui-main">
49         <div class="yui-b">
50
51 [% IF ( add_form ) %]
52         <h1>
53            [% IF ( action_modify ) %]Modify authorized value[% END %]
54            [% IF ( action_add_value ) %]New authorized value[% END %]
55            [% IF ( action_add_category ) %]New category[% END %]
56         </h1>
57
58     [% IF ( action_modify ) %]<div class="note"><strong>NOTE:</strong> If you change an authorized value, existing records using it won't be updated.</div>[% END %]
59
60         <form action="[% script_name %]" name="Aform" method="post">
61         <input type="hidden" name="op" value="add_validate" />
62     <input type="hidden" name="offset" value="[% offset %]" />
63         <fieldset class="rows"><ol>
64         <li>
65                          [% IF ( action_add_category ) %]<label for="category">Category</label>
66             <input type="text" name="category"  id="category" size="10" maxlength="10" class="focus" />
67                          [% ELSE %]<span class="label">Category</span>
68                 <input type="hidden" name="category" value="[% category %]" />   [% category %]
69                          [% END %]
70         </li>
71         <li>
72             <label for="authorised_value">Authorized value</label>
73      [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id %]" />[% END %]
74             [% IF ( action_add_category ) %]
75             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" />
76             [% ELSE %]
77             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" class="focus" />
78             [% END %]
79         </li>
80         <li>
81             <label for="lib">Description</label>
82             <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="200" />
83         </li>
84         <li>
85             <label for="lib_opac">Description (OPAC)</label>
86             <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="200" />
87         </li>
88         <li><label for="branches">Branches limitation: </label>
89             <select id="branches" name="branches" multiple size="10">
90                 <option value="">All branches</option>
91                 [% FOREACH branch IN branches_loop %]
92                   [% IF ( branch.selected ) %]
93                     <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
94                   [% ELSE %]
95                     <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
96                   [% END %]
97                 [% END %]
98             </select>
99             <span>Select All if this authorised value must to be displayed all the time. Otherwise select librairies you want to associate with this value.
100             </span>
101         </li>
102
103                 </ol>
104         <div id="icons" class="toptabs" style="clear:both">
105         <h5 style="margin-left:10px;">Choose an icon:</h5>
106                         <ul>
107                   <li><a href="#none">None</a></li>
108                                   [% FOREACH imageset IN imagesets %]
109                         [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
110                                   [% END %]
111                         </ul>
112   <div id="none"><ul>
113   <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
114   </ul>
115   <br class="clear" /></div>
116   [% FOREACH imageset IN imagesets %]
117   <div id="[% imageset.imagesetname %]"><ul>
118   [% FOREACH image IN imageset.images %]
119                         <li style="float: none; display: inline; clear : none; width: auto;">
120             <label> [% IF ( image.StaffImageUrl ) %]
121               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
122         [% ELSE %]
123         [% END %]
124     [% IF ( image.checked ) %]
125               <input type="radio" name="imageurl" value="[% image.KohaImage %]" checked="checked" />
126     [% ELSE %]
127               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
128               <input type="radio" name="imageurl" value="[% image.KohaImage %]" />
129               [% END %]
130     [% END %]
131             </label>
132                         </li>
133   [% END %]</ul>
134   <br class="clear" />
135   </div>
136   [% END %]
137   </div>
138         </fieldset>
139        <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
140         <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category %]">Cancel</a></fieldset>
141     </form>
142 [% END %]
143
144
145 [% IF ( delete_confirm ) %]
146         <div class="dialog alert">
147 <h3>Confirm deletion</h3>
148 <table>
149         <tr>
150                 <th>Category</th>
151                 <th>Value</th>
152                 <th>Description</th>
153                 <th>Description (OPAC)</th>
154         </tr>
155         <tr>
156             <td>[% searchfield %]</td>
157             <td>[% Tvalue %]</td>
158             <td>[% Tlib %]</td>
159             <td>[% Tlib_opac %]</td>
160         </tr>
161         </table>
162         <form action="[% script_name %]" method="post">
163                 <input type="hidden" name="op" value="delete_confirmed" />
164                 <input type="hidden" name="id" value="[% id %]" />
165         <input type="hidden" name="searchfield" value="[% searchfield %]" /><fieldset class="action"><input type="submit" value="Yes, delete" class="approve" /></form>
166 <form action="[% script_name %]" method="get"><input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="submit" value="No, do not delete" class="deny" /></form>
167 </div>
168 [% END %]
169
170 [% IF ( else ) %]
171
172 <div id="toolbar">
173         <script type="text/javascript">
174         //<![CDATA[
175
176         // prepare DOM for YUI Toolbar
177
178          $(document).ready(function() {
179             yuiToolbar();
180                 $('#category').find("input:submit").hide();
181                 $('#searchfield').change(function() {
182                 $('#category').submit();
183                 });
184          });
185
186         // YUI Toolbar Functions
187
188         function yuiToolbar() {
189             new YAHOO.widget.Button("addauth");
190             new YAHOO.widget.Button("addcat");
191         }
192
193         //]]>
194         </script>
195         <ul class="toolbar">
196      <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>
197     <li><a id="addcat" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form">New category</a></li>
198 </ul></div>
199
200 <h1>Authorized values</h1>
201 <div class="note"><strong>NOTE:</strong> If you change an authorized value, existing records using it won't be updated.</div>
202
203 [% IF ( duplicate_category ) %]
204 <div class="dialog alert">Could not add value &quot;[% duplicate_value %]&quot; for category &quot;[% duplicate_category %]&quot; &mdash; value already present.
205 </div>
206 [% END %]
207 <form action="/cgi-bin/koha/admin/authorised_values.pl" method="post" id="category"><label for="searchfield">Show category: </label>[% tab_list %] <input type="submit" value="Submit" /></form>
208 [% IF ( category == 'Bsort1' ) %]
209     <p>An authorized value attached to patrons, that can be used for stats purposes</p>
210 [% END %]
211 [% IF ( category == 'Bsort2' ) %]
212     <p>An authorized value attached to patrons, that can be used for stats purposes</p>
213 [% END %]
214 [% IF ( category == 'Asort1' ) %]
215     <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
216 [% END %]
217 [% IF ( category == 'Asort2' ) %]
218     <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
219 [% END %]
220 [% IF ( category == 'SUGGEST' ) %]
221     <p>Reasons to reject or accept patron suggestions</p>
222 [% END %]
223 [% IF ( category == 'DAMAGED' ) %]
224     <p>Statuses to describe a damaged item</p>
225 [% END %]
226 [% IF ( category == 'LOST' ) %]
227    <p>Statuses to describe a lost item</p>
228 [% END %]
229 [% IF ( category == 'MANUAL_INV' ) %]
230     <p>Additional values for manual invoice types</p>
231 [% END %]
232 [% IF ( category == 'BOR_NOTES' ) %]
233     <p>Values for custom patron notes</p>
234 [% END %]
235 [% IF ( category == 'LOC' ) %]
236     <p>Values for shelving locations</p>
237 [% END %]
238 [% IF ( category == 'CCODE' ) %]
239     <p>Values for collection codes</p>
240  [% END %]
241  [% IF ( category == 'NOT_LOAN' ) %]
242     <p>Statuses to describe why an item is not for loan</p>
243  [% END %]
244 <h3>Authorized values for category [% category %]:</h3>
245
246 [% IF ( loop ) %]<div id="pagertable_authorized_values">
247 [% INCLUDE 'table-pager.inc' perpage='50' %]
248 </div>[% END %]
249
250 [% IF ( loop ) %]<table id="table_authorized_values" class="tablesorter">
251 <thead><tr>
252         <th>Authorized value</th>
253         <th>Description</th>
254         <th>Description (OPAC)</th>
255         <th>Icon</th>
256     <th>Branches limitations</th>
257         <th>Edit</th>
258         <th>Delete</th>
259         </tr>
260 </thead><tbody>
261 [% FOREACH loo IN loop %]
262 [% UNLESS ( loop.odd ) %]
263 <tr>
264 [% ELSE %]
265 <tr>
266 [% END %]
267         <td>[% loo.authorised_value %]</td>
268         <td>[% loo.lib %]</td>
269         <td>[% loo.lib_opac %]</td>
270         <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
271     <td>
272         [% IF loo.branches.size > 0 %]
273             [% branches_str = "" %]
274             [% FOREACH branch IN loo.branches %]
275                 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
276             [% END %]
277             <span href="#" title="[% branches_str %]">
278                 [% IF loo.branches.size > 1 %]
279                     [% loo.branches.size %] branches limitations
280                 [% ELSE %]
281                     [% loo.branches.size %] branch limitation
282                 [% END %]
283         [% ELSE %]
284             No limitation
285         [% END %]
286     </td>
287         <td><a href="[% loo.edit %]">Edit</a></td>
288         <td><a href="[% loo.delete %]">Delete</a></td>
289 </tr>
290 [% END %]
291 </tbody></table>[% ELSE %]
292 <div class="dialog message">There are no authorized values defined for [% category %]</div>
293 [% END %]
294
295 [% IF ( isprevpage ) %]
296 <form class="inline" action="[% script_name %]" method="post">
297 <input type="hidden" name="offset" value="[% prevpage %]" /><input type="hidden" name="searchfield" value="[% searchfield %]" />
298         <input type="submit" value="&lt;&lt; Previous" /></form>
299 [% END %] 
300
301 [% END %]
302
303 </div>
304 </div>
305 <div class="yui-b">
306 [% INCLUDE 'admin-menu.inc' %]
307 </div>
308 </div>
309 [% INCLUDE 'intranet-bottom.inc' %]