Bug 31378: Add domain settings to IdP add page
[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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
23     <ol>
24         <li>
25             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
26         </li>
27         <li>
28             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
29         </li>
30         <li>
31             <a href="#" aria-current="page">
32                 System preferences
33             </a>
34         </li>
35     </ol>
36 </nav>
37 [% END %]
38
39 <div class="main container-fluid">
40     <div class="row">
41         <div class="col-sm-10 col-sm-push-2">
42             <main>
43
44     [% IF ( jump_not_found ) %]
45     <div class="dialog alert">
46         Could not find a system preference named <code>[% jumpfield | html %]</code>.
47     </div>
48     [% END %]
49     [% IF ( search_not_found ) %]
50     <div class="dialog alert">
51         No system preferences matched your search for: <strong>[% searchfield | html %]</strong>
52     </div>
53     <h1>System preferences</h1>
54     [% ELSIF searchfield %]
55     <h1>System preferences matching: [% searchfield | html %]</h1>
56     [% ELSE %]
57     <h1>System preferences</h1>
58     [% END %]
59     [% FOREACH TAB IN TABS %]
60     <div class="prefs-tab">
61     <h2>[% TAB.tab_title | html %] preferences</h2>
62     <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
63         [% UNLESS ( searchfield ) %]<div id="toolbar"><button class="save-all btn btn-primary" type="submit">Save all [% TAB.tab_title | html %] preferences</button></div>[% END %]
64         <input type="hidden" name="op" value="save" />
65         <input type="hidden" name="tab" value="[% TAB.tab_id | html %]" />
66
67             [% FOREACH LINE IN TAB.LINES %]
68             [% IF ( LINE.is_group_title ) %]
69             [% UNLESS ( loop.first ) %]</tbody></table></div>[% END %]
70             <div class="page-section">
71             <div class="row">
72                 <div class="col-sm-6">
73                     <h3 id="[% LINE.title | $HtmlId %]"><i class="fa fa-caret-down"></i> [% LINE.title | html %]</h3>
74                 </div>
75                 <div class="col-sm-6">
76                     [% IF ( searchfield ) %]
77                         <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>
78                     [% END %]
79                 </div>
80             </div>
81
82             <table class="preferences" id="collapse_[% LINE.title | $HtmlId %]">
83             <thead><tr><th>Preference</th><th>Value</th></tr></thead>
84             [% UNLESS ( loop.last ) %]<tbody>[% END %]
85             [% ELSE %]
86             [% IF ( loop.first ) %]<table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody>[% END %]
87             <tr class="name-row">
88                 <td class="name-cell">
89                     <code>
90                         [% FOREACH NAME IN LINE.NAMES %]
91                         <label for="pref_[% NAME.name | html %]" class="nowrap">
92                             <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=[% NAME.name | uri %]">
93                                 <i class="fa fa-bookmark" aria-hidden="true"></i></a>
94                             [% IF ( NAME.jumped ) %]
95                                 <span class="term" id="jumped">[% NAME.name | html %]</span>
96                             [% ELSIF ( NAME.highlighted ) %]
97                                 <span class="term">[% NAME.name | html %]</span>
98                             [% ELSE %]
99                                 [% NAME.name | html %]
100                             [% END %]
101
102                             [% IF NAME.overridden %]
103                                 <span class="overridden" title="The system preference [% NAME.name | html %] may have been overridden from this value by one or more virtual hosts.">
104                                     [Overridden]
105                                 </span>
106                             [% END %]
107                                                 </label>
108                         [% UNLESS ( loop.last ) %]<br />[% END %]
109                         [% END %]
110                     </code>
111                 </td>
112                 <td><div>
113                     [% FOREACH CHUNK IN LINE.CHUNKS %]
114                     [% IF ( CHUNK.type_text ) %]
115                     [% CHUNK.contents | $raw %]
116                     [% ELSIF ( CHUNK.type_input ) %]
117                         [% IF CHUNK.name == 'UsageStatsGeolocation' %]
118                             <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 %]
119                         [% ELSE %]
120                             <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 %]
121                         [% END %]
122                     [% ELSIF ( CHUNK.type_select ) %]
123                         [% IF CHUNK.disabled %]
124                         <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" disabled="disabled" class="preference preference-[% CHUNK.class or "choice" | html %]">
125                         [% ELSE %]
126                         <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]">
127                         [% END %]
128                         [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
129                         [% IF ( CHOICE.selected ) %]
130                         <option value="[% CHOICE.value | html %]" selected="selected">
131                         [% ELSE %]
132                         <option value="[% CHOICE.value | html %]">
133                         [% END %]
134                             [% CHOICE.text | html %]
135                         </option>
136                         [% END %]
137                     </select>
138                     [% ELSIF ( CHUNK.type_modalselect ) %]
139                         <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 %]"/>
140                     [% ELSIF ( CHUNK.type_multiple ) %]
141                     <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
142                         [% 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 %]
143                     </select>
144                     [% ELSIF ( CHUNK.type_textarea )%]
145                         [% IF ( CHUNK.syntax == "text/html" && Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
146                             <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>
147                         [% ELSE %]
148                             <a class="expand-textarea" id="expand_[% CHUNK.name | html %]" data-target="[% CHUNK.name | html %]" data-syntax="[% CHUNK.syntax | html %]" href="#">Click to edit</a>
149                             <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>
150                             <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>
151                         [% END %]
152                     [% ELSIF ( CHUNK.type_languages ) %]
153                         <ul class="sortable">
154                             [% FOREACH language IN CHUNK.languages %]
155                                 [% IF ( language.plural ) %]
156                                     <li>
157                                         [% IF ( language.native_description ) %]
158                                             [% language.native_description | html %]
159                                         [% ELSE %]
160                                             [% language.rfc4646_subtag | html %]
161                                         [% END %]
162                                         [% IF language.sublanguages_loop.size > 0 %]
163                                             <ul>
164                                                 [% FOREACH sublanguages_loo IN language.sublanguages_loop %]
165                                                     <li>
166                                                         <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>
167                                                         [% IF ( sublanguages_loo.enabled ) %]
168                                                             <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"/>
169                                                         [% ELSE %]
170                                                             <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"/>
171                                                         [% END %]
172                                                     </li>
173                                                 [% END # FOREACH sublanguages %]
174                                             </ul>
175                                         [% END %]
176                                     </li>
177                                 [% ELSE %]
178                                     <li>
179                                         <label for="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</label>
180                                         [% IF ( language.group_enabled ) %]
181                                             <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"/>
182                                         [% ELSE %]
183                                             <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"/>
184                                         [% END %]
185                                     </li>
186                                 [% END # IF language.plural %]
187                             [% END # FOREACH language %]
188                         </ul> <!-- / ul.sortable -->
189                     [% END %]
190                     [% END %]
191                     [% IF LINE.WARNINGS.size %]
192                         [% FOR w IN LINE.WARNINGS %]
193                             <div class="dialog alert">
194                                 [% SWITCH w %]
195                                 [% 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>
196                                 [% CASE %]<span>Unknown warning "[% w | html %]"</span>
197                                 [% END %]
198                             </div>
199                         [% END %]
200                     [% END %]
201                 </div></td>
202             </tr>
203             [% IF ( loop.last ) %]</tbody></table></div>[% END %]
204             [% END %]
205         [% END %]
206         <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>
207     </form>
208     </div>
209     [% END %]
210
211             </main>
212         </div> <!-- /.col-sm-10.col-sm-push-2 -->
213
214         <div class="col-sm-2 col-sm-pull-10">
215             <aside>
216                 [% INCLUDE 'prefs-menu.inc' %]
217             </aside>
218         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
219      </div> <!-- /.row -->
220
221 <!-- Modal -->
222 <div class="modal" id="prefModal" tabindex="-1" role="dialog" aria-labelledby="prefModalLabel">
223     <div class="modal-dialog modal-wide" role="document">
224         <div class="modal-content">
225             <div class="modal-header">
226                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
227                 <h4 class="modal-title" id="prefModalLabel">Modal title</h4>
228             </div>
229             <div class="modal-body">
230                 <p>
231                     <a href="#" id="select_all"><i class="fa fa-check"></i> Select all</a>
232                     |
233                     <a href="#" id="clear_all"><i class="fa fa-remove"></i> Clear all</a>
234                 </p>
235                 <form action="#" id="prefModalForm">
236                 </form>
237             </div>
238             <div class="modal-footer">
239                 <button id="saveModalPrefs" data-target="" type="button" class="btn btn-primary">Save</button>
240                 <button type="button" class="btn btn-link cancel" data-dismiss="modal">Cancel</button>
241             </div>
242         </div>
243     </div>
244 </div>
245
246 [% MACRO jsinclude BLOCK %]
247     [% INCLUDE 'datatables.inc' %]
248     [% Asset.js("lib/hc-sticky.js") | $raw %]
249     [% Asset.js("lib/jquery/plugins/multiple-select/jquery.multiple.select.js") | $raw %]
250     [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
251     [% Asset.js( "lib/codemirror/css.min.js" ) | $raw %]
252     [% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %]
253     [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
254     [% Asset.js( "lib/codemirror/yaml.min.js" ) | $raw %]
255     [% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %]
256     [% Asset.js( "lib/linters/jshint.min.js" ) | $raw %]
257     [% Asset.js( "lib/linters/htmlhint.min.js" ) | $raw %]
258     [% Asset.js( "lib/linters/csslint.min.js" ) | $raw %]
259     [% Asset.js( "lib/linters/js-yaml.min.js" ) | $raw %]
260     [% Asset.js( "lib/codemirror/html-lint.min.js" ) | $raw %]
261     [% Asset.js( "lib/codemirror/javascript-lint.min.js" ) | $raw %]
262     [% Asset.js( "lib/codemirror/css-lint.min.js" ) | $raw %]
263     [% Asset.js( "lib/codemirror/yaml-lint.min.js" ) | $raw %]
264
265     <script>
266         var Sticky;
267         var themelang = "[% themelang | html %]";
268         $(document).ready(function(){
269             [% UNLESS ( searchfield ) %]
270                 Sticky = $("#toolbar");
271                 Sticky.hcSticky({
272                     stickTo: "main",
273                     stickyClass: "floating"
274                 });
275             [% END %]
276             $("select[multiple='multiple']").multipleSelect( {
277                 placeholder: _("Please select ..."),
278                 selectAllText: _("Select all"),
279                 allSelected: _("All selected"),
280                 countSelected: _("# of % selected"),
281                 noMatchesFound: _("No matches found")
282             } );
283             $(".force_reload").on("click",function(e){
284                 e.preventDefault();
285                 window.location.reload(true);
286             });
287         });
288         // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
289         var to_highlight = "[% To.json( searchfield ) | html %]";
290         var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
291         var db_columns = [% To.json( db_columns ) | $raw %];
292     </script>
293     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
294     [% Asset.js("js/ajax.js") | $raw %]
295     [% Asset.js("js/pages/preferences.js") | $raw %]
296     [%# Add WYSIWYG editor for htmlarea system preferences %]
297     [% INCLUDE 'wysiwyg-systempreferences.inc' %]
298 [% END %]
299
300 [% INCLUDE 'intranet-bottom.inc' %]