Bug 16239: Update templates
[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
3 [% IF op == 'add_form' %]
4   [% IF ( action_modify ) %] &rsaquo; Modify authorized value[% END %]
5   [% IF ( action_add_value ) %] &rsaquo;  New authorized value[% END %]
6   [% IF ( action_add_category ) %] &rsaquo; New category[% END %]
7 [% END %]
8 </title>
9 [% INCLUDE 'doc-head-close.inc' %]
10
11 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
12 [% INCLUDE 'datatables.inc' %]
13 <script type="text/javascript">
14 //<![CDATA[
15  $(document).ready(function() {
16     $("#table_authorized_values").dataTable($.extend(true, {}, dataTablesDefaults, {
17         "aoColumnDefs": [
18             { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
19         ],
20         "aaSorting": [[ 1, "asc" ]],
21         "sPaginationType": "four_button"
22     }));
23
24     if ( $("#branches option:selected").length < 1 ) {
25         $("#branches option:first").attr("selected", "selected");
26     }
27     $('#icons').tabs();
28
29     $("a.delete").click(function(){
30         return confirm(_("Are you sure you want to delete this authorized value?"));
31     });
32 });
33 //]]>
34 </script>
35
36 [% IF op == 'list' %]
37 <script type="text/javascript">
38 //<![CDATA[
39 $(document).ready(function() {
40     $('#category').find("input:submit").hide();
41     $('#searchfield').change(function() {
42         $('#category').submit();
43     });
44 });
45 //]]>
46 </script>
47 [% END %]
48
49 <style type="text/css">
50         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
51     fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
52         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
53     fieldset.rows .ui-tabs-nav { margin-left : 10px; }
54 </style>
55 </head>
56 <body id="admin_authorised_values" class="admin">
57 [% INCLUDE 'header.inc' %]
58 [% INCLUDE 'cat-search.inc' %]
59 <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 op == 'add_form' %] <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a> &rsaquo; [% IF ( action_modify ) %]Modify authorized value[% END %]
60            [% IF ( action_add_value ) %]New authorized value[% END %]
61            [% IF ( action_add_category ) %]New category[% END %][% END %]
62 [% IF op == 'list' %]Authorized values[% END %]</div>
63
64 <div id="doc3" class="yui-t2">
65    
66    <div id="bd">
67         <div id="yui-main">
68         <div class="yui-b">
69
70 [% IF op == 'add_form' %]
71         <h1>
72            [% IF ( action_modify ) %]Modify authorized value[% END %]
73            [% IF ( action_add_value ) %]New authorized value[% END %]
74            [% IF ( action_add_category ) %]New category[% END %]
75         </h1>
76
77     [% IF ( action_modify ) %]<div class="note"><i class="fa fa-exclamation"></i> <strong>NOTE:</strong> If you change an authorized value code, existing records using it won't be updated. Changes to value descriptions will show immediately.</div>[% END %]
78
79  <form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post" class="validated">
80         <fieldset class="rows"><ol>
81         [% IF action_add_category %]
82             <li>
83                 <label for="category" class="required">Category: </label>
84                 <input type="text" name="category"  id="category" size="32" maxlength="32" class="focus required" />
85                 <span class="required">Required</span>
86                 <input type="hidden" name="op" value="add_category" />
87             </li>
88         [% ELSE %]
89             <li>
90                 <span class="label">Category</span>
91                 <input type="hidden" name="op" value="add" />
92                 <input type="hidden" name="category" value="[% category %]" /> [% category %]
93             </li>
94         <li>
95             <label for="authorised_value">Authorized value: </label>
96             [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id %]" />[% END %]
97             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" class="focus" />
98         </li>
99         <li>
100             <label for="lib">Description: </label>
101             <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="200" />
102         </li>
103         <li>
104             <label for="lib_opac">Description (OPAC): </label>
105             <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="200" />
106         </li>
107         <li><label for="branches">Libraries limitation: </label>
108             <select id="branches" name="branches" multiple size="10">
109                 <option value="">All libraries</option>
110                 [% FOREACH branch IN branches_loop %]
111                   [% IF ( branch.selected ) %]
112                     <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
113                   [% ELSE %]
114                     <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
115                   [% END %]
116                 [% END %]
117             </select>
118             <span>Select 'All libraries' if this authorized value must be displayed all the time. Otherwise select libraries you want to associate with this value.</span>
119         </li>
120
121                 </ol>
122         <div id="icons" class="toptabs" style="clear:both">
123         <h5 style="margin-left:10px;">Choose an icon:</h5>
124                         <ul>
125                   <li><a href="#none">None</a></li>
126                                   [% FOREACH imageset IN imagesets %]
127                         [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
128                                   [% END %]
129                         </ul>
130   <div id="none"><ul>
131   <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
132   </ul>
133   <br class="clear" /></div>
134   [% FOREACH imageset IN imagesets %]
135   <div id="[% imageset.imagesetname %]"><ul>
136   [% FOREACH image IN imageset.images %]
137                         <li style="float: none; display: inline-block; clear : none; width: auto;">
138             <label> [% IF ( image.StaffImageUrl ) %]
139               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
140         [% ELSE %]
141         [% END %]
142     [% IF ( image.checked ) %]
143               <input type="radio" name="imageurl" value="[% image.KohaImage %]" checked="checked" />
144     [% ELSE %]
145               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
146               <input type="radio" name="imageurl" value="[% image.KohaImage %]" />
147               [% END %]
148     [% END %]
149             </label>
150                         </li>
151   [% END %]</ul>
152   <br class="clear" />
153   </div>
154   [% END %]
155   </div>
156         [% END %]
157         </fieldset>
158        <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
159         <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category %]">Cancel</a></fieldset>
160     </form>
161 [% END %]
162
163
164 [% IF op == 'list' %]
165
166 <div id="toolbar" class="btn-toolbar">
167     <a id="addauth" class="btn btn-default btn-sm" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;category=[% category %]"><i class="fa fa-plus"> </i> New authorized value for [% category %]</a>
168     <a id="addcat" class="btn btn-default btn-sm" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form"><i class="fa fa-plus"> </i> New category</a>
169 </div>
170
171 <h1>Authorized values</h1>
172 <div class="note"><i class="fa fa-exclamation"></i> <strong>NOTE:</strong> If you change an authorized value code, existing records using it won't be updated. Changes to value descriptions will show immediately.</div>
173
174 [% FOR m IN messages %]
175     <div class="dialog [% m.type %]">
176         [% SWITCH m.code %]
177         [% CASE 'error_on_update' %]
178             An error occurred when updating this authorized value. Perhaps the value already exists.
179         [% CASE 'error_on_insert' %]
180             An error occurred when inserting this authorized value. Perhaps the value or the category already exists.
181         [% CASE 'error_on_insert_cat' %]
182             An error occurred when inserting this authorized value category. Perhaps the category name already exists.
183         [% CASE 'error_on_delete' %]
184             An error occurred when deleting this authorized value. Check the logs.
185         [% CASE 'success_on_update' %]
186             Authorized value updated successfully.
187         [% CASE 'success_on_insert' %]
188             Authorized value added successfully.
189         [% CASE 'success_on_insert_cat' %]
190             Authorized value category added successfully.
191         [% CASE 'success_on_delete' %]
192             Authorized value deleted successfully.
193         [% CASE 'already_exists' %]
194             This authorized value already exists.
195         [% CASE 'cat_already_exists' %]
196             This authorized value category already exists.
197         [% CASE 'invalid_category_name' %]
198             The authorized value category 'branches', 'itemtypes' and 'cn_source' are used internally by Koha and are not valid.
199         [% CASE %]
200             [% m.code %]
201         [% END %]
202     </div>
203 [% END %]
204
205 <form action="/cgi-bin/koha/admin/authorised_values.pl" method="post" id="category">
206   <label for="searchfield">Show category: </label>
207   <select name="searchfield" id="searchfield" size="1">
208   [% FOR c IN categories %]
209     [% IF c == searchfield %]
210       <option value="[% c %]" selected="selected">[% c %]</option>
211     [% ELSE %]
212       <option value="[% c %]">[% c %]</option>
213     [% END %]
214   [% END %]
215   <input type="submit" value="Submit" />
216 </form>
217 [% IF ( category == 'Bsort1' ) %]
218     <p>An authorized value attached to patrons, that can be used for stats purposes</p>
219 [% END %]
220 [% IF ( category == 'Bsort2' ) %]
221     <p>An authorized value attached to patrons, that can be used for stats purposes</p>
222 [% END %]
223 [% IF ( category == 'Asort1' ) %]
224     <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
225 [% END %]
226 [% IF ( category == 'Asort2' ) %]
227     <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
228 [% END %]
229 [% IF ( category == 'SUGGEST' ) %]
230     <p>Reasons to reject or accept patron suggestions</p>
231 [% END %]
232 [% IF ( category == 'DAMAGED' ) %]
233     <p>Statuses to describe a damaged item</p>
234 [% END %]
235 [% IF ( category == 'LOST' ) %]
236    <p>Statuses to describe a lost item</p>
237 [% END %]
238 [% IF ( category == 'MANUAL_INV' ) %]
239     <p>Additional values for manual invoice types</p>
240 [% END %]
241 [% IF ( category == 'BOR_NOTES' ) %]
242     <p>Values for custom patron notes</p>
243 [% END %]
244 [% IF ( category == 'LOC' ) %]
245     <p>Values for shelving locations</p>
246 [% END %]
247 [% IF ( category == 'CCODE' ) %]
248     <p>Values for collection codes</p>
249  [% END %]
250  [% IF ( category == 'NOT_LOAN' ) %]
251     <p>Statuses to describe why an item is not for loan</p>
252  [% END %]
253 <h3>Authorized values for category [% category %]:</h3>
254
255 [% IF ( loop ) %]<div id="pagertable_authorized_values">
256 </div>[% END %]
257
258 [% IF ( loop ) %]<table id="table_authorized_values">
259 <thead><tr>
260         <th>Authorized value</th>
261         <th>Description</th>
262         <th>Description (OPAC)</th>
263         <th>Icon</th>
264     <th>Branches limitations</th>
265     <th>Actions</th>
266         </tr>
267 </thead><tbody>
268 [% FOREACH loo IN loop %]
269 [% UNLESS ( loop.odd ) %]
270 <tr>
271 [% ELSE %]
272 <tr>
273 [% END %]
274         <td>[% loo.authorised_value %]</td>
275         <td>[% loo.lib %]</td>
276         <td>[% loo.lib_opac %]</td>
277         <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
278     <td>
279         [% IF loo.branches.size > 0 %]
280             [% branches_str = "" %]
281             [% FOREACH branch IN loo.branches %]
282                 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
283             [% END %]
284             <span href="#" title="[% branches_str %]">
285                 [% IF loo.branches.size > 1 %]
286                     [% loo.branches.size %] branches limitations
287                 [% ELSE %]
288                     [% loo.branches.size %] branch limitation
289                 [% END %]
290         [% ELSE %]
291             No limitation
292         [% END %]
293     </td>
294     <td class="actions"><a href="/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;id=[% loo.id %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
295     <a class="delete btn btn-default btn-xs" href="/cgi-bin/koha/admin/authorised_values.pl?op=delete&amp;searchfield=[% searchfield %]&amp;id=[% loo.id %]"><i class="fa fa-trash"></i> Delete</a></td>
296 </tr>
297 [% END %]
298 </tbody></table>[% ELSE %]
299 <div class="dialog message">There are no authorized values defined for [% category %]</div>
300 [% END %]
301
302 [% IF ( isprevpage ) %]
303 <form class="inline" action="/cgi-bin/koha/admin/authorised_values.pl" method="post">
304 <input type="hidden" name="searchfield" value="[% searchfield %]" />
305         <input type="submit" value="&lt;&lt; Previous" /></form>
306 [% END %] 
307
308 [% END %]
309
310 </div>
311 </div>
312 <div class="yui-b">
313 [% INCLUDE 'admin-menu.inc' %]
314 </div>
315 </div>
316 [% INCLUDE 'intranet-bottom.inc' %]