7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>System preferences › Administration › Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% Asset.css("css/preferences.css") | $raw %]
11 [% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %]
12 [% Asset.css("css/humanmsg.css") | $raw %]
13 [% Asset.css("lib/codemirror/codemirror.min.css") | $raw %]
14 [% Asset.css("lib/codemirror/lint.min.css") | $raw %]
16 <body id="admin_preferences" class="admin">
17 [% WRAPPER 'header.inc' %]
18 [% INCLUDE 'prefs-admin-search.inc' %]
21 [% WRAPPER 'sub-header.inc' %]
22 [% WRAPPER breadcrumbs %]
23 [% WRAPPER breadcrumb_item %]
24 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
26 [% WRAPPER breadcrumb_item bc_active= 1 %]
27 <span>System preferences</span>
29 [% END #/ WRAPPER breadcrumbs %]
30 [% END #/ WRAPPER sub-header.inc %]
32 <div class="main container-fluid">
34 <div class="col-sm-10 col-sm-push-2">
37 [% IF ( jump_not_found ) %]
38 <div class="dialog alert">
39 Could not find a system preference named <code>[% jumpfield | html %]</code>.
42 [% IF ( search_not_found ) %]
43 <div class="dialog alert">
44 No system preferences matched your search for: <strong>[% searchfield | html %]</strong>
46 <h1>System preferences</h1>
47 [% ELSIF searchfield %]
48 <h1>System preferences matching: [% searchfield | html %]</h1>
50 <h1>System preferences</h1>
52 [% FOREACH TAB IN TABS %]
53 <div class="prefs-tab">
54 <h2>[% TAB.tab_title | html %] preferences</h2>
55 <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
56 [% UNLESS ( searchfield ) %]<div id="toolbar"><button class="save-all btn btn-primary" type="submit">Save all [% TAB.tab_title | html %] preferences</button></div>[% END %]
57 <input type="hidden" name="op" value="save" />
58 <input type="hidden" name="tab" value="[% TAB.tab_id | html %]" />
60 [% FOREACH LINE IN TAB.LINES %]
61 [% IF ( LINE.is_group_title ) %]
62 [% UNLESS ( loop.first ) %]</tbody></table></div>[% END %]
63 <div class="page-section">
65 <div class="col-sm-6">
66 <h3 id="[% TAB.tab_id | $HtmlId %]_[% LINE.title | $HtmlId %]"><i class="fa fa-caret-down"></i> [% LINE.title | html %]</h3>
68 <div class="col-sm-6">
69 [% IF ( searchfield ) %]
70 <div class="pull-right"><a class="btn btn-link" href="/cgi-bin/koha/admin/preferences.pl?tab=[% TAB.tab_id | html %]#[% TAB.tab_id | $HtmlId %]_[% LINE.title | $HtmlId %]"><i class="fa fa-list-ul"></i> View all [% LINE.title | html %] preferences</a></div>
75 <table class="preferences" id="collapse_[% TAB.tab_id | $HtmlId %]_[% LINE.title | $HtmlId %]">
76 <thead><tr><th>Preference</th><th>Value</th></tr></thead>
77 [% UNLESS ( loop.last ) %]<tbody>[% END %]
79 [% IF ( loop.first ) %]<table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody>[% END %]
81 <td class="name-cell">
83 [% FOREACH NAME IN LINE.NAMES %]
84 <label for="pref_[% NAME.name | html %]" class="nowrap">
85 <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=[% NAME.name | uri %]">
86 <i class="fa fa-bookmark" aria-hidden="true"></i></a>
87 [% IF ( NAME.jumped ) %]
88 <span class="term" id="jumped">[% NAME.name | html %]</span>
89 [% ELSIF ( NAME.highlighted ) %]
90 <span class="term">[% NAME.name | html %]</span>
92 [% NAME.name | html %]
95 [% IF NAME.overridden %]
96 <span class="overridden" title="The system preference [% NAME.name | html %] may have been overridden from this value by one or more virtual hosts.">
101 [% UNLESS ( loop.last ) %]<br />[% END %]
106 [% FOREACH CHUNK IN LINE.CHUNKS %]
107 [% IF ( CHUNK.type_text ) %]
108 [% CHUNK.contents | $raw %]
109 [% ELSIF ( CHUNK.type_input ) %]
110 [% IF CHUNK.name == 'UsageStatsGeolocation' %]
111 <input type="[%IF CHUNK.input_type %][% CHUNK.input_type | html %][% ELSE %]text[% END %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %]" value="[% CHUNK.value | html %]" autocomplete="off" readonly="readonly" size="40" style="width: auto;"/> [% IF ( CHUNK.dateinput ) %]<span class="hint">[% INCLUDE 'date-format.inc' %]</span>[% END %]
113 <input type="[%IF CHUNK.input_type %][% CHUNK.input_type | html %][% ELSE %]text[% END %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %]" value="[% CHUNK.value | html %]" autocomplete="off" /> [% IF ( CHUNK.dateinput ) %]<span class="hint">[% INCLUDE 'date-format.inc' %]</span>[% END %]
115 [% ELSIF ( CHUNK.type_select ) %]
116 [% IF CHUNK.disabled %]
117 <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" disabled="disabled" class="preference preference-[% CHUNK.class or "choice" | html %]">
119 <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]">
121 [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
122 [% IF ( CHOICE.selected ) %]
123 <option value="[% CHOICE.value | html %]" selected="selected">
125 <option value="[% CHOICE.value | html %]">
127 [% CHOICE.text | html %]
131 [% ELSIF ( CHUNK.type_modalselect ) %]
132 <input type="text" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="modalselect preference preference-[% CHUNK.type | html %]" data-source="[% CHUNK.source | html %]" data-required="[% CHUNK.required | html %]" data-exclusions="[% CHUNK.exclusions | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/>
133 [% ELSIF ( CHUNK.type_multiple ) %]
134 <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
135 [% FOREACH CHOICE IN CHUNK.CHOICES %][% IF ( CHOICE.selected ) %]<option value="[% CHOICE.value | html %]" selected="selected">[% ELSE %]<option value="[% CHOICE.value | html %]">[% END %][% CHOICE.text | html %]</option>[% END %]
137 [% ELSIF ( CHUNK.type_textarea )%]
138 [% IF ( CHUNK.syntax == "text/html" && Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
139 <textarea name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %] mce" rows="20" cols="60">[% CHUNK.value | html %]</textarea>
141 <a class="expand-textarea" id="expand_[% CHUNK.name | html %]" data-target="[% CHUNK.name | html %]" data-syntax="[% CHUNK.syntax | html %]" href="#">Click to edit</a>
142 <textarea style="display:none" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "short" | html %] codemirror" rows="10" cols="40">[% CHUNK.value | html %]</textarea>
143 <a class="collapse-textarea" id="collapse_[% CHUNK.name | html %]" data-target="[% CHUNK.name | html %]" data-syntax="[% CHUNK.syntax | html %]" style="display:none" href="#">Click to collapse</br></a>
145 [% ELSIF ( CHUNK.type_languages ) %]
146 <ul class="sortable">
147 [% FOREACH language IN CHUNK.languages %]
148 [% IF ( language.plural ) %]
150 [% IF ( language.native_description ) %]
151 [% language.native_description | html %]
153 [% language.rfc4646_subtag | html %]
155 [% IF language.sublanguages_loop.size > 0 %]
157 [% FOREACH sublanguages_loo IN language.sublanguages_loop %]
159 <label for="pref_[% CHUNK.name | html %]_[% 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 %])</label>
160 [% IF ( sublanguages_loo.enabled ) %]
161 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]_[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" checked="checked" class="preference preference-checkbox"/>
163 <input value="[% sublanguages_loo.rfc4646_subtag | html %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]_[% sublanguages_loo.rfc4646_subtag | html %]" type="checkbox" class="preference preference-checkbox"/>
166 [% END # FOREACH sublanguages %]
172 <label for="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</label>
173 [% IF ( language.group_enabled ) %]
174 <input value="[% language.rfc4646_subtag | html %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]" type="checkbox" checked="checked" class="preference preference-checkbox"/>
176 <input value="[% language.rfc4646_subtag | html %]" name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]" type="checkbox" class="preference preference-checkbox"/>
179 [% END # IF language.plural %]
180 [% END # FOREACH language %]
181 </ul> <!-- / ul.sortable -->
184 [% IF LINE.WARNINGS.size %]
185 [% FOR w IN LINE.WARNINGS %]
186 <div class="dialog alert">
188 [% CASE "bcrypt_config_not_set" %]<span>Pseudonymization must only be turned on if the 'bcrypt_settings' configuration entry exists and is correctly filled in the Koha configuration file.</span>
189 [% CASE %]<span>Unknown warning "[% w | html %]"</span>
196 [% IF ( loop.last ) %]</tbody></table></div>[% END %]
199 <fieldset class="action"><button class="save-all submit btn btn-primary" type="submit">Save all [% TAB.tab_title | html %] preferences</button> <a href="/cgi-bin/koha/admin/preferences.pl" class="force_reload cancel">Cancel</a></fieldset>
205 </div> <!-- /.col-sm-10.col-sm-push-2 -->
207 <div class="col-sm-2 col-sm-pull-10">
209 [% INCLUDE 'prefs-menu.inc' %]
211 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
212 </div> <!-- /.row -->
215 <div class="modal" id="prefModal" tabindex="-1" role="dialog" aria-labelledby="prefModalLabel">
216 <div class="modal-dialog modal-wide" role="document">
217 <div class="modal-content">
218 <div class="modal-header">
219 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
220 <h4 class="modal-title" id="prefModalLabel">Modal title</h4>
222 <div class="modal-body">
224 <a href="#" id="select_all"><i class="fa fa-check"></i> Select all</a>
226 <a href="#" id="clear_all"><i class="fa fa-times"></i> Clear all</a>
228 <form action="#" id="prefModalForm">
231 <div class="modal-footer">
232 <button id="saveModalPrefs" data-target="" type="button" class="btn btn-primary">Save</button>
233 <button type="button" class="btn btn-link cancel" data-dismiss="modal">Cancel</button>
239 [% MACRO jsinclude BLOCK %]
240 [% INCLUDE 'datatables.inc' %]
241 [% Asset.js("lib/hc-sticky.js") | $raw %]
242 [% Asset.js("lib/jquery/plugins/multiple-select/jquery.multiple.select.js") | $raw %]
243 [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
244 [% Asset.js( "lib/codemirror/css.min.js" ) | $raw %]
245 [% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %]
246 [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
247 [% Asset.js( "lib/codemirror/yaml.min.js" ) | $raw %]
248 [% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %]
249 [% Asset.js( "lib/linters/jshint.min.js" ) | $raw %]
250 [% Asset.js( "lib/linters/htmlhint.min.js" ) | $raw %]
251 [% Asset.js( "lib/linters/csslint.min.js" ) | $raw %]
252 [% Asset.js( "lib/linters/js-yaml.min.js" ) | $raw %]
253 [% Asset.js( "lib/codemirror/html-lint.min.js" ) | $raw %]
254 [% Asset.js( "lib/codemirror/javascript-lint.min.js" ) | $raw %]
255 [% Asset.js( "lib/codemirror/css-lint.min.js" ) | $raw %]
256 [% Asset.js( "lib/codemirror/yaml-lint.min.js" ) | $raw %]
260 var themelang = "[% themelang | html %]";
261 $(document).ready(function(){
262 [% UNLESS ( searchfield ) %]
263 Sticky = $("#toolbar");
266 stickyClass: "floating"
269 $("select[multiple='multiple']").multipleSelect( {
270 placeholder: _("Please select ..."),
271 selectAllText: _("Select all"),
272 allSelected: _("All selected"),
273 countSelected: _("# of % selected"),
274 noMatchesFound: _("No matches found")
276 $(".force_reload").on("click",function(e){
278 window.location.reload(true);
281 // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
282 var to_highlight = "[% To.json( searchfield ) | html %]";
283 var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
284 var db_columns = [% To.json( db_columns ) | $raw %];
286 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
287 [% Asset.js("js/ajax.js") | $raw %]
288 [% Asset.js("js/pages/preferences.js") | $raw %]
289 [%# Add WYSIWYG editor for htmlarea system preferences %]
290 [% INCLUDE 'wysiwyg-systempreferences.inc' %]
293 [% INCLUDE 'intranet-bottom.inc' %]