5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Administration › [% IF ( add_form ) %] System preferences › [% IF ( modify ) %]Modify system preference '[% searchfield | html %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] System preferences › Data added[% END %]
7 [% IF ( delete_confirm ) %] System preferences › [% searchfield | html %] › Confirm deletion of parameter '[% searchfield | html %]'[% END %][% IF ( delete_confirmed ) %] System preferences › Parameter deleted[% END %][% IF ( else ) %]System preferences[% END %]</title>
8 [% INCLUDE 'doc-head-close.inc' %]
11 <body id="admin_systempreferences" class="admin">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'prefs-admin-search.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
26 <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a>
29 <a href="#" aria-current="page">
31 Modify system preference '[% searchfield | html %]'
33 Add a system preference
39 [% IF ( add_validate ) %]
41 <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a>
44 <a href="#" aria-current="page">
50 [% IF ( delete_confirm ) %]
52 <a href="/cgi-bin/koha/admin/systempreferences.pl">System Preferences</a>
55 <a href="/cgi-bin/koha/admin/systempreferences.pl?op=add_form&searchfield=[% searchfield | uri %]">[% searchfield | html %]</a>
58 <a href="#" aria-current="page">
59 Confirm deletion of parameter '[% searchfield | html %]'
64 [% IF ( delete_confirmed ) %]
66 <a href="/cgi-bin/koha/admin/systempreferences.pl">System preferences</a>
69 <a href="#" aria-current="page">
77 <a href="#" aria-current="page">
85 <div class="main container-fluid">
87 <div class="col-sm-10 col-sm-push-2">
91 [% IF ( type_upload ) %]
92 <form action="[% script_name | html %]" name="Aform" method="post" enctype="multipart/form-data">
94 <form action="[% script_name | html %]" name="Aform" method="post">
96 <fieldset class="rows"><legend>
97 [% IF ( modify ) %]Modify
99 [% END %] a system preference</legend><ol>
100 <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>
101 <li>[% IF ( searchfield ) %]<span class="label">Variable: </span>[% searchfield | html %]<input type="hidden" name="variable" value="[% searchfield | html %]" />
102 [% ELSE %]<label for="variable">Variable: </label><input type="text" name="variable" id="variable" size="60" />[% END %]</li>
103 <li><label for="value">Value: </label>
104 [% IF ( type_free ) %]
105 <textarea id="value" name="value" cols="[% fieldlength | html %]">[% value | html %]</textarea>
106 [% ELSIF ( type_upload ) %]
107 <input type="file" name="value" />
108 [% ELSIF ( type_textarea || type_htmlarea ) %]
109 [% IF ( type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
110 <textarea class="mce" name="value" id="value" rows="[% rows | html %]" cols="[% cols | html %]">[% value | html %]</textarea>
112 <textarea name="value" id="value" rows="[% rows | html %]" cols="[% cols | html %]">[% value | html %]</textarea>
114 [% ELSIF ( type_choice ) %]
115 <select name="value" id="value">
116 [% FOREACH option IN options %]
117 [% IF ( option.selected ) %]
118 <option value="[% option.option | html %]" selected="selected">
120 <option value="[% option.option | html %]">
121 [% END %][% option.option | html %]</option>
125 [% IF ( type_langselector ) %]
126 [% IF ( languages_loop ) %]
128 [% FOREACH languages_loo IN languages_loop %]
130 [% IF ( languages_loo.plural ) %]
131 [% IF ( languages_loo.native_description ) %][% languages_loo.native_description | html %][% ELSE %][% languages_loo.rfc4646_subtag | html %][% END %]
132 [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]<table><tr><td>
133 [% IF ( sublanguages_loo.sublanguage_current ) %]
134 <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 %])
135 [% IF ( sublanguages_loo.enabled ) %]
136 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
138 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" />
143 <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 %])
144 [% IF ( sublanguages_loo.enabled ) %]
145 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
147 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" />
150 [% END %]</td></tr></table>
154 [% IF ( languages_loo.current ) %]
155 <label for="[% languages_loo.rfc4646_subtag | html %]">[% languages_loo.native_description | html %]([% languages_loo.rfc4646_subtag | html %])
156 [% IF ( languages_loo.group_enabled ) %]
157 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="[% languages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
159 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="[% languages_loo.rfc4646_subtag | html %]" type="checkbox" />
163 <label for="[% languages_loo.rfc4646_subtag | html %]">[% languages_loo.native_description | html %]([% languages_loo.rfc4646_subtag | html %])
164 [% IF ( languages_loo.group_enabled ) %]
165 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="[% languages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
167 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="[% languages_loo.rfc4646_subtag | html %]" type="checkbox" />
179 [% IF ( type_yesno ) %]
180 [% IF ( value_yes ) %]
181 <input type="radio" name="value" id="value" value="1" checked="checked" />[% ELSE %]<input type="radio" name="value" id="value" value="1" />
183 <label for="value" class="yesno">ON</label>
184 [% IF ( value_no ) %]
185 <input type="radio" name="value" id="value-no" value="0" checked="checked" />[% ELSE %]<input type="radio" name="value" id="value-no" value="0" />
187 <label for="value-no" class="yesno">OFF</label>
191 <fieldset class="action"><input type="submit" value="Save" />
192 [% IF ( return_tab ) %]
193 <a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl?tab=[% return_tab | html %]">Cancel</a>
195 <a class="cancel" href="/cgi-bin/koha/admin/systempreferences.pl">Cancel</a>
199 <fieldset class="brief">
200 <legend>Koha internal</legend>
201 <div class="hint">Note: change the variable type to one of the dropdown values as needed</div>
203 <li><label for="preftype">Variable type:</label>
204 <select name="preftype" id="preftype">
205 [%- IF (preftype && preftype == 'Free') || !preftype -%]
206 <option value="Free" selected>Free</option>
208 <option value="Free">Free</option>
210 [%- IF (preftype && preftype == 'Choice') -%]
211 <option value="Choice" selected>Choice</option>
213 <option value="Choice">Choice</option>
215 [%- IF (preftype && preftype == 'YesNo') -%]
216 <option value="YesNo" selected>YesNo</option>
218 <option value="YesNo">YesNo</option>
220 [%- IF (preftype && preftype == 'Integer') -%]
221 <option value="Integer" selected>Integer</option>
223 <option value="Integer">Integer</option>
225 [%- IF (preftype && preftype == 'Textarea') -%]
226 <option value="Textarea" selected>Textarea</option>
228 <option value="Textarea">Textarea</option>
230 [%- IF (preftype && preftype == 'Htmlarea') -%]
231 <option value="Htmlarea" selected>Htmlarea</option>
233 <option value="Htmlarea">Htmlarea</option>
235 [%- IF (preftype && preftype == 'Float') -%]
236 <option value="Float" selected>Float</option>
238 <option value="Float">Float</option>
240 [%- IF (preftype && preftype == 'Themes') -%]
241 <option value="Themes" selected>Themes</option>
243 <option value="Themes">Themes</option>
245 [%- IF (preftype && preftype == 'Languages') -%]
246 <option value="Languages" selected>Languages</option>
248 <option value="Languages">Languages</option>
250 [%- IF (preftype && preftype == 'Upload') -%]
251 <option value="Upload" selected>Upload</option>
253 <option value="Upload">Upload</option>
255 [%- IF (preftype && preftype == 'ClassSources') -%]
256 <option value="ClassSources" selected>ClassSources</option>
258 <option value="ClassSources">ClassSources</option>
261 <li><label for="prefoptions">Variable options:</label>
262 <div class="hint">(a choice list for choice (separated by |) or cols|rows for texarea)</div>
263 <input type="text" name="prefoptions" id="prefoptions" value="[% prefoptions | html %]" size="60" maxlength="80" /></li>
269 [% IF ( add_validate ) %]
270 <h3>Data recorded</h3>
272 <form action="[% script_name | html %]" method="post">
273 <input type="submit" value="OK" />
277 [% IF ( delete_confirm ) %]
279 <caption>Confirm deletion of [% searchfield | html %]?</caption>
281 <th>Variable name:</th>
282 <td>[% searchfield | html %]</td>
284 <tr><th>Value: </th><td>
287 <form class="inline" action="[% script_name | html %]" method="post">
288 <input type="hidden" name="op" value="delete_confirmed" />
289 <input type="hidden" name="searchfield" value="[% searchfield | html %]" />
290 <input type="hidden" name="Tvalue" value="[% Tvalue | html %]" />
291 <input type="submit" value="Yes, delete" /></form>
292 <form class="inline" action="[% script_name | html %]" method="post"><input type="submit" value="No, do not delete" /></form>
295 [% IF ( delete_confirmed ) %]
296 <h3>Data deleted</h3>
297 <form action="[% script_name | html %]" method="post">
298 <input type="submit" value="Back to System Preferences" />
304 <div id="toolbar" class="btn-toolbar">
305 <a class="btn btn-default" id="newstopword" href="[% script_name | url %]?op=add_form"><i class="fa fa-plus"></i> New preference</a>
308 [% IF ( tab != 'local_use' ) %]
309 <p>Please click on one of the tabs at the left side of this form.</p>
312 <h1>Local use preferences</h1>
313 <table width="80%" id="sysprefst">
318 <th class="noExport">Actions</th>
321 <tbody>[% FOREACH loo IN loop %]
324 <td><strong><a href="[% loo.edit | url %]">[% loo.variable | html %]</a></strong></td><td> [% loo.explanation | html %]</td>
325 [% IF ( loo.oneline ) %]
326 <td class="single-line">
330 [% IF ( loo.type_upload ) %]
331 <form action="/cgi-bin/koha/admin/systempreferences.pl" method="post" enctype="multipart/form-data">
333 <form action="/cgi-bin/koha/admin/systempreferences.pl" method="post">
335 [% IF ( loo.type_free ) %]
336 <input type="text" name="value" size="[% loo.fieldlength | html %]" value="[% loo.value | html %]" />
338 [% IF ( loo.type_upload ) %]
339 <input type="file" name="value" value="[% loo.value | html %]" />
341 [% IF ( loo.type_textarea ) || ( loo.type_htmlarea ) %]
342 [% IF ( loo.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
343 <textarea class="mce" name="value" rows="[% loo.rows | html %]" cols="[% loo.cols | html %]">[% loo.value | html %]</textarea>
345 <a class="expand-textarea" style="display: none" href="#">Click to edit</a>
346 <textarea name="value" rows="[% loo.rows | html %]" cols="[% loo.cols | html %]">[% loo.value | html %]</textarea>
349 [% IF ( loo.type_choice ) %]
350 <select name="value">
351 [% FOREACH option IN loo.options %]
352 [% IF ( option.selected ) %]
353 <option value="[% option.option | html %]" selected="selected">
355 <option value="[% option.option | html %]">
356 [% END %][% option.option | html %]</option>
360 [% IF ( loo.type_langselector ) %]
361 [% IF ( loo.languages_loop ) %]
363 [% FOREACH languages_loo IN loo.languages_loop %]
365 [% IF ( languages_loo.plural ) %]
366 [% IF ( languages_loo.native_description ) %][% languages_loo.native_description | html %][% ELSE %][% languages_loo.rfc4646_subtag | html %][% END %]
367 [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]<table><tr><td>
368 [% IF ( sublanguages_loo.sublanguage_current ) %]
369 <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 %])
370 [% IF ( sublanguages_loo.enabled ) %]
371 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
373 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" />
378 <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 %])
379 [% IF ( sublanguages_loo.enabled ) %]
380 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
382 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="value" id="[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" />
385 [% END %]</td></tr></table>
389 [% IF ( languages_loo.current ) %]
390 <label for="[% languages_loo.rfc4646_subtag | html %]">[% languages_loo.native_description | html %]([% languages_loo.rfc4646_subtag | html %])
391 [% IF ( languages_loo.group_enabled ) %]
392 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="opac[% languages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
394 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="opac[% languages_loo.rfc4646_subtag | html %]" type="checkbox" />
398 <label for="[% languages_loo.rfc4646_subtag | html %]">[% languages_loo.native_description | html %]([% languages_loo.rfc4646_subtag | html %])
399 [% IF ( languages_loo.group_enabled ) %]
400 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="opac[% languages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" />
402 <input value="[% languages_loo.rfc4646_subtag | html %]" name="value" id="opac[% languages_loo.rfc4646_subtag | html %]" type="checkbox" />
414 [% IF ( loo.type_yesno ) %]
415 [% IF ( loo.value_yes ) %]
416 <input type="radio" name="value" value="1" checked="checked" />[% ELSE %]<input type="radio" name="value" value="1" />
418 <label for="value" class="yesno">ON</label>
419 [% IF ( loo.value_no ) %]
420 <input type="radio" name="value" value="0" checked="checked" />[% ELSE %]<input type="radio" name="value" value="0" />
422 <label for="value-no" class="yesno">OFF</label>
424 <input type="hidden" name="op" value="add_validate" />
425 <input type="hidden" name="variable" value="[% loo.variable | html %]" />
426 <input type="hidden" name="prefoptions" value="[% loo.prefoptions | html %]" />
427 <input type="hidden" name="preftype" value="[% loo.type | html %]" />
428 <input type="hidden" name="explanation" value="[% loo.explanation | html %]" />
429 <button type="submit" class="btn btn-default btn-xs"><i class="fa fa-save"></i> Save</button>
433 <td class="actions"><a class="btn btn-default btn-xs" href="[% loo.edit | url %]"><i class="fa fa-pencil"></i> Edit</a> <a class="btn btn-default btn-xs" href="[% loo.delete | url %]"><i class="fa fa-trash"></i> Delete</a></td>
441 </div> <!-- /.col-sm-10.col-sm-push-2 -->
443 <div class="col-sm-2 col-sm-pull-10">
445 [% INCLUDE 'prefs-menu.inc' %]
447 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
448 </div> <!-- /.row -->
450 [% MACRO jsinclude BLOCK %]
451 [%# Add WYSIWYG editor for htmlarea system preferences %]
452 [% INCLUDE 'wysiwyg-systempreferences.inc' %]
454 [% INCLUDE 'datatables.inc' %]
456 $(document).ready(function() {
457 [% IF ( loop ) %]$("#sysprefst").dataTable($.extend(true, {}, dataTablesDefaults, {
458 "sDom": '<"top pager"ilf>t',
460 { "aTargets": [ -1, -2, -3 ], "bSortable": false }
468 [% IF ( add_form ) %]
469 $(document).ready(function() {
470 $('.variabletype').css({ color: "#0000CC", cursor: "pointer" });
471 $('.variabletype').click(function() {
472 $('#preftype').attr("value",$(this).attr("id"));
476 // FIXME: many of these js functions appear unused
477 function isNotNull(f,noalert) {
478 if (f.value.length ==0) {
484 function isNum(v,maybenull) {
485 var n = new Number(v.value);
489 if (maybenull==0 && v.value=='') {
499 if (f.variable.value.length==0) {
500 _alertString += "\n- " + _("variable missing");
502 if (f.value.value.length==0) {
503 _alertString += "\n- " + _("value missing");
505 if (_alertString.length==0) {
506 document.Aform.submit();
508 alertString2 = _("Form not submitted because of the following problem(s)");
509 alertString2 += "\n------------------------------------------------------------------------------------\n";
510 alertString2 += _alertString;
515 $( '#sysprefst .expand-textarea' ).show().click( function () {
516 $( this ).hide().nextAll( 'textarea, input[type=submit]' ).show( 'slow' );
519 } ).nextAll( 'textarea, input[type=submit]' ).hide();
524 [% INCLUDE 'intranet-bottom.inc' %]