Bug 14576: Allow arbitrary automatic update of location on checkin
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / preferences.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Administration &rsaquo; System preferences</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% Asset.css("css/preferences.css") | $raw %]
9 [% Asset.css("lib/jquery/plugins/multiple-select/multiple-select.css") | $raw %]
10 [% Asset.css("css/humanmsg.css") | $raw %]
11 [% Asset.css("lib/codemirror/codemirror.css") | $raw %]
12 </head>
13 <body id="admin_preferences" class="admin">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'prefs-admin-search.inc' %]
16
17 <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>
18
19 <div class="main container-fluid">
20     <div class="row">
21         <div class="col-sm-10 col-sm-push-2">
22             <main>
23
24     [% IF ( jump_not_found ) %]
25     <h2>System preferences</h2>
26     <div class="dialog alert">
27         Could not find a system preference named <code>[% jumpfield | html %]</code>.
28     </div>
29     [% END %]
30     [% IF ( search_not_found ) %]
31     <div class="dialog alert">
32         No system preferences matched your search for: <strong>[% searchfield | html %]</strong>
33     </div>
34     [% ELSIF searchfield %]
35         <h1>You searched for: [% searchfield | html %]</h1>
36     [% END %]
37     [% FOREACH TAB IN TABS %]
38     <div class="prefs-tab">
39     <h2>[% TAB.tab_title | html %] preferences</h2>
40     <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
41         [% UNLESS ( searchfield ) %]<div id="toolbar"><button class="save-all submit" type="submit">Save all [% TAB.tab_title | html %] preferences</button></div>[% END %]
42         <input type="hidden" name="op" value="save" />
43         <input type="hidden" name="tab" value="[% TAB.tab_id | html %]" />
44
45             [% FOREACH LINE IN TAB.LINES %]
46             [% IF ( LINE.is_group_title ) %]
47             [% UNLESS ( loop.first ) %]</tbody></table>[% END %]
48             <h3>[% LINE.title | html %]</h3>
49             <table class="preferences">
50             <thead><tr><th>Preference</th><th>Value</th></tr></thead>
51             [% UNLESS ( loop.last ) %]<tbody>[% END %]
52             [% ELSE %]
53             [% IF ( loop.first ) %]<table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody>[% END %]
54             <tr class="name-row">
55                 <td class="name-cell">
56                     <code>
57                         [% FOREACH NAME IN LINE.NAMES %]
58                                                 <label for="pref_[% NAME.name | html %]">
59                                                         [% IF ( NAME.jumped ) %]
60                                                         <span class="term" id="jumped">[% NAME.name | html %]</span>
61                             [% ELSIF ( NAME.highlighted ) %]
62                                                         <span class="term">[% NAME.name | html %]</span>
63                                                         [% ELSE %]
64                                                         [% NAME.name | html %]
65                                                         [% END %]
66
67                             [% IF NAME.overridden %]
68                                 <span class="overridden" title="The system preference [% NAME.name | html %] may have been overridden from this value by one or more virtual hosts.">
69                                     [Overridden]
70                                 </span>
71                             [% END %]
72                                                 </label>
73                         [% UNLESS ( loop.last ) %]<br />[% END %]
74                         [% END %]
75                     </code>
76                 </td>
77                 <td><div>
78                     [% FOREACH CHUNK IN LINE.CHUNKS %]
79                     [% IF ( CHUNK.type_text ) %]
80                     [% CHUNK.contents | $raw %]
81                     [% ELSIF ( CHUNK.type_input ) %]
82                     <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 %]
83                     [% ELSIF ( CHUNK.type_select ) %]
84                     <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]">
85                         [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
86                         [% IF ( CHOICE.selected ) %]
87                         <option value="[% CHOICE.value | html %]" selected="selected">
88                         [% ELSE %]
89                         <option value="[% CHOICE.value | html %]">
90                         [% END %]
91                             [% CHOICE.text | html %]
92                         </option>
93                         [% END %]
94                     </select>
95                     [% ELSIF ( CHUNK.type_multiple ) %]
96                     <select name="pref_[% CHUNK.name | html %]" id="pref_[% CHUNK.name | html %]" class="preference preference-[% CHUNK.class or "choice" | html %]" multiple="multiple">
97                         [% 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 %]
98                     </select>
99                     [% ELSIF ( CHUNK.type_textarea )%]
100                         [% IF ( CHUNK.syntax == "text/html" && Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
101                             <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>
102                         [% ELSE %]
103                             <a class="expand-textarea" id="expand_[% CHUNK.name | html %]" data-target="[% CHUNK.name | html %]" data-syntax="[% CHUNK.syntax | html %]" href="#">Click to edit</a>
104                             <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>
105                             <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>
106                         [% END %]
107                     [% ELSIF ( CHUNK.type_languages ) %]
108                         <ul class="sortable">
109                             [% FOREACH language IN CHUNK.languages %]
110                                 [% IF ( language.plural ) %]
111                                     <li>
112                                         [% IF ( language.native_description ) %]
113                                             [% language.native_description | html %]
114                                         [% ELSE %]
115                                             [% language.rfc4646_subtag | html %]
116                                         [% END %]
117                                         [% IF language.sublanguages_loop.size > 0 %]
118                                             <ul>
119                                                 [% FOREACH sublanguages_loo IN language.sublanguages_loop %]
120                                                     <li>
121                                                         <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>
122                                                         [% IF ( sublanguages_loo.enabled ) %]
123                                                             <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"/>
124                                                         [% ELSE %]
125                                                             <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"/>
126                                                         [% END %]
127                                                     </li>
128                                                 [% END # FOREACH sublanguages %]
129                                             </ul>
130                                         [% END %]
131                                     </li>
132                                 [% ELSE %]
133                                     <li>
134                                         <label for="pref_[% CHUNK.name | html %]_[% language.rfc4646_subtag | html %]">[% language.native_description | html %] ([% language.rfc4646_subtag | html %])</label>
135                                         [% IF ( language.group_enabled ) %]
136                                             <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"/>
137                                         [% ELSE %]
138                                             <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"/>
139                                         [% END %]
140                                     </li>
141                                 [% END # IF language.plural %]
142                             [% END # FOREACH language %]
143                         </ul> <!-- / ul.sortable -->
144                     [% END %]
145                     [% END %]
146                 </div></td>
147             </tr>
148             [% IF ( loop.last ) %]</tbody></table>[% END %]
149             [% END %]
150         [% END %]
151         <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>
152     </form>
153     </div>
154     [% END %]
155
156             </main>
157         </div> <!-- /.col-sm-10.col-sm-push-2 -->
158
159         <div class="col-sm-2 col-sm-pull-10">
160             <aside>
161                 [% INCLUDE 'prefs-menu.inc' %]
162             </aside>
163         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
164      </div> <!-- /.row -->
165
166 [% MACRO jsinclude BLOCK %]
167     [% INCLUDE 'datatables.inc' %]
168     [% Asset.js("lib/hc-sticky.js") | $raw %]
169     [% Asset.js("lib/jquery/plugins/multiple-select/jquery.multiple.select.js") | $raw %]
170     [% Asset.js( "lib/codemirror/codemirror-compressed.js" ) | $raw %]
171     [% Asset.js( "lib/codemirror/css.min.js" ) | $raw %]
172     [% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %]
173     [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
174     [% Asset.js( "lib/codemirror/yaml.min.js" ) | $raw %]
175     <script>
176         var Sticky;
177         $(document).ready(function(){
178             [% UNLESS ( searchfield ) %]
179                 Sticky = $("#toolbar");
180                 Sticky.hcSticky({
181                     stickTo: "main",
182                     stickyClass: "floating"
183                 });
184             [% END %]
185             $("select[multiple='multiple']").multipleSelect( {
186                 placeholder: _("Please select ..."),
187                 selectAllText: _("Select all"),
188                 allSelected: _("All selected"),
189                 countSelected: _("# of % selected"),
190                 noMatchesFound: _("No matches found")
191             } );
192             $(".force_reload").on("click",function(e){
193                 e.preventDefault();
194                 window.location.reload(true);
195             });
196
197         });
198         // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
199         var to_highlight = "[% searchfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]";
200         var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
201         var MSG_NOTHING_TO_SAVE = _("Nothing to save");
202         var MSG_SAVING = _("Saving...");
203         var MSG_SAVED_PREFERENCE = _("Saved preference %s");
204         var MSG_MODIFIED = _("modified");
205         var MSG_MADE_CHANGES = _("You have made changes to system preferences.");
206         var MSG_CLICK_TO_EXPAND = _("Click to expand this section");
207         var MSG_CLICK_TO_COLLAPSE = _("Click to collapse this section");
208         var MSG_INTERNAL_SERVER_ERROR = _( "Internal Server Error, please reload the page" );
209         var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
210         var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
211         var MSG_LOADING = _( "Loading..." );
212         var MSG_ALL_VALUE_WARN = _("Note: _ALL_ value will override all other values");
213         var MSG_UPD_LOC_FORMAT_WARN = _("The following values are not formatted correctly:");
214     </script>
215     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
216     [% Asset.js("js/ajax.js") | $raw %]
217     [% Asset.js("js/pages/preferences.js") | $raw %]
218     [%# Add WYSIWYG editor for htmlarea system preferences %]
219     [% INCLUDE 'wysiwyg-systempreferences.inc' %]
220 [% END %]
221
222 [% INCLUDE 'intranet-bottom.inc' %]