Bug 23611: (follow-up) Exclude "actions" column from export
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / authorised_values.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha &rsaquo; Administration &rsaquo; Authorized values
6 [% IF op == 'add_form' %]
7   [% IF ( action_modify ) %] &rsaquo; Modify authorized value[% END %]
8   [% IF ( action_add_value ) %] &rsaquo;  New authorized value[% END %]
9   [% IF ( action_add_category ) %] &rsaquo; New category[% END %]
10 [% END %]
11 </title>
12 [% INCLUDE 'doc-head-close.inc' %]
13
14 <style>
15         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
16     fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
17         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
18     fieldset.rows .ui-tabs-nav { margin-left : 10px; }
19 </style>
20 </head>
21
22 <body id="admin_authorised_values" class="admin">
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'prefs-admin-search.inc' %]
25 <div id="breadcrumbs">
26     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
27     <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
28     [% IF op == 'add_form' %]
29         <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a> &rsaquo;
30         [% IF ( action_modify ) %]Modify authorized value[% END %]
31         [% IF ( action_add_value ) %]New authorized value[% END %]
32         [% IF ( action_add_category ) %]New category[% END %]
33     [% ELSIF ( loop ) %]
34         <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a> &rsaquo;
35         Authorized values for category [% category | html %]
36     [% ELSE %]
37         Authorized values
38     [% END %]
39 </div>
40
41 <div class="main container-fluid">
42     <div class="row">
43         <div class="col-sm-10 col-sm-push-2">
44             <main>
45
46 [% IF op == 'add_form' %]
47         <h1>
48            [% IF ( action_modify ) %]Modify authorized value[% END %]
49            [% IF ( action_add_value ) %]New authorized value[% END %]
50            [% IF ( action_add_category ) %]New category[% END %]
51         </h1>
52
53     [% 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 %]
54
55  <form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post" class="validated">
56         <fieldset class="rows"><ol>
57         [% IF action_add_category %]
58             <li>
59                 <label for="category" class="required">Category: </label>
60                 <input type="text" name="category"  id="category" size="32" maxlength="32" class="focus required" />
61                 <span class="required">Required</span>
62                 <input type="hidden" name="op" value="add_category" />
63             </li>
64         [% ELSE %]
65             <li>
66                 <span class="label">Category</span>
67                 <input type="hidden" name="op" value="add" />
68                 <input type="hidden" name="category" value="[% category | html %]" /> [% category | html %]
69             </li>
70         <li>
71             <label for="authorised_value">Authorized value: </label>
72             [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id | html %]" />[% END %]
73             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value | html %]" maxlength="80" class="focus" />
74         </li>
75         <li>
76             <label for="lib">Description: </label>
77             <input type="text" name="lib" id="lib" value="[% lib | html %]" maxlength="200" />
78         </li>
79         <li>
80             <label for="lib_opac">Description (OPAC): </label>
81             <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac | html %]" maxlength="200" />
82         </li>
83         <li><label for="branches">Library limitations: </label>
84             <select id="branches" name="branches" multiple size="10">
85                 <option value="">All libraries</option>
86                 [% FOREACH branch IN branches_loop %]
87                   [% IF ( branch.selected ) %]
88                     <option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
89                   [% ELSE %]
90                     <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
91                   [% END %]
92                 [% END %]
93             </select>
94             <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>
95         </li>
96
97                 </ol>
98         <div id="icons" class="toptabs" style="clear:both">
99         <h5 style="margin-left:10px;">Choose an icon:</h5>
100                         <ul>
101                   <li><a href="#none">None</a></li>
102                                   [% FOREACH imageset IN imagesets %]
103                         [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a></li>
104                                   [% END %]
105                         </ul>
106   <div id="none"><ul>
107   <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
108   </ul>
109   <br class="clear" /></div>
110   [% FOREACH imageset IN imagesets %]
111   <div id="[% imageset.imagesetname | html %]"><ul>
112   [% FOREACH image IN imageset.images %]
113                         <li style="float: none; display: inline-block; clear : none; width: auto;">
114             <label> [% IF ( image.StaffImageUrl ) %]
115               <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" />
116         [% ELSE %]
117         [% END %]
118     [% IF ( image.checked ) %]
119               <input type="radio" name="imageurl" value="[% image.KohaImage | html %]" checked="checked" />
120     [% ELSE %]
121               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
122               <input type="radio" name="imageurl" value="[% image.KohaImage | html %]" />
123               [% END %]
124     [% END %]
125             </label>
126                         </li>
127   [% END %]</ul>
128   <br class="clear" />
129   </div>
130   [% END %]
131   </div>
132         [% END %]
133         </fieldset>
134        <fieldset class="action"> <input type="hidden" name="id" value="[% id | html %]" />
135         <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category | url %]">Cancel</a></fieldset>
136     </form>
137 [% END %]
138
139 [% IF op == 'list' %]
140
141 <div id="toolbar" class="btn-toolbar">
142     <a id="addcat" class="btn btn-default" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form"><i class="fa fa-plus"> </i> New category</a>
143     [% IF ( searchfield ) %]
144         <a id="addauth" class="btn btn-default" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;category=[% category | url %]"><i class="fa fa-plus"> </i> New authorized value for [% category | html %]</a>
145     [% END %]
146 </div>
147
148 [% IF ( searchfield ) %]
149     <h1>Authorized values for category [% category | html %]</h1>
150     [% PROCESS category_descriptions code_category = category %]
151 [% ELSE %]
152     <h1>Authorized values</h1>
153 [% END %]
154
155 [% IF ( searchfield ) %]
156     <div class="note">
157         <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.
158     </div>
159 [% END %]
160
161 [% FOR m IN messages %]
162     <div class="dialog [% m.type | html %]">
163         [% SWITCH m.code %]
164         [% CASE 'error_on_update' %]
165             An error occurred when updating this authorized value. Perhaps the value already exists.
166         [% CASE 'error_on_insert' %]
167             An error occurred when inserting this authorized value. Perhaps the value or the category already exists.
168         [% CASE 'error_on_insert_cat' %]
169             An error occurred when inserting this authorized value category. Perhaps the category name already exists.
170         [% CASE 'error_on_delete' %]
171             An error occurred when deleting this authorized value. Check the logs.
172         [% CASE 'success_on_update' %]
173             Authorized value updated successfully.
174         [% CASE 'success_on_insert' %]
175             Authorized value added successfully.
176         [% CASE 'success_on_insert_cat' %]
177             Authorized value category added successfully.
178         [% CASE 'success_on_delete' %]
179             Authorized value deleted successfully.
180         [% CASE 'already_exists' %]
181             This authorized value already exists.
182         [% CASE 'cat_already_exists' %]
183             This authorized value category already exists.
184         [% CASE 'invalid_category_name' %]
185             The authorized value category 'branches', 'itemtypes' and 'cn_source' are used internally by Koha and are not valid.
186         [% CASE %]
187             [% m.code | html %]
188         [% END %]
189     </div>
190 [% END %]
191
192 [% IF ( searchfield ) %]
193
194     <form action="/cgi-bin/koha/admin/authorised_values.pl" method="get" id="category">
195         <p>
196             <label for="searchfield">Show category: </label>
197             <select name="searchfield" id="searchfield" size="1">
198                 [% FOR c IN categories %]
199                     [% IF c == searchfield %]
200                         <option value="[% c | html %]" selected="selected">[% c | html %]</option>
201                     [% ELSE %]
202                         <option value="[% c | html %]">[% c | html %]</option>
203                     [% END %]
204                 [% END %]
205             </select>
206             <input type="submit" value="Submit" />
207         </p>
208     </form>
209
210     [% IF loop %]
211
212     <table id="categoriest" class="authorized_values_table">
213     <thead><tr>
214         <th>Authorized value</th>
215         <th>Description</th>
216         <th>Description (OPAC)</th>
217         <th>Icon</th>
218         <th>Library limitations</th>
219         <th class="noExport">Actions</th>
220         </tr>
221     </thead><tbody>
222     [% FOREACH loo IN loop %]
223     <tr>
224         <td>[% loo.authorised_value | html %]</td>
225         <td>[% loo.lib | html %]</td>
226         <td>[% loo.lib_opac | html %]</td>
227         <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl | url %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
228         <td>
229             [% IF loo.branches.size > 0 %]
230                 [% branches_str = "" %]
231                 [% FOREACH branch IN loo.branches %]
232                     [%- IF loop.first -%]
233                     [% branches_str = branch.branchname _ " (" _ branch.branchcode _ ")" %]
234                     [% ELSE %]
235                     [% branches_str = branches_str _ "\n" _ branch.branchname _ " (" _ branch.branchcode _ ")" %]
236                     [% END %]
237                 [% END %]
238                 <span class="library_limitation" title="[% branches_str | html %]">
239                     [% IF loo.branches.size > 1 %]
240                         [% loo.branches.size | html %] library limitations
241                     [% ELSE %]
242                         [% loo.branches.size | html %] library limitation
243                     [% END %]
244             [% ELSE %]
245                 No limitation
246             [% END %]
247         </td>
248         <td class="actions"><a href="/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;id=[% loo.id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
249         <a class="delete btn btn-default btn-xs" href="/cgi-bin/koha/admin/authorised_values.pl?op=delete&amp;searchfield=[% searchfield | uri %]&amp;id=[% loo.id | uri %]"><i class="fa fa-trash"></i> Delete</a></td>
250     </tr>
251     [% END # /FOREACH loop %]
252     </tbody></table>
253     [% ELSE %]
254         <div class="dialog message">
255             <p>There are no authorized values defined for [% category | html %]</p>
256             <form action="/cgi-bin/koha/admin/authorised_values.pl" method="get">
257                 <input type="hidden" name="op" value="add_form" />
258                 <input type="hidden" name="category" value="[% category | html %]" />
259                 <button type="submit"><i class="fa fa-plus"></i> Add a new authorized value</button>
260             </form>
261         </div>
262     [% END %]
263
264 [% ELSE # category was selected %]
265
266     <table id="categoriest" class="authorized_values_table">
267         <thead>
268             <tr>
269                 <th>Category</th>
270                 <th>Description</th>
271                 <th class="noExport">&nbsp;</th>
272             </tr>
273         </thead>
274         <tbody>
275             [% FOR c IN categories %]
276                 <tr>
277                     <td><a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% c | uri %]">[% c | html %]</a></td>
278                     <td>
279                         [% PROCESS category_descriptions code_category = c %]
280                     </td>
281                     <td>
282                         <a id="addauth" class="btn btn-default btn-xs" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;category=[% c | uri %]"><i class="fa fa-plus"> </i> Add</a>
283                     </td>
284                 </tr>
285             [% END %]
286         </tbody>
287     </table>
288 [% END # /IF ( searchfield  )%]
289
290 [% END # /IF op == 'list' %]
291
292             </main>
293         </div> <!-- /.col-sm-10.col-sm-push-2 -->
294
295         <div class="col-sm-2 col-sm-pull-10">
296             <aside>
297                 [% INCLUDE 'admin-menu.inc' %]
298             </aside>
299         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
300      </div> <!-- /.row -->
301
302 [% MACRO jsinclude BLOCK %]
303     [% Asset.js("js/admin-menu.js") | $raw %]
304     [% INCLUDE 'datatables.inc' %]
305     [% INCLUDE 'columns_settings.inc' %]
306     <script>
307         $(document).ready(function() {
308             var columns_settings = []; // Empty because there are no columns we want to be configurable
309
310             KohaTable("categoriest", {
311                 "aoColumnDefs": [
312                     { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
313                 ],
314                 "aaSorting": [[ 0, "asc" ]],
315                 "sPaginationType": "full"
316             }, columns_settings);
317
318             if ( $("#branches option:selected").length < 1 ) {
319                 $("#branches option:first").attr("selected", "selected");
320             }
321             $('#icons').tabs();
322
323             $("a.delete").click(function(){
324                 return confirm(_("Are you sure you want to delete this authorized value?"));
325             });
326             $('#category').find("input:submit").hide();
327             $('#searchfield').change(function() {
328                 $('#category').submit();
329             });
330             $(".library_limitation").tooltip();
331         });
332     </script>
333 [% END %]
334
335 [% BLOCK category_descriptions %]
336     [% SWITCH code_category %]
337         [% CASE 'Asort1' %]
338             <p>Used for acquisitions statistical purposes</p>
339         [% CASE 'Asort2' %]
340             <p>Used for acquisitions statistical purposes</p>
341         [% CASE 'BOR_NOTES' %]
342             <p>Values for custom patron messages that appear on the circulation screen and the OPAC. The value in the description field should be the message text and is limited to 200 characters</p>
343         [% CASE 'branches' %]
344             <p></p>
345         [% CASE 'Bsort1' %]
346             <p>Values that can be entered to fill in the patron’s sort 2 field</p>
347         [% CASE 'Bsort2' %]
348             <p>An authorized value attached to patrons, that can be used for statistical purposes</p>
349         [% CASE 'CAND' %]
350             <p></p>
351         [% CASE 'CCODE' %]
352             <p>Collection codes (appears when cataloging and working with items)</p>
353         [% CASE 'cn_source' %]
354             <p></p>
355         [% CASE 'CONTROL_NUM_SEQUENCE' %]
356             <p></p>
357         [% CASE 'COUNTRY' %]
358             <p>Used in UNIMARC 102 $a</p>
359         [% CASE 'DAMAGED' %]
360             <p>Descriptions for items marked as damaged (appears when cataloging and working with items)</p>
361         [% CASE 'DEPARTMENT' %]
362             <p>Departments are required by and will be used in the Course Reserves module</p>
363         [% CASE 'ETAT' %]
364             <p>Used in French UNIMARC installations in field 995 $o to identify item status. Similar to NOT_LOAN</p>
365         [% CASE 'HINGS_AS' %]
366             <p>General holdings: acquisition status designator :: This data element specifies acquisition status for the unit at the time of the holdings report.</p>
367         [% CASE 'HINGS_C' %]
368             <p>General holdings: completeness designator</p>
369         [% CASE 'HINGS_PF' %]
370             <p>Physical form designators</p>
371         [% CASE 'HINGS_RD' %]
372             <p>General holdings: retention designator :: This data element specifies the retention policy for the unit at the time of the holdings report.</p>
373         [% CASE 'HINGS_UT' %]
374             <p>General holdings: type of unit designator</p>
375         [% CASE 'HSBND_FREQ' %]
376             <p>Frequencies used by the housebound module. They are displayed on the housebound tab in the patron account in staff.</p>
377         [% CASE 'ITEMTYPECAT' %]
378             <p>Allows multiple Item types to be searched in a category. Categories can be entered into the Authorized value ITEMTYPECAT. To combine Item types to this category, enter this Search category to any Item types</p>
379         [% CASE 'itemtypes' %]
380             <p></p>
381         [% CASE 'LANG' %]
382             <p>ISO 639-2 standard language codes</p>
383         [% CASE 'LOC' %]
384             <p>Shelving location (usually appears when adding or editing an item). LOC maps to items.location in the Koha database.</p>
385         [% CASE 'LOST' %]
386             <p>Descriptions for the items marked as lost (appears when adding or editing an item)</p>
387         [% CASE 'MANUAL_INV' %]
388             <p>Values for manual invoicing types</p>
389         [% CASE 'NOT_LOAN' %]
390             <p>Reasons why a title is not for loan</p>
391         [% CASE 'OPAC_SUG' %]
392             <p>A list of reasons displayed in the suggestion form on the OPAC.</p>
393         [% CASE 'ORDER_CANCELLATION_REASON' %]
394             <p>Reasons why an order might have been cancelled</p>
395         [% CASE 'PAYMENT_TYPE' %]
396             <p>Populates a dropdown list of custom payment types when paying fines</p>
397         [% CASE 'qualif' %]
398             <p>Function codes (author, editor, collaborator, etc.) used in UNIMARC 7XX $4 (French)</p>
399         [% CASE 'RELTERMS' %]
400             <p>French terms of relations</p>
401         [% CASE 'REPORT_GROUP' %]
402             <p>A way to sort and filter your reports, the default values in this category include the Koha modules (Accounts, Acquitisions, Catalog, Circulation, Patrons)</p>
403         [% CASE 'REPORT_SUBGROUP' %]
404             <p>Can be used to further sort and filter your reports. This category is empty by default. Values here need to include the authorized value code from REPORT_GROUP in the Description (OPAC) field to link the subgroup to the appropriate group.</p>
405         [% CASE 'RESTRICTED' %]
406             <p>Restricted status of an item</p>
407         [% CASE 'ROADTYPE' %]
408             <p>Road types to be used in patron addresses</p>
409         [% CASE 'SIP_MEDIA_TYPE' %]
410             <p>Used when creating or editing an item type to assign a SIP specific media type for devices like lockers and sorters.</p>
411         [% CASE 'STACK' %]
412             <p>Shelving control number</p>
413         [% CASE 'SUGGEST' %]
414             <p>List of patron suggestion reject or accept reasons (appears when managing suggestions)</p>
415         [% CASE 'SUGGEST_FORMAT' %]
416             <p>List of Item types to display in a drop down menu on the Purchase suggestion form on the OPAC. When creating the authorized values for SUGGEST_FORMAT, enter a description into this form so it is visible on the OPAC to patrons.</p>
417         [% CASE 'SUGGEST_STATUS' %]
418             <p>A list of additional custom status values for suggestions that can be used in addition to the default values.</p>
419         [% CASE 'TERM' %]
420             <p>Terms to be used in Course Reserves module. Enter terms that will show in the drop down menu when setting up a Course reserve. (For example: Spring, Summer, Winter, Fall).</p>
421         [% CASE 'WITHDRAWN' %]
422             <p>Description of a withdrawn item (appears when adding or editing an item)</p>
423         [% CASE 'YES_NO' %]
424             <p>A generic authorized value field that can be used anywhere you need a simple yes/no pull down menu.</p>
425     [% END %]
426 [% END %]
427
428 [% INCLUDE 'intranet-bottom.inc' %]