Lines 3-22
Link Here
|
3 |
[% SET footerjs = 1 %] |
3 |
[% SET footerjs = 1 %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
<title> |
5 |
<title> |
6 |
[% IF op == 'add_form' %] |
6 |
[% IF op == 'add_form' %] |
7 |
[% IF ( action_modify ) %]Modify authorized value › [% END %] |
7 |
[% IF ( action_modify ) %]Modify authorized value › [% END %] |
8 |
[% IF ( action_add_value ) %]New authorized value › [% END %] |
8 |
[% IF ( action_add_value ) %]New authorized value › [% END %] |
9 |
[% IF ( action_add_category ) %]New category › [% END %] |
9 |
[% IF ( action_add_category ) %]New category › [% END %] |
10 |
[% END %] |
10 |
[% END %] |
11 |
|
11 |
Authorized values › Administration › Koha |
12 |
Authorized values › Administration › Koha |
|
|
13 |
</title> |
12 |
</title> |
14 |
[% INCLUDE 'doc-head-close.inc' %] |
13 |
[% INCLUDE 'doc-head-close.inc' %] |
15 |
|
14 |
|
16 |
<style> |
15 |
<style> |
17 |
fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; } |
16 |
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; } |
17 |
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;} |
18 |
fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;} |
20 |
fieldset.rows .ui-tabs-nav { margin-left : 10px; } |
19 |
fieldset.rows .ui-tabs-nav { margin-left : 10px; } |
21 |
</style> |
20 |
</style> |
22 |
</head> |
21 |
</head> |
Lines 85-343
Authorized values › Administration › Koha
Link Here
|
85 |
<div class="col-sm-10 col-sm-push-2"> |
84 |
<div class="col-sm-10 col-sm-push-2"> |
86 |
<main> |
85 |
<main> |
87 |
|
86 |
|
88 |
[% IF op == 'add_form' %] |
87 |
[% IF op == 'add_form' %] |
89 |
<h1> |
88 |
<h1> |
90 |
[% IF ( action_modify ) %]Modify authorized value[% END %] |
89 |
[% IF ( action_modify ) %]Modify authorized value[% END %] |
91 |
[% IF ( action_add_value ) %]New authorized value[% END %] |
90 |
[% IF ( action_add_value ) %]New authorized value[% END %] |
92 |
[% IF ( action_add_category ) %]New category[% END %] |
91 |
[% IF ( action_add_category ) %]New category[% END %] |
93 |
</h1> |
92 |
</h1> |
94 |
|
93 |
|
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 %] |
94 |
[% IF ( action_modify ) %] |
|
|
95 |
<div class="note"> |
96 |
<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. |
97 |
</div> |
98 |
[% END %] |
96 |
|
99 |
|
97 |
<form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post" class="validated"> |
100 |
<form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post" class="validated"> |
98 |
<fieldset class="rows"><ol> |
101 |
<fieldset class="rows"> |
99 |
[% IF action_add_category %] |
102 |
[% IF action_add_category %] |
100 |
<li> |
103 |
<ol> |
101 |
<label for="category" class="required">Category: </label> |
104 |
<li> |
102 |
<input type="text" name="category" id="category" size="32" maxlength="32" class="focus required" /> |
105 |
<label for="category" class="required">Category: </label> |
103 |
<span class="required">Required</span> |
106 |
<input type="text" name="category" id="category" size="32" maxlength="32" class="focus required" /> |
104 |
<input type="hidden" name="op" value="add_category" /> |
107 |
<span class="required">Required</span> |
105 |
</li> |
108 |
<input type="hidden" name="op" value="add_category" /> |
106 |
[% ELSE %] |
109 |
</li> |
107 |
<li> |
110 |
</ol> |
108 |
<span class="label">Category</span> |
111 |
[% ELSE %] |
109 |
<input type="hidden" name="op" value="add" /> |
112 |
<ol> |
110 |
<input type="hidden" name="category" value="[% category_name | html %]" /> [% category_name | html %] |
113 |
<li> |
111 |
</li> |
114 |
<span class="label">Category</span> |
112 |
<li> |
115 |
<input type="hidden" name="op" value="add" /> |
113 |
<label for="authorised_value">Authorized value: </label> |
116 |
<input type="hidden" name="category" value="[% category_name | html %]" /> [% category_name | html %] |
114 |
[% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id | html %]" />[% END %] |
117 |
</li> |
115 |
<input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value | html %]" maxlength="80" class="focus" /> |
118 |
<li> |
116 |
</li> |
119 |
<label for="authorised_value">Authorized value: </label> |
117 |
<li> |
120 |
[% IF ( action_modify ) %] |
118 |
<label for="lib">Description: </label> |
121 |
<input type="hidden" id="id" name="id" value="[% id | html %]" /> |
119 |
<input type="text" name="lib" id="lib" value="[% lib | html %]" maxlength="200" /> |
122 |
[% END %] |
120 |
</li> |
123 |
<input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value | html %]" maxlength="80" class="focus" /> |
121 |
<li> |
124 |
</li> |
122 |
<label for="lib_opac">Description (OPAC): </label> |
125 |
<li> |
123 |
<input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac | html %]" maxlength="200" /> |
126 |
<label for="lib">Description: </label> |
124 |
</li> |
127 |
<input type="text" name="lib" id="lib" value="[% lib | html %]" maxlength="200" /> |
125 |
<li><label for="branches">Library limitations: </label> |
128 |
</li> |
126 |
<select id="branches" name="branches" multiple size="10"> |
129 |
<li> |
127 |
<option value="">All libraries</option> |
130 |
<label for="lib_opac">Description (OPAC): </label> |
128 |
[% FOREACH branch IN branches_loop %] |
131 |
<input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac | html %]" maxlength="200" /> |
129 |
[% IF ( branch.selected ) %] |
132 |
</li> |
130 |
<option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
133 |
<li><label for="branches">Library limitations: </label> |
131 |
[% ELSE %] |
134 |
<select id="branches" name="branches" multiple size="10"> |
132 |
<option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
135 |
<option value="">All libraries</option> |
133 |
[% END %] |
136 |
[% FOREACH branch IN branches_loop %] |
|
|
137 |
[% IF ( branch.selected ) %] |
138 |
<option selected="selected" value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
139 |
[% ELSE %] |
140 |
<option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option> |
141 |
[% END %] |
142 |
[% END %] |
143 |
</select> |
144 |
<div class="hint">Select 'All libraries' if this authorized value must be displayed all the time. Otherwise select libraries you want to associate with this value.</div> |
145 |
</li> |
146 |
|
147 |
</ol> |
148 |
|
149 |
<div id="icons" class="toptabs" style="clear:both"> |
150 |
<h5 style="margin-left:10px;">Choose an icon:</h5> |
151 |
<ul> |
152 |
<li><a href="#none">None</a></li> |
153 |
[% FOREACH imageset IN imagesets %] |
154 |
[% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname | uri %]">[% imageset.imagesetname | html %]</a></li> |
155 |
[% END %] |
156 |
</ul> |
157 |
<div id="none"> |
158 |
<ul> |
159 |
<li> |
160 |
<label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /> |
161 |
</li> |
162 |
</ul> |
163 |
<br class="clear" /> |
164 |
</div> |
165 |
|
166 |
[% FOREACH imageset IN imagesets %] |
167 |
<div id="[% imageset.imagesetname | html %]"> |
168 |
<ul> |
169 |
[% FOREACH image IN imageset.images %] |
170 |
<li style="float: none; display: inline-block; clear : none; width: auto;"> |
171 |
<label> |
172 |
[% IF ( image.StaffImageUrl ) %] |
173 |
<img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" /> |
174 |
[% ELSE %] |
175 |
[% END %] |
176 |
[% IF ( image.checked ) %] |
177 |
<input type="radio" name="imageurl" value="[% image.KohaImage | html %]" checked="checked" /> |
178 |
[% ELSE %] |
179 |
[% IF ( image.KohaImage ) %] |
180 |
<!-- to delete the radio button if there is no image after --> |
181 |
<input type="radio" name="imageurl" value="[% image.KohaImage | html %]" /> |
182 |
[% END %] |
183 |
[% END %] |
184 |
</label> |
185 |
</li> |
186 |
[% END %] |
187 |
</ul> |
188 |
<br class="clear" /> |
189 |
</div> |
190 |
[% END %] |
191 |
</div> |
192 |
[% END %] |
193 |
</fieldset> |
194 |
<fieldset class="action"> |
195 |
<input type="hidden" name="id" value="[% id | html %]" /> |
196 |
<input type="submit" value="Save" /> |
197 |
<a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category_name | url %]">Cancel</a> |
198 |
</fieldset> |
199 |
</form> |
134 |
[% END %] |
200 |
[% END %] |
135 |
</select> |
|
|
136 |
<div class="hint">Select 'All libraries' if this authorized value must be displayed all the time. Otherwise select libraries you want to associate with this value.</div> |
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 |
|
201 |
|
181 |
[% IF op == 'list' %] |
202 |
[% IF op == 'list' %] |
182 |
|
203 |
<div id="toolbar" class="btn-toolbar"> |
183 |
<div id="toolbar" class="btn-toolbar"> |
204 |
<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> |
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> |
205 |
[% IF ( searchfield ) %] |
185 |
[% IF ( searchfield ) %] |
206 |
<a id="addauth" class="btn btn-default" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=[% category.category_name | url %]"><i class="fa fa-plus"> </i> New authorized value for [% category.category_name | html %]</a> |
186 |
<a id="addauth" class="btn btn-default" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=[% category.category_name | url %]"><i class="fa fa-plus"> </i> New authorized value for [% category.category_name | html %]</a> |
207 |
[% END %] |
187 |
[% END %] |
208 |
</div> |
188 |
</div> |
209 |
|
189 |
|
210 |
[% IF ( searchfield ) %] |
190 |
[% IF ( searchfield ) %] |
211 |
<h1>Authorized values for category [% category.category_name | html %]</h1> |
191 |
<h1>Authorized values for category [% category.category_name | html %]</h1> |
212 |
[% PROCESS category_descriptions code_category = category.category_name %] |
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 %] |
213 |
[% ELSE %] |
246 |
<option value="[% c | html %]">[% c | html %]</option> |
214 |
<h1>Authorized values</h1> |
247 |
[% END %] |
215 |
[% END %] |
248 |
[% END %] |
216 |
|
249 |
</select> |
217 |
[% IF ( searchfield ) %] |
250 |
</p> |
218 |
<div class="note"> |
251 |
</form> |
219 |
<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. |
252 |
|
220 |
</div> |
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 %] [% 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 %] |
221 |
[% 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&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&searchfield=[% searchfield | uri %]&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 |
|
222 |
|
314 |
[% ELSE # category was selected %] |
223 |
[% FOR m IN messages %] |
315 |
|
224 |
<div class="dialog [% m.type | html %]"> |
316 |
<table id="categoriest" class="authorized_values_table"> |
225 |
[% SWITCH m.code %] |
317 |
<thead> |
226 |
[% CASE 'error_on_update' %] |
318 |
<tr> |
227 |
An error occurred when updating this authorized value. Perhaps the value already exists. |
319 |
<th>Category</th> |
228 |
[% CASE 'error_on_insert' %] |
320 |
<th>Description</th> |
229 |
An error occurred when inserting this authorized value. Perhaps the value or the category already exists. |
321 |
<th class="noExport"> </th> |
230 |
[% CASE 'error_on_insert_cat' %] |
322 |
</tr> |
231 |
An error occurred when inserting this authorized value category. Perhaps the category name already exists. |
323 |
</thead> |
232 |
[% CASE 'error_on_delete' %] |
324 |
<tbody> |
233 |
An error occurred when deleting this authorized value. Check the logs. |
325 |
[% FOR c IN categories %] |
234 |
[% CASE 'error_on_delete_category' %] |
326 |
<tr> |
235 |
An error occurred when deleting this authorized value category. Check the logs. |
327 |
<td><a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% c | uri %]">[% c | html %]</a></td> |
236 |
[% CASE 'success_on_update' %] |
328 |
<td> |
237 |
Authorized value updated successfully. |
329 |
[% PROCESS category_descriptions code_category = c %] |
238 |
[% CASE 'success_on_insert' %] |
330 |
</td> |
239 |
Authorized value added successfully. |
331 |
<td> |
240 |
[% CASE 'success_on_insert_cat' %] |
332 |
<a id="addauth" class="btn btn-default btn-xs" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=[% c | uri %]"><i class="fa fa-plus"> </i> Add</a> |
241 |
Authorized value category added successfully. |
333 |
</td> |
242 |
[% CASE 'success_on_delete' %] |
334 |
</tr> |
243 |
Authorized value deleted successfully. |
335 |
[% END %] |
244 |
[% CASE 'success_on_delete_category' %] |
336 |
</tbody> |
245 |
Authorized value category deleted successfully. |
337 |
</table> |
246 |
[% CASE 'cat_already_exists' %] |
338 |
[% END # /IF ( searchfield )%] |
247 |
This authorized value category already exists. |
|
|
248 |
[% CASE 'invalid_category_name' %] |
249 |
The authorized value category 'branches', 'itemtypes' and 'cn_source' are used internally by Koha and are not valid. |
250 |
[% CASE %] |
251 |
[% m.code | html %] |
252 |
[% END %] |
253 |
</div> |
254 |
[% END %] |
339 |
|
255 |
|
340 |
[% END # /IF op == 'list' %] |
256 |
[% IF ( searchfield ) %] |
|
|
257 |
|
258 |
<form action="/cgi-bin/koha/admin/authorised_values.pl" method="get" id="category"> |
259 |
<p> |
260 |
<label for="category_search">Show category: </label> |
261 |
<select name="searchfield" id="category_search"> |
262 |
[% FOR c IN categories %] |
263 |
[% IF c == searchfield %] |
264 |
<option value="[% c | html %]" selected="selected">[% c | html %]</option> |
265 |
[% ELSE %] |
266 |
<option value="[% c | html %]">[% c | html %]</option> |
267 |
[% END %] |
268 |
[% END %] |
269 |
</select> |
270 |
</p> |
271 |
</form> |
272 |
|
273 |
[% IF loop %] |
274 |
<table id="categoriest" class="authorized_values_table"> |
275 |
<thead> |
276 |
<tr> |
277 |
<th>Authorized value</th> |
278 |
<th>Description</th> |
279 |
<th>Description (OPAC)</th> |
280 |
<th>Icon</th> |
281 |
<th>Library limitations</th> |
282 |
<th class="noExport NoSort">Actions</th> |
283 |
</tr> |
284 |
</thead> |
285 |
<tbody> |
286 |
[% FOREACH loo IN loop %] |
287 |
<tr> |
288 |
<td>[% loo.authorised_value | html %]</td> |
289 |
<td>[% loo.lib | html %]</td> |
290 |
<td>[% loo.lib_opac | html %]</td> |
291 |
<td> |
292 |
[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl | url %]" alt=""/>[% ELSE %] [% END %]</td> |
293 |
<td> |
294 |
[% IF loo.branches.size > 0 %] |
295 |
[% branches_str = "" %] |
296 |
[% FOREACH branch IN loo.branches %] |
297 |
[%- IF loop.first -%] |
298 |
[% branches_str = branch.branchname _ " (" _ branch.branchcode _ ")" %] |
299 |
[% ELSE %] |
300 |
[% branches_str = branches_str _ "\n" _ branch.branchname _ " (" _ branch.branchcode _ ")" %] |
301 |
[% END %] |
302 |
[% END %] |
303 |
<span class="library_limitation" title="[% branches_str | html %]"> |
304 |
[% IF loo.branches.size > 1 %] |
305 |
[% loo.branches.size | html %] library limitations |
306 |
[% ELSE %] |
307 |
[% loo.branches.size | html %] library limitation |
308 |
[% END %] |
309 |
[% ELSE %] |
310 |
No limitation |
311 |
[% END %] |
312 |
</td> |
313 |
<td class="actions"><a href="/cgi-bin/koha/admin/authorised_values.pl?op=add_form&id=[% loo.id | uri %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> |
314 |
<a class="delete btn btn-default btn-xs" href="/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=[% searchfield | uri %]&id=[% loo.id | uri %]"><i class="fa fa-trash"></i> Delete</a></td> |
315 |
</tr> |
316 |
[% END # /FOREACH loop %] |
317 |
</tbody> |
318 |
</table> |
319 |
[% ELSE %] |
320 |
<div class="dialog message"> |
321 |
<p>There are no authorized values defined for [% category.category_name | html %]</p> |
322 |
<form action="/cgi-bin/koha/admin/authorised_values.pl" method="get"> |
323 |
<input type="hidden" name="op" value="add_form" /> |
324 |
<input type="hidden" name="category" value="[% category.category_name | html %]" /> |
325 |
<button type="submit"><i class="fa fa-plus"></i> Add a new authorized value</button> |
326 |
</form> |
327 |
[% UNLESS category.is_system %] |
328 |
<form id="delete_category" action="/cgi-bin/koha/admin/authorised_values.pl" method="post"> |
329 |
<input type="hidden" name="op" value="delete_category" /> |
330 |
<input type="hidden" name="category_name" value="[% category.category_name | html %]" /> |
331 |
<button type="submit"><i class="fa fa-plus"></i> Delete category '[% category.category_name | html %]' </button> |
332 |
</form> |
333 |
[% END %] |
334 |
</div> |
335 |
[% END %] |
336 |
|
337 |
[% ELSE # category was selected %] |
338 |
|
339 |
<table id="categoriest" class="authorized_values_table"> |
340 |
<thead> |
341 |
<tr> |
342 |
<th>Category</th> |
343 |
<th>Description</th> |
344 |
<th class="noExport"> </th> |
345 |
</tr> |
346 |
</thead> |
347 |
<tbody> |
348 |
[% FOR c IN categories %] |
349 |
<tr> |
350 |
<td><a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% c | uri %]">[% c | html %]</a></td> |
351 |
<td> |
352 |
[% PROCESS category_descriptions code_category = c %] |
353 |
</td> |
354 |
<td> |
355 |
<a id="addauth" class="btn btn-default btn-xs" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=[% c | uri %]"><i class="fa fa-plus"> </i> Add</a> |
356 |
</td> |
357 |
</tr> |
358 |
[% END %] |
359 |
</tbody> |
360 |
</table> |
361 |
|
362 |
[% END # /IF ( searchfield )%] |
363 |
|
364 |
[% END # /IF op == 'list' %] |
341 |
|
365 |
|
342 |
</main> |
366 |
</main> |
343 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
367 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
344 |
- |
|
|