3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Administration › Authorized values
5 [% IF op == 'add_form' %]
6 [% IF ( action_modify ) %] › Modify authorized value[% END %]
7 [% IF ( action_add_value ) %] › New authorized value[% END %]
8 [% IF ( action_add_category ) %] › New category[% END %]
11 [% INCLUDE 'doc-head-close.inc' %]
13 [% Asset.css("css/datatables.css") %]
15 <style type="text/css">
16 fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
17 fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
18 fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
19 fieldset.rows .ui-tabs-nav { margin-left : 10px; }
23 <body id="admin_authorised_values" class="admin">
24 [% INCLUDE 'header.inc' %]
25 [% INCLUDE 'prefs-admin-search.inc' %]
26 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF op == 'add_form' %] <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a> › [% IF ( action_modify ) %]Modify authorized value[% END %]
27 [% IF ( action_add_value ) %]New authorized value[% END %]
28 [% IF ( action_add_category ) %]New category[% END %][% END %]
29 [% IF op == 'list' %]Authorized values[% END %]</div>
31 <div id="doc3" class="yui-t2">
37 [% IF op == 'add_form' %]
39 [% IF ( action_modify ) %]Modify authorized value[% END %]
40 [% IF ( action_add_value ) %]New authorized value[% END %]
41 [% IF ( action_add_category ) %]New category[% END %]
44 [% 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 %]
46 <form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post" class="validated">
47 <fieldset class="rows"><ol>
48 [% IF action_add_category %]
50 <label for="category" class="required">Category: </label>
51 <input type="text" name="category" id="category" size="32" maxlength="32" class="focus required" />
52 <span class="required">Required</span>
53 <input type="hidden" name="op" value="add_category" />
57 <span class="label">Category</span>
58 <input type="hidden" name="op" value="add" />
59 <input type="hidden" name="category" value="[% category | html %]" /> [% category | html %]
62 <label for="authorised_value">Authorized value: </label>
63 [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id %]" />[% END %]
64 <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value | html %]" maxlength="80" class="focus" />
67 <label for="lib">Description: </label>
68 <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="200" />
71 <label for="lib_opac">Description (OPAC): </label>
72 <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="200" />
74 <li><label for="branches">Libraries limitation: </label>
75 <select id="branches" name="branches" multiple size="10">
76 <option value="">All libraries</option>
77 [% FOREACH branch IN branches_loop %]
78 [% IF ( branch.selected ) %]
79 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname |html %]</option>
81 <option value="[% branch.branchcode %]">[% branch.branchname |html %]</option>
85 <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>
89 <div id="icons" class="toptabs" style="clear:both">
90 <h5 style="margin-left:10px;">Choose an icon:</h5>
92 <li><a href="#none">None</a></li>
93 [% FOREACH imageset IN imagesets %]
94 [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
98 <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
100 <br class="clear" /></div>
101 [% FOREACH imageset IN imagesets %]
102 <div id="[% imageset.imagesetname %]"><ul>
103 [% FOREACH image IN imageset.images %]
104 <li style="float: none; display: inline-block; clear : none; width: auto;">
105 <label> [% IF ( image.StaffImageUrl ) %]
106 <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
109 [% IF ( image.checked ) %]
110 <input type="radio" name="imageurl" value="[% image.KohaImage %]" checked="checked" />
112 [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
113 <input type="radio" name="imageurl" value="[% image.KohaImage %]" />
125 <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
126 <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category | url %]">Cancel</a></fieldset>
131 [% IF op == 'list' %]
133 <div id="toolbar" class="btn-toolbar">
134 <a id="addauth" class="btn btn-default btn-sm" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=[% category | url %]"><i class="fa fa-plus"> </i> New authorized value for [% category |html %]</a>
135 <a id="addcat" class="btn btn-default btn-sm" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form"><i class="fa fa-plus"> </i> New category</a>
138 <h1>Authorized values</h1>
139 <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>
141 [% FOR m IN messages %]
142 <div class="dialog [% m.type %]">
144 [% CASE 'error_on_update' %]
145 An error occurred when updating this authorized value. Perhaps the value already exists.
146 [% CASE 'error_on_insert' %]
147 An error occurred when inserting this authorized value. Perhaps the value or the category already exists.
148 [% CASE 'error_on_insert_cat' %]
149 An error occurred when inserting this authorized value category. Perhaps the category name already exists.
150 [% CASE 'error_on_delete' %]
151 An error occurred when deleting this authorized value. Check the logs.
152 [% CASE 'success_on_update' %]
153 Authorized value updated successfully.
154 [% CASE 'success_on_insert' %]
155 Authorized value added successfully.
156 [% CASE 'success_on_insert_cat' %]
157 Authorized value category added successfully.
158 [% CASE 'success_on_delete' %]
159 Authorized value deleted successfully.
160 [% CASE 'already_exists' %]
161 This authorized value already exists.
162 [% CASE 'cat_already_exists' %]
163 This authorized value category already exists.
164 [% CASE 'invalid_category_name' %]
165 The authorized value category 'branches', 'itemtypes' and 'cn_source' are used internally by Koha and are not valid.
172 <form action="/cgi-bin/koha/admin/authorised_values.pl" method="post" id="category">
173 <label for="searchfield">Show category: </label>
174 <select name="searchfield" id="searchfield" size="1">
175 [% FOR c IN categories %]
176 [% IF c == searchfield %]
177 <option value="[% c %]" selected="selected">[% c |html %]</option>
179 <option value="[% c %]">[% c |html %]</option>
182 <input type="submit" value="Submit" />
184 [% IF ( category == 'Bsort1' ) %]
185 <p>An authorized value attached to patrons, that can be used for stats purposes</p>
187 [% IF ( category == 'Bsort2' ) %]
188 <p>An authorized value attached to patrons, that can be used for stats purposes</p>
190 [% IF ( category == 'Asort1' ) %]
191 <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
193 [% IF ( category == 'Asort2' ) %]
194 <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
196 [% IF ( category == 'SUGGEST' ) %]
197 <p>Reasons to reject or accept patron suggestions</p>
199 [% IF ( category == 'DAMAGED' ) %]
200 <p>Statuses to describe a damaged item</p>
202 [% IF ( category == 'LOST' ) %]
203 <p>Statuses to describe a lost item</p>
205 [% IF ( category == 'MANUAL_INV' ) %]
206 <p>Additional values for manual invoice types</p>
208 [% IF ( category == 'BOR_NOTES' ) %]
209 <p>Values for custom patron notes</p>
211 [% IF ( category == 'LOC' ) %]
212 <p>Values for shelving locations</p>
214 [% IF ( category == 'CCODE' ) %]
215 <p>Values for collection codes</p>
217 [% IF ( category == 'NOT_LOAN' ) %]
218 <p>Statuses to describe why an item is not for loan</p>
220 <h3>Authorized values for category [% category |html %]:</h3>
222 [% IF ( loop ) %]<div id="pagertable_authorized_values">
225 [% IF ( loop ) %]<table id="table_authorized_values">
227 <th>Authorized value</th>
229 <th>Description (OPAC)</th>
231 <th>Branches limitations</th>
235 [% FOREACH loo IN loop %]
236 [% UNLESS ( loop.odd ) %]
241 <td>[% loo.authorised_value | html %]</td>
242 <td>[% loo.lib |html %]</td>
243 <td>[% loo.lib_opac |html %]</td>
244 <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %] [% END %]</td>
246 [% IF loo.branches.size > 0 %]
247 [% branches_str = "" %]
248 [% FOREACH branch IN loo.branches %]
249 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
251 <span href="#" title="[% branches_str %]">
252 [% IF loo.branches.size > 1 %]
253 [% loo.branches.size %] branches limitations
255 [% loo.branches.size %] branch limitation
261 <td class="actions"><a href="/cgi-bin/koha/admin/authorised_values.pl?op=add_form&id=[% loo.id %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
262 <a class="delete btn btn-default btn-xs" href="/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=[% searchfield | url %]&id=[% loo.id %]"><i class="fa fa-trash"></i> Delete</a></td>
265 </tbody></table>[% ELSE %]
266 <div class="dialog message">There are no authorized values defined for [% category |html %]</div>
269 [% IF ( isprevpage ) %]
270 <form class="inline" action="/cgi-bin/koha/admin/authorised_values.pl" method="post">
271 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
272 <input type="submit" value="<< Previous" /></form>
280 [% INCLUDE 'admin-menu.inc' %]
284 [% MACRO jsinclude BLOCK %]
285 [% Asset.js("js/admin-menu.js") %]
286 [% INCLUDE 'datatables.inc' %]
287 <script type="text/javascript">
288 $(document).ready(function() {
289 $("#table_authorized_values").dataTable($.extend(true, {}, dataTablesDefaults, {
291 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
293 "aaSorting": [[ 1, "asc" ]],
294 "sPaginationType": "four_button"
297 if ( $("#branches option:selected").length < 1 ) {
298 $("#branches option:first").attr("selected", "selected");
302 $("a.delete").click(function(){
303 return confirm(_("Are you sure you want to delete this authorized value?"));
305 [% IF op == 'list' %]
306 $('#category').find("input:submit").hide();
307 $('#searchfield').change(function() {
308 $('#category').submit();
315 [% INCLUDE 'intranet-bottom.inc' %]