Bug 31410: Set focus for cursor to Server name when adding a new Z39.50/SRU server
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / preferences.tt
1 [% USE raw %]
2 [% USE To %]
3 [% USE Asset %]
4 [% USE Koha %]
5 [% USE HtmlId %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>System preferences &rsaquo; Administration &rsaquo; 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 %]
15 </head>
16 <body id="admin_preferences" class="admin">
17 [% WRAPPER 'header.inc' %]
18     [% INCLUDE 'prefs-admin-search.inc' %]
19 [% END %]
20
21 [% WRAPPER 'sub-header.inc' %]
22     [% WRAPPER breadcrumbs %]
23         [% WRAPPER breadcrumb_item %]
24             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
25         [% END %]
26         [% WRAPPER breadcrumb_item bc_active= 1 %]
27             <span>System preferences</span>
28         [% END %]
29     [% END #/ WRAPPER breadcrumbs %]
30 [% END #/ WRAPPER sub-header.inc %]
31
32 <div class="main container-fluid">
33     <div class="row">
34         <div class="col-sm-10 col-sm-push-2">
35             <main>
36
37     [% IF ( jump_not_found ) %]
38     <div class="dialog alert">
39         Could not find a system preference named <code>[% jumpfield | html %]</code>.
40     </div>
41     [% END %]
42     [% IF ( search_not_found ) %]
43     <div class="dialog alert">
44         No system preferences matched your search for: <strong>[% searchfield | html %]</strong>
45     </div>
46     <h1>System preferences</h1>
47     [% ELSIF searchfield %]
48     <h1>System preferences matching: [% searchfield | html %]</h1>
49     [% ELSE %]
50     <h1>System preferences</h1>
51     [% END %]
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 %]" />
59
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">
64             <div class="row">
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>
67                 </div>
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>
71                     [% END %]
72                 </div>
73             </div>
74
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 %]
78             [% ELSE %]
79             [% IF ( loop.first ) %]<table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody>[% END %]
80             <tr class="name-row">
81                 <td class="name-cell">
82                     <code>
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>
91                             [% ELSE %]
92                                 [% NAME.name | html %]
93                             [% END %]
94
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.">
97                                     [Overridden]
98                                 </span>
99                             [% END %]
100                                                 </label>
101                         [% UNLESS ( loop.last ) %]<br />[% END %]
102                         [% END %]
103                     </code>
104                 </td>
105                 <td><div>
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 %]
112                         [% ELSE %]
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 %]
114                         [% 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 %]">
118                         [% ELSE %]
119                         <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]">
120                         [% END %]
121                         [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
122                         [% IF ( CHOICE.selected ) %]
123                         <option value="[% CHOICE.value | html %]" selected="selected">
124                         [% ELSE %]
125                         <option value="[% CHOICE.value | html %]">
126                         [% END %]
127                             [% CHOICE.text | html %]
128                         </option>
129                         [% END %]
130                     </select>
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 %]
136                     </select>
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>
140                         [% ELSE %]
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>
144                         [% END %]
145                     [% ELSIF ( CHUNK.type_languages ) %]
146                         <ul class="sortable">
147                             [% FOREACH language IN CHUNK.languages %]
148                                 [% IF ( language.plural ) %]
149                                     <li>
150                                         [% IF ( language.native_description ) %]
151                                             [% language.native_description | html %]
152                                         [% ELSE %]
153                                             [% language.rfc4646_subtag | html %]
154                                         [% END %]
155                                         [% IF language.sublanguages_loop.size > 0 %]
156                                             <ul>
157                                                 [% FOREACH sublanguages_loo IN language.sublanguages_loop %]
158                                                     <li>
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"/>
162                                                         [% ELSE %]
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"/>
164                                                         [% END %]
165                                                     </li>
166                                                 [% END # FOREACH sublanguages %]
167                                             </ul>
168                                         [% END %]
169                                     </li>
170                                 [% ELSE %]
171                                     <li>
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"/>
175                                         [% ELSE %]
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"/>
177                                         [% END %]
178                                     </li>
179                                 [% END # IF language.plural %]
180                             [% END # FOREACH language %]
181                         </ul> <!-- / ul.sortable -->
182                     [% END %]
183                     [% END %]
184                     [% IF LINE.WARNINGS.size %]
185                         [% FOR w IN LINE.WARNINGS %]
186                             <div class="dialog alert">
187                                 [% SWITCH w %]
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>
190                                 [% END %]
191                             </div>
192                         [% END %]
193                     [% END %]
194                 </div></td>
195             </tr>
196             [% IF ( loop.last ) %]</tbody></table></div>[% END %]
197             [% END %]
198         [% 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>
200     </form>
201     </div>
202     [% END %]
203
204             </main>
205         </div> <!-- /.col-sm-10.col-sm-push-2 -->
206
207         <div class="col-sm-2 col-sm-pull-10">
208             <aside>
209                 [% INCLUDE 'prefs-menu.inc' %]
210             </aside>
211         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
212      </div> <!-- /.row -->
213
214 <!-- Modal -->
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">&times;</span></button>
220                 <h4 class="modal-title" id="prefModalLabel">Modal title</h4>
221             </div>
222             <div class="modal-body">
223                 <p>
224                     <a href="#" id="select_all"><i class="fa fa-check"></i> Select all</a>
225                     |
226                     <a href="#" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
227                 </p>
228                 <form action="#" id="prefModalForm">
229                 </form>
230             </div>
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>
234             </div>
235         </div>
236     </div>
237 </div>
238
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 %]
257
258     <script>
259         var Sticky;
260         var themelang = "[% themelang | html %]";
261         $(document).ready(function(){
262             [% UNLESS ( searchfield ) %]
263                 Sticky = $("#toolbar");
264                 Sticky.hcSticky({
265                     stickTo: "main",
266                     stickyClass: "floating"
267                 });
268             [% END %]
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")
275             } );
276             $(".force_reload").on("click",function(e){
277                 e.preventDefault();
278                 window.location.reload(true);
279             });
280         });
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 %];
285     </script>
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' %]
291 [% END %]
292
293 [% INCLUDE 'intranet-bottom.inc' %]