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