ed2aa03547b47f351e8ae904e298c7711f34d731
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / preferences.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Administration &rsaquo; System preferences</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/preferences.css" />
8 [% IF ( bidi ) %]
9    <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
10 [% END %]
11 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
12 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/multiple-select/jquery.multiple.select.js"></script>
13 <link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/plugins/multiple-select/multiple-select.css" />
14 <script type="text/javascript">
15 //<![CDATA[
16     [% UNLESS ( searchfield ) %]$(document).ready(function(){
17             $('#toolbar').fixFloat();
18         });[% END %]
19
20     $(document).ready(function(){
21         $("select[multiple='multiple']").multipleSelect( {
22             placeholder: _("Please select ..."),
23             selectAllText: _("Select all"),
24             allSelected: _("All selected"),
25             countSelected: _("# of % selected"),
26             noMatchesFound: _("No matches found")
27         } );
28         $(".force_reload").on("click",function(e){
29             e.preventDefault();
30             window.location.reload(true);
31         });
32     });
33     // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
34     var to_highlight = "[% searchfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
35     var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
36     var MSG_NOTHING_TO_SAVE = _("Nothing to save");
37     var MSG_SAVING = _("Saving...");
38     var MSG_SAVED_PREFERENCE = _("Saved preference %s");
39     var MSG_MODIFIED = _("modified");
40     var MSG_MADE_CHANGES = _("You have made changes to system preferences.");
41     var MSG_CLICK_TO_EXPAND = _("Click to expand this section");
42     var MSG_CLICK_TO_COLLAPSE = _("Click to collapse this section");
43     var MSG_INTERNAL_SERVER_ERROR = _( "Internal Server Error, please reload the page" );
44     var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
45     var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
46     var MSG_LOADING = _( "Loading..." );
47
48 //]]>
49 </script>
50 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/humanmsg.css" />
51 <script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
52 <script src="[% interface %]/[% theme %]/js/ajax.js" type="text/javascript"></script>
53 <script src="[% interface %]/[% theme %]/js/pages/preferences.js" type="text/javascript"></script>
54 [%# Add WYSIWYG editor for htmlarea system preferences %]
55 [% INCLUDE 'wysiwyg-systempreferences.inc' %]
56 </head>
57 <body id="admin_preferences" class="admin">
58 [% INCLUDE 'header.inc' %]
59 [% INCLUDE 'prefs-admin-search.inc' %]
60
61 <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>
62
63 <div id="doc3" class="yui-t2">
64
65    <div id="bd">
66     <div id="yui-main">
67             <div class="yui-b">
68
69     [% IF ( jump_not_found ) %]
70     <h2>System preferences</h2>
71     <div class="dialog alert">
72         Could not find a system preference named <code>[% jumpfield %]</code>.
73     </div>
74     [% END %]
75     [% IF ( search_not_found ) %]
76     <div class="dialog alert">
77         No system preferences matched your search for: <strong>[% searchfield |html %]</strong>
78     </div>
79     [% END %]
80     [% FOREACH TAB IN TABS %]
81     <div class="prefs-tab">
82     <h2>[% TAB.tab_title %] preferences</h2>
83     <form action="/cgi-bin/koha/admin/preferences.pl" method="post">
84         [% UNLESS ( searchfield ) %]<div id="toolbar"><button class="save-all submit" type="submit">Save all [% TAB.tab_title %] preferences</button></div>[% END %]
85         <input type="hidden" name="op" value="save" />
86         <input type="hidden" name="tab" value="[% TAB.tab_id %]" />
87
88             [% FOREACH LINE IN TAB.LINES %]
89             [% IF ( LINE.is_group_title ) %]
90             [% UNLESS ( loop.first ) %]</tbody></table>[% END %]
91             <h3>[% LINE.title %]</h3>
92             <table class="preferences">
93             <thead><tr><th>Preference</th><th>Value</th></tr></thead>
94             [% UNLESS ( loop.last ) %]<tbody>[% END %]
95             [% ELSE %]
96             [% IF ( loop.first ) %]<table class="preferences"><thead><tr><th>Preference</th><th>Value</th></tr></thead><tbody>[% END %]
97             <tr class="name-row">
98                 <td class="name-cell">
99                     <code>
100                         [% FOREACH NAME IN LINE.NAMES %]
101                                                 <label for="pref_[% NAME.name %]">
102                                                         [% IF ( NAME.jumped ) %]
103                                                         <span class="term" id="jumped">[% NAME.name %]</span>
104                             [% ELSIF ( NAME.highlighted ) %]
105                                                         <span class="term">[% NAME.name %]</span>
106                                                         [% ELSE %]
107                                                         [% NAME.name %]
108                                                         [% END %]
109
110                             [% IF NAME.overridden %]
111                                 <span class="overridden" title="The system preference [% NAME.name %] may have been overridden from this value by one or more virtual hosts.">
112                                     [Overridden]
113                                 </span>
114                             [% END %]
115                                                 </label>
116                         [% UNLESS ( loop.last ) %]<br />[% END %]
117                         [% END %]
118                     </code>
119                 </td>
120                 <td><div>
121                     [% FOREACH CHUNK IN LINE.CHUNKS %]
122                     [% IF ( CHUNK.type_text ) %]
123                     [% CHUNK.contents %]
124                     [% ELSIF ( CHUNK.type_input ) %]
125                     <input type="[%IF CHUNK.input_type %][% CHUNK.input_type %][% ELSE %]text[% END %]" name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" value="[% CHUNK.value| html %]" autocomplete="off" /> [% IF ( CHUNK.dateinput ) %]<span class="hint">[% INCLUDE 'date-format.inc' %]</span>[% END %]
126                     [% ELSIF ( CHUNK.type_select ) %]
127                     <select name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "choice" %]">
128                         [% FOREACH CHOICE IN CHUNK.CHOICES.sort('value') %]
129                         [% IF ( CHOICE.selected ) %]
130                         <option value="[% CHOICE.value %]" selected="selected">
131                         [% ELSE %]
132                         <option value="[% CHOICE.value %]">
133                         [% END %]
134                             [% CHOICE.text %]
135                         </option>
136                         [% END %]
137                     </select>
138                     [% ELSIF ( CHUNK.type_multiple ) %]
139                     <select name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "choice" %]" multiple="multiple">
140                         [% FOREACH CHOICE IN CHUNK.CHOICES %][% IF ( CHOICE.selected ) %]<option value="[% CHOICE.value %]" selected="selected">[% ELSE %]<option value="[% CHOICE.value %]">[% END %][% CHOICE.text %]</option>[% END %]
141                     </select>
142                     [% ELSIF ( CHUNK.type_textarea ) || ( CHUNK.type_htmlarea )%]
143                         [% IF ( CHUNK.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %]
144                         <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %] mce" rows="20" cols="60">[% CHUNK.value %]</textarea>
145                         [% ELSE %]
146                         <a class="expand-textarea" style="display: none" href="#">Click to Edit</a>
147                         <textarea name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]" class="preference preference-[% CHUNK.class or "short" %]" rows="10" cols="40">[% CHUNK.value %]</textarea>
148                         <a class="collapse-textarea" style="display:none" href="#">Click to collapse</br></a>
149                         [% END %]
150                     [% ELSIF ( CHUNK.type_languages ) %]
151                     <dl>
152                     [% FOREACH language IN CHUNK.languages %]
153                         [% IF ( language.plural ) %]
154                         <dt>
155                             [% IF ( language.native_description ) %][% language.native_description %][% ELSE %][% language.rfc4646_subtag %][% END %]
156                         </dt>
157                         [% FOREACH sublanguages_loo IN language.sublanguages_loop %]
158                         <dd>
159                             <label for="pref_[% CHUNK.name %]_[% sublanguages_loo.rfc4646_subtag %]">[% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %]([% sublanguages_loo.rfc4646_subtag %])</label>
160                             [% IF ( sublanguages_loo.enabled ) %]
161                             <input value="[% sublanguages_loo.rfc4646_subtag %]" name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]_[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" checked="checked" class="preference preference-checkbox"/>
162                             [% ELSE %]
163                             <input value="[% sublanguages_loo.rfc4646_subtag %]" name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]_[% sublanguages_loo.rfc4646_subtag %]" type="checkbox" class="preference preference-checkbox"/>
164                             [% END %]
165                         </dd>
166                         [% END %]
167                         [% ELSE %]
168                         <dt>
169                             <label for="pref_[% CHUNK.name %]_[% language.rfc4646_subtag %]">[% language.native_description %]([% language.rfc4646_subtag %])</label>
170                             [% IF ( language.group_enabled ) %]
171                             <input value="[% language.rfc4646_subtag %]" name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]_[% language.rfc4646_subtag %]" type="checkbox" checked="checked" class="preference preference-checkbox"/>
172                             [% ELSE %]
173                             <input value="[% language.rfc4646_subtag %]" name="pref_[% CHUNK.name %]" id="pref_[% CHUNK.name %]_[% language.rfc4646_subtag %]" type="checkbox" class="preference preference-checkbox"/>
174                             [% END %]
175                         </dt>
176                         [% END %]
177                     [% END %]
178                     </dl>
179                     [% END %]
180                     [% END %]
181                 </div></td>
182             </tr>
183             [% IF ( loop.last ) %]</tbody></table>[% END %]
184             [% END %]
185         [% END %]
186         <fieldset class="action"><button class="save-all submit" type="submit">Save all [% TAB.tab_title %] preferences</button> <a href="/cgi-bin/koha/admin/preferences.pl" class="force_reload cancel">Cancel</a></fieldset>
187     </form>
188     </div>
189     [% END %]
190 </div>
191 </div>
192 <div class="yui-b">
193 [% INCLUDE 'prefs-menu.inc' %]
194 </div>
195 </div>
196 [% INCLUDE 'intranet-bottom.inc' %]