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