7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Administration › System preferences</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 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'prefs-admin-search.inc' %]
20 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
23 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
26 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
29 <a href="#" aria-current="page">
36 <div class="main container-fluid">
38 <div class="col-sm-10 col-sm-push-2">
41 [% IF ( jump_not_found ) %]
42 <h2>System preferences</h2>
43 <div class="dialog alert">
44 Could not find a system preference named <code>[% jumpfield | html %]</code>.
47 [% IF ( search_not_found ) %]
48 <div class="dialog alert">
49 No system preferences matched your search for: <strong>[% searchfield | html %]</strong>
51 [% ELSIF searchfield %]
52 <h1>You searched for: [% searchfield | html %]</h1>
54 [% FOREACH TAB IN TABS %]
55 <div class="prefs-tab">
56 <h2>[% TAB.tab_title | html %] preferences</h2>
57 <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
58 [% UNLESS ( searchfield ) %]<div id="toolbar"><button class="save-all submit" type="submit">Save all [% TAB.tab_title | html %] preferences</button></div>[% END %]
59 <input type="hidden" name="op" value="save" />
60 <input type="hidden" name="tab" value="[% TAB.tab_id | html %]" />
62 [% FOREACH LINE IN TAB.LINES %]
63 [% IF ( LINE.is_group_title ) %]
64 [% UNLESS ( loop.first ) %]</tbody></table>[% END %]
66 <div class="col-sm-6">
67 <h3 id="[% LINE.title | $HtmlId %]"><i class="fa fa-caret-down"></i> [% LINE.title | html %]</h3>
69 <div class="col-sm-6">
70 [% IF ( searchfield ) %]
71 <div class="pull-right"><a class="btn btn-link" href="/cgi-bin/koha/admin/preferences.pl?tab=[% TAB.tab_id | html %]#[% LINE.title | $HtmlId %]"><i class="fa fa-list-ul"></i> View all [% LINE.title | html %] preferences</a></div>
76 <table class="preferences" id="collapse_[% LINE.title | $HtmlId %]">
77 <thead><tr><th>Preference</th><th>Value</th></tr></thead>
78 [% UNLESS ( loop.last ) %]<tbody>[% END %]
80 [% IF ( loop.first ) %]<table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody>[% END %]
82 <td class="name-cell">
84 [% FOREACH NAME IN LINE.NAMES %]
85 <label for="pref_[% NAME.name | html %]" class="nowrap">
86 <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=[% NAME.name | uri %]">
87 <i class="fa fa-bookmark" aria-hidden="true"></i></a>
88 [% IF ( NAME.jumped ) %]
89 <span class="term" id="jumped">[% NAME.name | html %]</span>
90 [% ELSIF ( NAME.highlighted ) %]
91 <span class="term">[% NAME.name | html %]</span>
93 [% NAME.name | html %]
96 [% IF NAME.overridden %]
97 <span class="overridden" title="The system preference [% NAME.name | html %] may have been overridden from this value by one or more virtual hosts.">
102 [% UNLESS ( loop.last ) %]<br />[% END %]
107 [% FOREACH CHUNK IN LINE.CHUNKS %]
108 [% IF ( CHUNK.type_text ) %]
109 [% CHUNK.contents | $raw %]
110 [% ELSIF ( CHUNK.type_input ) %]
111 [% IF CHUNK.name == 'UsageStatsGeolocation' %]
112 <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 %]
114 <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 %]
116 [% ELSIF ( CHUNK.type_select ) %]
117 <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]">
118 [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
119 [% IF ( CHOICE.selected ) %]
120 <option value="[% CHOICE.value | html %]" selected="selected">
122 <option value="[% CHOICE.value | html %]">
124 [% CHOICE.text | html %]
128 [% ELSIF ( CHUNK.type_modalselect ) %]
129 <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-exclusions="[% CHUNK.exclusions | html %]" readonly="readonly" value="[% CHUNK.value | html %]"/>
130 [% ELSIF ( CHUNK.type_multiple ) %]
131 <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
132 [% 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 %]
134 [% ELSIF ( CHUNK.type_textarea )%]
135 [% IF ( CHUNK.syntax == "text/html" && Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
136 <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>
138 <a class="expand-textarea" id="expand_[% CHUNK.name | html %]" data-target="[% CHUNK.name | html %]" data-syntax="[% CHUNK.syntax | html %]" href="#">Click to edit</a>
139 <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>
140 <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>
142 [% ELSIF ( CHUNK.type_languages ) %]
143 <ul class="sortable">
144 [% FOREACH language IN CHUNK.languages %]
145 [% IF ( language.plural ) %]
147 [% IF ( language.native_description ) %]
148 [% language.native_description | html %]
150 [% language.rfc4646_subtag | html %]
152 [% IF language.sublanguages_loop.size > 0 %]
154 [% FOREACH sublanguages_loo IN language.sublanguages_loop %]
156 <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>
157 [% IF ( sublanguages_loo.enabled ) %]
158 <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"/>
160 <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"/>
163 [% END # FOREACH sublanguages %]
169 <label for="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</label>
170 [% IF ( language.group_enabled ) %]
171 <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"/>
173 <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"/>
176 [% END # IF language.plural %]
177 [% END # FOREACH language %]
178 </ul> <!-- / ul.sortable -->
183 [% IF ( loop.last ) %]</tbody></table>[% END %]
186 <fieldset class="action"><button class="save-all submit" 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>
192 </div> <!-- /.col-sm-10.col-sm-push-2 -->
194 <div class="col-sm-2 col-sm-pull-10">
196 [% INCLUDE 'prefs-menu.inc' %]
198 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
199 </div> <!-- /.row -->
202 <div class="modal" id="prefModal" tabindex="-1" role="dialog" aria-labelledby="prefModalLabel">
203 <div class="modal-dialog modal-wide" role="document">
204 <div class="modal-content">
205 <div class="modal-header">
206 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
207 <h4 class="modal-title" id="prefModalLabel">Modal title</h4>
209 <div class="modal-body">
211 <a href="#" id="select_all"><i class="fa fa-check"></i> Select all</a>
213 <a href="#" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
215 <form action="#" id="prefModalForm">
218 <div class="modal-footer">
219 <button id="saveModalPrefs" data-target="" type="button" class="btn btn-default">Save</button>
220 <button type="button" class="btn btn-link cancel" data-dismiss="modal">Cancel</button>
226 [% MACRO jsinclude BLOCK %]
227 [% INCLUDE 'datatables.inc' %]
228 [% Asset.js("lib/hc-sticky.js") | $raw %]
229 [% Asset.js("lib/jquery/plugins/multiple-select/jquery.multiple.select.js") | $raw %]
230 [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
231 [% Asset.js( "lib/codemirror/css.min.js" ) | $raw %]
232 [% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %]
233 [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
234 [% Asset.js( "lib/codemirror/yaml.min.js" ) | $raw %]
235 [% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %]
236 [% Asset.js( "lib/linters/jshint.min.js" ) | $raw %]
237 [% Asset.js( "lib/linters/htmlhint.min.js" ) | $raw %]
238 [% Asset.js( "lib/linters/csslint.min.js" ) | $raw %]
239 [% Asset.js( "lib/linters/js-yaml.min.js" ) | $raw %]
240 [% Asset.js( "lib/codemirror/html-lint.min.js" ) | $raw %]
241 [% Asset.js( "lib/codemirror/javascript-lint.min.js" ) | $raw %]
242 [% Asset.js( "lib/codemirror/css-lint.min.js" ) | $raw %]
243 [% Asset.js( "lib/codemirror/yaml-lint.min.js" ) | $raw %]
247 var themelang = "[% themelang | html %]";
248 $(document).ready(function(){
249 [% UNLESS ( searchfield ) %]
250 Sticky = $("#toolbar");
253 stickyClass: "floating"
256 $("select[multiple='multiple']").multipleSelect( {
257 placeholder: _("Please select ..."),
258 selectAllText: _("Select all"),
259 allSelected: _("All selected"),
260 countSelected: _("# of % selected"),
261 noMatchesFound: _("No matches found")
263 $(".force_reload").on("click",function(e){
265 window.location.reload(true);
268 // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
269 var to_highlight = "[% To.json( searchfield ) | $raw %]";
270 var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
272 [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
273 [% Asset.js("js/ajax.js") | $raw %]
274 [% Asset.js("js/pages/preferences.js") | $raw %]
275 [%# Add WYSIWYG editor for htmlarea system preferences %]
276 [% INCLUDE 'wysiwyg-systempreferences.inc' %]
279 [% INCLUDE 'intranet-bottom.inc' %]