2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Administration › Authorized values
4 [% IF op == 'add_form' %]
5 [% IF ( action_modify ) %] › Modify authorized value[% END %]
6 [% IF ( action_add_value ) %] › New authorized value[% END %]
7 [% IF ( action_add_category ) %] › New category[% END %]
10 [% INCLUDE 'doc-head-close.inc' %]
12 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
14 <style type="text/css">
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; }
22 <body id="admin_authorised_values" class="admin">
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'prefs-admin-search.inc' %]
25 <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 %]
26 [% IF ( action_add_value ) %]New authorized value[% END %]
27 [% IF ( action_add_category ) %]New category[% END %][% END %]
28 [% IF op == 'list' %]Authorized values[% END %]</div>
30 <div id="doc3" class="yui-t2">
36 [% IF op == 'add_form' %]
38 [% IF ( action_modify ) %]Modify authorized value[% END %]
39 [% IF ( action_add_value ) %]New authorized value[% END %]
40 [% IF ( action_add_category ) %]New category[% END %]
43 [% 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 %]
45 <form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post" class="validated">
46 <fieldset class="rows"><ol>
47 [% IF action_add_category %]
49 <label for="category" class="required">Category: </label>
50 <input type="text" name="category" id="category" size="32" maxlength="32" class="focus required" />
51 <span class="required">Required</span>
52 <input type="hidden" name="op" value="add_category" />
56 <span class="label">Category</span>
57 <input type="hidden" name="op" value="add" />
58 <input type="hidden" name="category" value="[% category | html %]" /> [% category | html %]
61 <label for="authorised_value">Authorized value: </label>
62 [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id %]" />[% END %]
63 <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value | html %]" maxlength="80" class="focus" />
66 <label for="lib">Description: </label>
67 <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="200" />
70 <label for="lib_opac">Description (OPAC): </label>
71 <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="200" />
73 <li><label for="branches">Libraries limitation: </label>
74 <select id="branches" name="branches" multiple size="10">
75 <option value="">All libraries</option>
76 [% FOREACH branch IN branches_loop %]
77 [% IF ( branch.selected ) %]
78 <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname |html %]</option>
80 <option value="[% branch.branchcode %]">[% branch.branchname |html %]</option>
84 <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>
88 <div id="icons" class="toptabs" style="clear:both">
89 <h5 style="margin-left:10px;">Choose an icon:</h5>
91 <li><a href="#none">None</a></li>
92 [% FOREACH imageset IN imagesets %]
93 [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
97 <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
99 <br class="clear" /></div>
100 [% FOREACH imageset IN imagesets %]
101 <div id="[% imageset.imagesetname %]"><ul>
102 [% FOREACH image IN imageset.images %]
103 <li style="float: none; display: inline-block; clear : none; width: auto;">
104 <label> [% IF ( image.StaffImageUrl ) %]
105 <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
108 [% IF ( image.checked ) %]
109 <input type="radio" name="imageurl" value="[% image.KohaImage %]" checked="checked" />
111 [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
112 <input type="radio" name="imageurl" value="[% image.KohaImage %]" />
124 <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
125 <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category | url %]">Cancel</a></fieldset>
130 [% IF op == 'list' %]
132 <div id="toolbar" class="btn-toolbar">
133 <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>
134 <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>
137 <h1>Authorized values</h1>
138 <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>
140 [% FOR m IN messages %]
141 <div class="dialog [% m.type %]">
143 [% CASE 'error_on_update' %]
144 An error occurred when updating this authorized value. Perhaps the value already exists.
145 [% CASE 'error_on_insert' %]
146 An error occurred when inserting this authorized value. Perhaps the value or the category already exists.
147 [% CASE 'error_on_insert_cat' %]
148 An error occurred when inserting this authorized value category. Perhaps the category name already exists.
149 [% CASE 'error_on_delete' %]
150 An error occurred when deleting this authorized value. Check the logs.
151 [% CASE 'success_on_update' %]
152 Authorized value updated successfully.
153 [% CASE 'success_on_insert' %]
154 Authorized value added successfully.
155 [% CASE 'success_on_insert_cat' %]
156 Authorized value category added successfully.
157 [% CASE 'success_on_delete' %]
158 Authorized value deleted successfully.
159 [% CASE 'already_exists' %]
160 This authorized value already exists.
161 [% CASE 'cat_already_exists' %]
162 This authorized value category already exists.
163 [% CASE 'invalid_category_name' %]
164 The authorized value category 'branches', 'itemtypes' and 'cn_source' are used internally by Koha and are not valid.
171 <form action="/cgi-bin/koha/admin/authorised_values.pl" method="post" id="category">
172 <label for="searchfield">Show category: </label>
173 <select name="searchfield" id="searchfield" size="1">
174 [% FOR c IN categories %]
175 [% IF c == searchfield %]
176 <option value="[% c %]" selected="selected">[% c |html %]</option>
178 <option value="[% c %]">[% c |html %]</option>
181 <input type="submit" value="Submit" />
183 [% IF ( category == 'Bsort1' ) %]
184 <p>An authorized value attached to patrons, that can be used for stats purposes</p>
186 [% IF ( category == 'Bsort2' ) %]
187 <p>An authorized value attached to patrons, that can be used for stats purposes</p>
189 [% IF ( category == 'Asort1' ) %]
190 <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
192 [% IF ( category == 'Asort2' ) %]
193 <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
195 [% IF ( category == 'SUGGEST' ) %]
196 <p>Reasons to reject or accept patron suggestions</p>
198 [% IF ( category == 'DAMAGED' ) %]
199 <p>Statuses to describe a damaged item</p>
201 [% IF ( category == 'LOST' ) %]
202 <p>Statuses to describe a lost item</p>
204 [% IF ( category == 'MANUAL_INV' ) %]
205 <p>Additional values for manual invoice types</p>
207 [% IF ( category == 'BOR_NOTES' ) %]
208 <p>Values for custom patron notes</p>
210 [% IF ( category == 'LOC' ) %]
211 <p>Values for shelving locations</p>
213 [% IF ( category == 'CCODE' ) %]
214 <p>Values for collection codes</p>
216 [% IF ( category == 'NOT_LOAN' ) %]
217 <p>Statuses to describe why an item is not for loan</p>
219 <h3>Authorized values for category [% category |html %]:</h3>
221 [% IF ( loop ) %]<div id="pagertable_authorized_values">
224 [% IF ( loop ) %]<table id="table_authorized_values">
226 <th>Authorized value</th>
228 <th>Description (OPAC)</th>
230 <th>Branches limitations</th>
234 [% FOREACH loo IN loop %]
235 [% UNLESS ( loop.odd ) %]
240 <td>[% loo.authorised_value | html %]</td>
241 <td>[% loo.lib |html %]</td>
242 <td>[% loo.lib_opac |html %]</td>
243 <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %] [% END %]</td>
245 [% IF loo.branches.size > 0 %]
246 [% branches_str = "" %]
247 [% FOREACH branch IN loo.branches %]
248 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
250 <span href="#" title="[% branches_str %]">
251 [% IF loo.branches.size > 1 %]
252 [% loo.branches.size %] branches limitations
254 [% loo.branches.size %] branch limitation
260 <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>
261 <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>
264 </tbody></table>[% ELSE %]
265 <div class="dialog message">There are no authorized values defined for [% category |html %]</div>
268 [% IF ( isprevpage ) %]
269 <form class="inline" action="/cgi-bin/koha/admin/authorised_values.pl" method="post">
270 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
271 <input type="submit" value="<< Previous" /></form>
279 [% INCLUDE 'admin-menu.inc' %]
283 [% MACRO jsinclude BLOCK %]
284 <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu_[% KOHA_VERSION %].js"></script>
285 [% INCLUDE 'datatables.inc' %]
286 <script type="text/javascript">
287 $(document).ready(function() {
288 $("#table_authorized_values").dataTable($.extend(true, {}, dataTablesDefaults, {
290 { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
292 "aaSorting": [[ 1, "asc" ]],
293 "sPaginationType": "four_button"
296 if ( $("#branches option:selected").length < 1 ) {
297 $("#branches option:first").attr("selected", "selected");
301 $("a.delete").click(function(){
302 return confirm(_("Are you sure you want to delete this authorized value?"));
304 [% IF op == 'list' %]
305 $('#category').find("input:submit").hide();
306 $('#searchfield').change(function() {
307 $('#category').submit();
314 [% INCLUDE 'intranet-bottom.inc' %]