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