Bug 28004: Fix breadcrumbs on authorised_values.tt
[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 || searchfield ) %]
34         <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a> &rsaquo;
35         Authorized values for category [% category.category_name | 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_name | html %]" /> [% category_name | 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_name | 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.category_name | url %]"><i class="fa fa-plus"> </i> New authorized value for [% category.category_name | html %]</a>
145     [% END %]
146 </div>
147
148 [% IF ( searchfield ) %]
149     <h1>Authorized values for category [% category.category_name | html %]</h1>
150     [% PROCESS category_descriptions code_category = category.category_name %]
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 'error_on_delete_category' %]
173             An error occurred when deleting this authorized value category. Check the logs.
174         [% CASE 'success_on_update' %]
175             Authorized value updated successfully.
176         [% CASE 'success_on_insert' %]
177             Authorized value added successfully.
178         [% CASE 'success_on_insert_cat' %]
179             Authorized value category added successfully.
180         [% CASE 'success_on_delete' %]
181             Authorized value deleted successfully.
182         [% CASE 'success_on_delete_category' %]
183             Authorized value category deleted successfully.
184         [% CASE 'cat_already_exists' %]
185             This authorized value category already exists.
186         [% CASE 'invalid_category_name' %]
187             The authorized value category 'branches', 'itemtypes' and 'cn_source' are used internally by Koha and are not valid.
188         [% CASE %]
189             [% m.code | html %]
190         [% END %]
191     </div>
192 [% END %]
193
194 [% IF ( searchfield ) %]
195
196     <form action="/cgi-bin/koha/admin/authorised_values.pl" method="get" id="category">
197         <p>
198             <label for="category_search">Show category: </label>
199             <select name="searchfield" id="category_search" size="1">
200                 [% FOR c IN categories %]
201                     [% IF c == searchfield %]
202                         <option value="[% c | html %]" selected="selected">[% c | html %]</option>
203                     [% ELSE %]
204                         <option value="[% c | html %]">[% c | html %]</option>
205                     [% END %]
206                 [% END %]
207             </select>
208         </p>
209     </form>
210
211     [% IF loop %]
212
213     <table id="categoriest" class="authorized_values_table">
214     <thead><tr>
215         <th>Authorized value</th>
216         <th>Description</th>
217         <th>Description (OPAC)</th>
218         <th>Icon</th>
219         <th>Library limitations</th>
220         <th class="noExport NoSort">Actions</th>
221         </tr>
222     </thead><tbody>
223     [% FOREACH loo IN loop %]
224     <tr>
225         <td>[% loo.authorised_value | html %]</td>
226         <td>[% loo.lib | html %]</td>
227         <td>[% loo.lib_opac | html %]</td>
228         <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl | url %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
229         <td>
230             [% IF loo.branches.size > 0 %]
231                 [% branches_str = "" %]
232                 [% FOREACH branch IN loo.branches %]
233                     [%- IF loop.first -%]
234                     [% branches_str = branch.branchname _ " (" _ branch.branchcode _ ")" %]
235                     [% ELSE %]
236                     [% branches_str = branches_str _ "\n" _ branch.branchname _ " (" _ branch.branchcode _ ")" %]
237                     [% END %]
238                 [% END %]
239                 <span class="library_limitation" title="[% branches_str | html %]">
240                     [% IF loo.branches.size > 1 %]
241                         [% loo.branches.size | html %] library limitations
242                     [% ELSE %]
243                         [% loo.branches.size | html %] library limitation
244                     [% END %]
245             [% ELSE %]
246                 No limitation
247             [% END %]
248         </td>
249         <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>
250         <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>
251     </tr>
252     [% END # /FOREACH loop %]
253     </tbody></table>
254     [% ELSE %]
255         <div class="dialog message">
256             <p>There are no authorized values defined for [% category.category_name | html %]</p>
257             <form action="/cgi-bin/koha/admin/authorised_values.pl" method="get">
258                 <input type="hidden" name="op" value="add_form" />
259                 <input type="hidden" name="category" value="[% category.category_name | html %]" />
260                 <button type="submit"><i class="fa fa-plus"></i> Add a new authorized value</button>
261             </form>
262             [% UNLESS category.is_system %]
263                 <form id="delete_category" action="/cgi-bin/koha/admin/authorised_values.pl" method="post">
264                     <input type="hidden" name="op" value="delete_category" />
265                     <input type="hidden" name="category_name" value="[% category.category_name | html %]" />
266                     <button type="submit"><i class="fa fa-plus"></i> Delete category '[% category.category_name | html %]' </button>
267                 </form>
268             [% END %]
269         </div>
270     [% END %]
271
272 [% ELSE # category was selected %]
273
274     <table id="categoriest" class="authorized_values_table">
275         <thead>
276             <tr>
277                 <th>Category</th>
278                 <th>Description</th>
279                 <th class="noExport">&nbsp;</th>
280             </tr>
281         </thead>
282         <tbody>
283             [% FOR c IN categories %]
284                 <tr>
285                     <td><a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% c | uri %]">[% c | html %]</a></td>
286                     <td>
287                         [% PROCESS category_descriptions code_category = c %]
288                     </td>
289                     <td>
290                         <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>
291                     </td>
292                 </tr>
293             [% END %]
294         </tbody>
295     </table>
296 [% END # /IF ( searchfield  )%]
297
298 [% END # /IF op == 'list' %]
299
300             </main>
301         </div> <!-- /.col-sm-10.col-sm-push-2 -->
302
303         <div class="col-sm-2 col-sm-pull-10">
304             <aside>
305                 [% INCLUDE 'admin-menu.inc' %]
306             </aside>
307         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
308      </div> <!-- /.row -->
309
310 [% MACRO jsinclude BLOCK %]
311     [% Asset.js("js/admin-menu.js") | $raw %]
312     [% INCLUDE 'datatables.inc' %]
313     [% INCLUDE 'columns_settings.inc' %]
314     <script>
315         $(document).ready(function() {
316             var columns_settings = []; // Empty because there are no columns we want to be configurable
317
318             KohaTable("categoriest", {
319                 "aaSorting": [[ 0, "asc" ]],
320                 "sPaginationType": "full"
321             }, columns_settings);
322
323             if ( $("#branches option:selected").length < 1 ) {
324                 $("#branches option:first").attr("selected", "selected");
325             }
326             $('#icons').tabs();
327
328             $("a.delete").click(function(){
329                 return confirm(_("Are you sure you want to delete this authorized value?"));
330             });
331             $('#category_search').change(function() {
332                 $('#category').submit();
333             });
334             $(".library_limitation").tooltip();
335
336             $("#delete_category").on('submit', function(){
337                 return confirm(_("Are you sure you want to delete this authorized value category?"));
338             });
339         });
340     </script>
341 [% END %]
342
343 [% BLOCK category_descriptions %]
344     [% SWITCH code_category %]
345         [% CASE 'Asort1' %]
346             <p>Used for acquisitions statistical purposes</p>
347         [% CASE 'Asort2' %]
348             <p>Used for acquisitions statistical purposes</p>
349         [% CASE 'BOR_NOTES' %]
350             <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>
351         [% CASE 'branches' %]
352             <p></p>
353         [% CASE 'Bsort1' %]
354             <p>Values that can be entered to fill in the patron’s sort 1 field, that can be used for statistical purposes</p>
355         [% CASE 'Bsort2' %]
356             <p>Values that can be entered to fill in the patron’s sort 2 field, that can be used for statistical purposes</p>
357         [% CASE 'CAND' %]
358             <p></p>
359         [% CASE 'CCODE' %]
360             <p>Collections (appear when cataloging and working with items)</p>
361         [% CASE 'cn_source' %]
362             <p></p>
363         [% CASE 'CONTROL_NUM_SEQUENCE' %]
364             <p></p>
365         [% CASE 'COUNTRY' %]
366             <p>Used in UNIMARC 102 $a</p>
367         [% CASE 'DAMAGED' %]
368             <p>Descriptions for items marked as damaged (appears when cataloging and working with items)</p>
369         [% CASE 'DEPARTMENT' %]
370             <p>Departments are required by and will be used in the Course Reserves module</p>
371         [% CASE 'ETAT' %]
372             <p>Used in French UNIMARC installations in field 995 $o to identify item status. Similar to NOT_LOAN</p>
373         [% CASE 'HINGS_AS' %]
374             <p>General holdings: acquisition status designator :: This data element specifies acquisition status for the unit at the time of the holdings report.</p>
375         [% CASE 'HINGS_C' %]
376             <p>General holdings: completeness designator</p>
377         [% CASE 'HINGS_PF' %]
378             <p>Physical form designators</p>
379         [% CASE 'HINGS_RD' %]
380             <p>General holdings: retention designator :: This data element specifies the retention policy for the unit at the time of the holdings report.</p>
381         [% CASE 'HINGS_UT' %]
382             <p>General holdings: type of unit designator</p>
383         [% CASE 'HOLD_CANCELLATION' %]
384             <p>Reasons why a hold might have been cancelled</p>
385         [% CASE 'HSBND_FREQ' %]
386             <p>Frequencies used by the housebound module. They are displayed on the housebound tab in the patron account in staff.</p>
387         [% CASE 'ITEMTYPECAT' %]
388             <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>
389         [% CASE 'itemtypes' %]
390             <p></p>
391         [% CASE 'LANG' %]
392             <p>ISO 639-2 standard language codes</p>
393         [% CASE 'LOC' %]
394             <p>Shelving location (usually appears when adding or editing an item). LOC maps to items.location in the Koha database.</p>
395         [% CASE 'LOST' %]
396             <p>Descriptions for the items marked as lost (appears when adding or editing an item)</p>
397         [% CASE 'NOT_LOAN' %]
398             <p>Reasons why a title is not for loan</p>
399         [% CASE 'OPAC_SUG' %]
400             <p>A list of reasons displayed in the suggestion form on the OPAC.</p>
401         [% CASE 'ORDER_CANCELLATION_REASON' %]
402             <p>Reasons why an order might have been cancelled</p>
403         [% CASE 'PAYMENT_TYPE' %]
404             <p>Populates a dropdown list of custom payment types when paying fines</p>
405         [% CASE 'qualif' %]
406             <p>Function codes (author, editor, collaborator, etc.) used in UNIMARC 7XX $4 (French)</p>
407         [% CASE 'RELTERMS' %]
408             <p>French terms of relations</p>
409         [% CASE 'REPORT_GROUP' %]
410             <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>
411         [% CASE 'REPORT_SUBGROUP' %]
412             <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>
413         [% CASE 'RESTRICTED' %]
414             <p>Restricted status of an item</p>
415         [% CASE 'ROADTYPE' %]
416             <p>Road types to be used in patron addresses</p>
417         [% CASE 'SIP_MEDIA_TYPE' %]
418             <p>Used when creating or editing an item type to assign a SIP specific media type for devices like lockers and sorters.</p>
419         [% CASE 'STACK' %]
420             <p>Shelving control number</p>
421         [% CASE 'SUGGEST' %]
422             <p>List of patron suggestion reject or accept reasons (appears when managing suggestions)</p>
423         [% CASE 'SUGGEST_FORMAT' %]
424             <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>
425         [% CASE 'SUGGEST_STATUS' %]
426             <p>A list of additional custom status values for suggestions that can be used in addition to the default values.</p>
427         [% CASE 'TERM' %]
428             <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>
429         [% CASE 'UPLOAD' %]
430             <p>Categories to be assigned to file uploads. Without a category an upload is considered temporary and may be removed during automated cleanup.</p>
431         [% CASE 'WITHDRAWN' %]
432             <p>Description of a withdrawn item (appears when adding or editing an item)</p>
433         [% CASE 'YES_NO' %]
434             <p>A generic authorized value field that can be used anywhere you need a simple yes/no pull down menu.</p>
435     [% END %]
436 [% END %]
437
438 [% INCLUDE 'intranet-bottom.inc' %]