5 [% INCLUDE 'doc-head-open.inc' %]
9 Modify system preference '[% searchfield | html %]'
11 Add a system preference
12 [% END %] › [% END %]
14 [% IF ( add_validate ) %]
15 Data added › [% END %]
17 [% IF ( delete_confirm ) %]
18 Confirm deletion of parameter '[% searchfield | html %]' › [% searchfield | html %] › [% END %]
20 [% IF ( delete_confirmed ) %]
21 Parameter deleted › [% END %]
23 System preferences › Administration › Koha
25 [% INCLUDE 'doc-head-close.inc' %]
28 <body id="admin_systempreferences" class="admin">
29 [% WRAPPER 'header.inc' %]
30 [% INCLUDE 'prefs-admin-search.inc' %]
33 [% WRAPPER 'sub-header.inc' %]
34 [% WRAPPER breadcrumbs %]
35 [% WRAPPER breadcrumb_item %]
36 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
39 [% IF ( add_form || add_validate || delete_confirm || delete_confirmed ) %]
40 [% WRAPPER breadcrumb_item %]
41 <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a>
46 [% WRAPPER breadcrumb_item bc_active= 1 %]
48 <span>Modify system preference '[% searchfield | html %]'</span>
50 <span>Add a system preference</span>
55 [% IF ( add_validate ) %]
56 [% WRAPPER breadcrumb_item bc_active= 1 %]
57 <span>Data added</span>
61 [% IF ( delete_confirm ) %]
62 [% WRAPPER breadcrumb_item %]
63 <a href="/cgi-bin/koha/admin/systempreferences.pl?op=add_form&searchfield=[% searchfield | uri %]">[% searchfield | html %]</a>
65 [% WRAPPER breadcrumb_item bc_active= 1 %]
66 <span>Confirm deletion of parameter '[% searchfield | html %]'</span>
70 [% IF ( delete_confirmed ) %]
71 [% WRAPPER breadcrumb_item bc_active= 1 %]
72 <span>Parameter deleted</span>
77 [% WRAPPER breadcrumb_item bc_active= 1 %]
78 <span>System preferences</span>
81 [% END #/ WRAPPER breadcrumbs %]
82 [% END #/ WRAPPER sub-header.inc %]
84 <div class="main container-fluid">
86 <div class="col-sm-10 col-sm-push-2">
90 [% IF ( type_upload ) %]
91 <form action="[% script_name | html %]" name="Aform" method="post" enctype="multipart/form-data">
93 <form action="[% script_name | html %]" name="Aform" method="post">
95 <fieldset class="rows"><legend>
97 [% IF ( modify ) %]Modify
99 [% END %] a system preference
102 <li><label for="explanation">Explanation: </label><input type="text" name="explanation" id="explanation" size="60" value="[% explanation | html %]" /><input type="hidden" name="op" value="add_validate" /></li>
103 <li>[% IF ( searchfield ) %]<span class="label">Variable: </span>[% searchfield | html %]<input type="hidden" name="variable" value="[% searchfield | html %]" />
104 [% ELSE %]<label for="variable">Variable: </label><input type="text" name="variable" id="variable" size="60" />[% END %]</li>
105 <li><label for="value">Value: </label>
106 [% IF ( type_free ) %]
107 <textarea id="value" name="value" cols="[% fieldlength | html %]">[% value | html %]</textarea>
108 [% ELSIF ( type_upload ) %]
109 <input type="file" name="value" />
110 [% ELSIF ( type_textarea || type_htmlarea ) %]
111 [% IF ( type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
112 <textarea class="mce" name="value" id="value" rows="[% rows | html %]" cols="[% cols | html %]">[% value | html %]</textarea>
114 <textarea name="value" id="value" rows="[% rows | html %]" cols="[% cols | html %]">[% value | html %]</textarea>
116 [% ELSIF ( type_choice ) %]
117 <select name="value" id="value">
118 [% FOREACH option IN options %]
119 [% IF ( option.selected ) %]
120 <option value="[% option.option | html %]" selected="selected">
122 <option value="[% option.option | html %]">
123 [% END %][% option.option | html %]</option>
127 [% IF ( type_langselector ) %]
128 [% IF ( languages_loop ) %]
130 [% FOREACH languages_loo IN languages_loop %]
132 [% IF ( languages_loo.plural ) %]
133 [% IF ( languages_loo.native_description ) %][% languages_loo.native_description | html %][% ELSE %][% languages_loo.rfc4646_subtag | html %][% END %]
134 [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]<table><tr><td>
135 [% IF ( sublanguages_loo.sublanguage_current ) %]
136 <label for="[% sublanguages_loo.rfc4646_subtag | html %]">[% sublanguages_loo.native_description | html %] [% sublanguages_loo.script_description | html %] [% sublanguages_loo.region_description | html %] [% sublanguages_loo.variant_description | html %]([% sublanguages_loo.rfc4646_subtag | html %])
137 [% IF ( sublanguages_loo.enabled ) %]
138 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
140 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" />
145 <label for="[% sublanguages_loo.rfc4646_subtag | html %]">[% sublanguages_loo.native_description | html %] [% sublanguages_loo.script_description | html %] [% sublanguages_loo.region_description | html %] [% sublanguages_loo.variant_description | html %]([% sublanguages_loo.rfc4646_subtag | html %])
146 [% IF ( sublanguages_loo.enabled ) %]
147 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
149 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" />
152 [% END %]</td></tr></table>
156 [% IF ( languages_loo.current ) %]
157 <label for="[% languages_loo.rfc4646_subtag | html %]">[% languages_loo.native_description | html %]([% languages_loo.rfc4646_subtag | html %])
158 [% IF ( languages_loo.group_enabled ) %]
159 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="[% languages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
161 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="[% languages_loo.rfc4646_subtag | html %]" type="checkbox" />
165 <label for="[% languages_loo.rfc4646_subtag | html %]">[% languages_loo.native_description | html %]([% languages_loo.rfc4646_subtag | html %])
166 [% IF ( languages_loo.group_enabled ) %]
167 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="[% languages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
169 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="[% languages_loo.rfc4646_subtag | html %]" type="checkbox" />
181 [% IF ( type_yesno ) %]
182 [% IF ( value_yes ) %]
183 <input type="radio" name="value" id="value" value="1" checked="checked" />[% ELSE %]<input type="radio" name="value" id="value" value="1" />
185 <label for="value" class="yesno">ON</label>
186 [% IF ( value_no ) %]
187 <input type="radio" name="value" id="value-no" value="0" checked="checked" />[% ELSE %]<input type="radio" name="value" id="value-no" value="0" />
189 <label for="value-no" class="yesno">OFF</label>
193 <fieldset class="action"><input type="submit" class="btn btn-primary" value="Save" />
194 [% IF ( return_tab ) %]
195 <a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl?tab=[% return_tab | html %]">Cancel</a>
197 <a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl">Cancel</a>
201 <fieldset class="brief">
202 <legend>Koha internal</legend>
203 <div class="hint">Note: change the variable type to one of the dropdown values as needed</div>
205 <li><label for="preftype">Variable type:</label>
206 <select name="preftype" id="preftype">
207 [%- IF (preftype && preftype == 'Free') || !preftype -%]
208 <option value="Free" selected>Free</option>
210 <option value="Free">Free</option>
212 [%- IF (preftype && preftype == 'Choice') -%]
213 <option value="Choice" selected>Choice</option>
215 <option value="Choice">Choice</option>
217 [%- IF (preftype && preftype == 'YesNo') -%]
218 <option value="YesNo" selected>YesNo</option>
220 <option value="YesNo">YesNo</option>
222 [%- IF (preftype && preftype == 'Integer') -%]
223 <option value="Integer" selected>Integer</option>
225 <option value="Integer">Integer</option>
227 [%- IF (preftype && preftype == 'Textarea') -%]
228 <option value="Textarea" selected>Textarea</option>
230 <option value="Textarea">Textarea</option>
232 [%- IF (preftype && preftype == 'Htmlarea') -%]
233 <option value="Htmlarea" selected>Htmlarea</option>
235 <option value="Htmlarea">Htmlarea</option>
237 [%- IF (preftype && preftype == 'Float') -%]
238 <option value="Float" selected>Float</option>
240 <option value="Float">Float</option>
242 [%- IF (preftype && preftype == 'Themes') -%]
243 <option value="Themes" selected>Themes</option>
245 <option value="Themes">Themes</option>
247 [%- IF (preftype && preftype == 'Languages') -%]
248 <option value="Languages" selected>Languages</option>
250 <option value="Languages">Languages</option>
252 [%- IF (preftype && preftype == 'Upload') -%]
253 <option value="Upload" selected>Upload</option>
255 <option value="Upload">Upload</option>
257 [%- IF (preftype && preftype == 'ClassSources') -%]
258 <option value="ClassSources" selected>ClassSources</option>
260 <option value="ClassSources">ClassSources</option>
263 <li><label for="prefoptions">Variable options:</label>
264 <div class="hint">(a choice list for choice (separated by |) or cols|rows for texarea)</div>
265 <input type="text" name="prefoptions" id="prefoptions" value="[% prefoptions | html %]" size="60" maxlength="80" /></li>
271 [% IF ( add_validate ) %]
272 <h1>Data recorded</h1>
274 <form action="[% script_name | html %]" method="post">
275 <input type="submit" class="btn btn-primary" value="OK" />
279 [% IF ( delete_confirm ) %]
281 <caption><h1>Confirm deletion of [% searchfield | html %]?</h1></caption>
283 <th>Variable name:</th>
284 <td>[% searchfield | html %]</td>
286 <tr><th>Value: </th><td>
289 <form class="inline" action="[% script_name | html %]" method="post">
290 <input type="hidden" name="op" value="delete_confirmed" />
291 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
292 <input type="hidden" name="Tvalue" value="[% Tvalue | html %]" />
293 <input type="submit" value="Yes, delete" /></form>
294 <form class="inline" action="[% script_name | html %]" method="post"><input type="submit" value="No, do not delete" /></form>
297 [% IF ( delete_confirmed ) %]
298 <h1>Data deleted</h1>
299 <form action="[% script_name | html %]" method="post">
300 <input type="submit" class="btn btn-primary" value="Back to system preferences" />
306 <div id="toolbar" class="btn-toolbar">
307 <a class="btn btn-default" id="newstopword" href="[% script_name | url %]?op=add_form"><i class="fa fa-plus"></i> New preference</a>
310 [% IF ( tab != 'local_use' ) %]
311 <p>Please click on one of the tabs at the left side of this form.</p>
314 <h1>Local use preferences</h1>
315 <div class="page-section">
316 <table id="sysprefst">
321 <th class="noExport">Actions</th>
324 <tbody>[% FOREACH loo IN loop %]
327 <td><strong><a href="[% loo.edit | url %]">[% loo.variable | html %]</a></strong></td><td> [% loo.explanation | html %]</td>
328 [% IF ( loo.oneline ) %]
329 <td class="single-line">
333 [% IF ( loo.type_upload ) %]
334 <form action="/cgi-bin/koha/admin/systempreferences.pl" method="post" enctype="multipart/form-data">
336 <form action="/cgi-bin/koha/admin/systempreferences.pl" method="post">
338 [% IF ( loo.type_free ) %]
339 <input type="text" name="value" size="[% loo.fieldlength | html %]" value="[% loo.value | html %]" />
341 [% IF ( loo.type_upload ) %]
342 <input type="file" name="value" value="[% loo.value | html %]" />
344 [% IF ( loo.type_textarea ) || ( loo.type_htmlarea ) %]
345 [% IF ( loo.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
346 <textarea class="mce" name="value" rows="[% loo.rows | html %]" cols="[% loo.cols | html %]">[% loo.value | html %]</textarea>
348 <a class="expand-textarea" style="display: none" href="#">Click to edit</a>
349 <textarea name="value" rows="[% loo.rows | html %]" cols="[% loo.cols | html %]">[% loo.value | html %]</textarea>
352 [% IF ( loo.type_choice ) %]
353 <select name="value">
354 [% FOREACH option IN loo.options %]
355 [% IF ( option.selected ) %]
356 <option value="[% option.option | html %]" selected="selected">
358 <option value="[% option.option | html %]">
359 [% END %][% option.option | html %]</option>
363 [% IF ( loo.type_langselector ) %]
364 [% IF ( loo.languages_loop ) %]
366 [% FOREACH languages_loo IN loo.languages_loop %]
368 [% IF ( languages_loo.plural ) %]
369 [% IF ( languages_loo.native_description ) %][% languages_loo.native_description | html %][% ELSE %][% languages_loo.rfc4646_subtag | html %][% END %]
370 [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]<table><tr><td>
371 [% IF ( sublanguages_loo.sublanguage_current ) %]
372 <label for="[% sublanguages_loo.rfc4646_subtag | html %]">[% sublanguages_loo.native_description | html %] [% sublanguages_loo.script_description | html %] [% sublanguages_loo.region_description | html %] [% sublanguages_loo.variant_description | html %]([% sublanguages_loo.rfc4646_subtag | html %])
373 [% IF ( sublanguages_loo.enabled ) %]
374 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
376 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" />
381 <label for="[% sublanguages_loo.rfc4646_subtag | html %]">[% sublanguages_loo.native_description | html %] [% sublanguages_loo.script_description | html %] [% sublanguages_loo.region_description | html %] [% sublanguages_loo.variant_description | html %]([% sublanguages_loo.rfc4646_subtag | html %])
382 [% IF ( sublanguages_loo.enabled ) %]
383 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
385 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" />
388 [% END %]</td></tr></table>
392 [% IF ( languages_loo.current ) %]
393 <label for="[% languages_loo.rfc4646_subtag | html %]">[% languages_loo.native_description | html %]([% languages_loo.rfc4646_subtag | html %])
394 [% IF ( languages_loo.group_enabled ) %]
395 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="opac[% languages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
397 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="opac[% languages_loo.rfc4646_subtag | html %]" type="checkbox" />
401 <label for="[% languages_loo.rfc4646_subtag | html %]">[% languages_loo.native_description | html %]([% languages_loo.rfc4646_subtag | html %])
402 [% IF ( languages_loo.group_enabled ) %]
403 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="opac[% languages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
405 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="opac[% languages_loo.rfc4646_subtag | html %]" type="checkbox" />
417 [% IF ( loo.type_yesno ) %]
418 [% IF ( loo.value_yes ) %]
419 <input type="radio" name="value" value="1" checked="checked" />[% ELSE %]<input type="radio" name="value" value="1" />
421 <label for="value" class="yesno">ON</label>
422 [% IF ( loo.value_no ) %]
423 <input type="radio" name="value" value="0" checked="checked" />[% ELSE %]<input type="radio" name="value" value="0" />
425 <label for="value-no" class="yesno">OFF</label>
427 <input type="hidden" name="op" value="add_validate" />
428 <input type="hidden" name="variable" value="[% loo.variable | html %]" />
429 <input type="hidden" name="prefoptions" value="[% loo.prefoptions | html %]" />
430 <input type="hidden" name="preftype" value="[% loo.type | html %]" />
431 <input type="hidden" name="explanation" value="[% loo.explanation | html %]" />
432 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
436 <td class="actions"><a class="btn btn-default btn-xs" href="[% loo.edit | url %]"><i class="fa fa-pencil-alt"></i> Edit</a> <a class="btn btn-default btn-xs" href="[% loo.delete | url %]"><i class="fa fa-trash-can"></i> Delete</a></td>
441 [% IF tab == 'local_use' %]</div>[% END %]
445 </div> <!-- /.col-sm-10.col-sm-push-2 -->
447 <div class="col-sm-2 col-sm-pull-10">
449 [% INCLUDE 'prefs-menu.inc' %]
451 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
452 </div> <!-- /.row -->
454 [% MACRO jsinclude BLOCK %]
455 [%# Add WYSIWYG editor for htmlarea system preferences %]
456 [% INCLUDE 'wysiwyg-systempreferences.inc' %]
458 [% INCLUDE 'datatables.inc' %]
460 $(document).ready(function() {
461 [% IF ( loop ) %]$("#sysprefst").dataTable($.extend(true, {}, dataTablesDefaults, {
462 "sDom": '<"top pager"ilf>t',
464 { "aTargets": [ -1, -2, -3 ], "bSortable": false }
472 [% IF ( add_form ) %]
473 $(document).ready(function() {
474 $('.variabletype').css({ color: "#0000CC", cursor: "pointer" });
475 $('.variabletype').click(function() {
476 $('#preftype').attr("value",$(this).attr("id"));
480 // FIXME: many of these js functions appear unused
481 function isNotNull(f,noalert) {
482 if (f.value.length ==0) {
488 function isNum(v,maybenull) {
489 var n = new Number(v.value);
493 if (maybenull==0 && v.value=='') {
503 if (f.variable.value.length==0) {
504 _alertString += "\n- " + _("variable missing");
506 if (f.value.value.length==0) {
507 _alertString += "\n- " + _("value missing");
509 if (_alertString.length==0) {
510 document.Aform.submit();
512 alertString2 = _("Form not submitted because of the following problem(s)");
513 alertString2 += "\n------------------------------------------------------------------------------------\n";
514 alertString2 += _alertString;
519 $( '#sysprefst .expand-textarea' ).show().click( function () {
520 $( this ).hide().nextAll( 'textarea, input[type=submit]' ).show( 'slow' );
523 } ).nextAll( 'textarea, input[type=submit]' ).hide();
528 [% INCLUDE 'intranet-bottom.inc' %]