Improved presentation of language selector.
[timetracker.git] / WEB-INF / templates / profile_edit.tpl
1 <script>
2 // handleTaskRequiredCheckbox - controls visibility of the Task Required checkbox.
3 function handleTaskRequiredCheckbox() {
4   var taskRequiredCheckbox = document.getElementById("task_required");
5   var taskRequiredLabel = document.getElementById("task_required_label");
6   var trackingModeDropdown = document.getElementById("tracking_mode");
7   if (trackingModeDropdown.value == 2) {
8     taskRequiredCheckbox.style.visibility = "visible";
9     taskRequiredLabel.style.visibility = "visible";
10   } else {
11     taskRequiredCheckbox.style.visibility = "hidden";
12     taskRequiredLabel.style.visibility = "hidden";
13   }
14 }
15
16
17 // handleControls - controls visibility of controls.
18 function handlePluginCheckboxes() {
19   var clientsCheckbox = document.getElementById("clients");
20   var invoicesCheckbox = document.getElementById("invoices");
21   var requiredCheckbox = document.getElementById("client_required");
22   var requiredLabel = document.getElementById("client_required_label");
23   if (clientsCheckbox.checked) {
24     requiredCheckbox.style.visibility = "visible";
25     requiredLabel.style.visibility = "visible";
26     invoicesCheckbox.disabled = false;
27   } else {
28     requiredCheckbox.checked = false;
29     requiredCheckbox.style.visibility = "hidden";
30     requiredLabel.style.visibility = "hidden";
31     invoicesCheckbox.checked = false;
32     invoicesCheckbox.disabled = true;
33   }
34
35   var expensesCheckbox = document.getElementById("expenses");
36   var taxCheckbox = document.getElementById("tax_expenses");
37   var taxLabel = document.getElementById("tax_label");
38   if (expensesCheckbox.checked) {
39     taxCheckbox.style.visibility = "visible";
40     taxLabel.style.visibility = "visible";
41   } else {
42     taxCheckbox.checked = false;
43     taxCheckbox.style.visibility = "hidden";
44     taxLabel.style.visibility = "hidden";
45   }
46   var configureLabel = document.getElementById("expenses_config");
47   if (expensesCheckbox.checked) {
48     configureLabel.style.visibility = "visible";
49   } else {
50     configureLabel.style.visibility = "hidden";
51   }
52
53   var customFieldsCheckbox = document.getElementById("custom_fields");
54   configureLabel = document.getElementById("cf_config");
55   if (customFieldsCheckbox.checked) {
56     configureLabel.style.visibility = "visible";
57   } else {
58     configureLabel.style.visibility = "hidden";
59   }
60
61   var notificationsCheckbox = document.getElementById("notifications");
62   configureLabel = document.getElementById("notifications_config");
63   if (notificationsCheckbox.checked) {
64     configureLabel.style.visibility = "visible";
65   } else {
66     configureLabel.style.visibility = "hidden";
67   }
68
69   var lockingCheckbox = document.getElementById("locking");
70   configureLabel = document.getElementById("locking_config");
71   if (lockingCheckbox.checked) {
72     configureLabel.style.visibility = "visible";
73   } else {
74     configureLabel.style.visibility = "hidden";
75   }
76   
77   var quotasCheckbox = document.getElementById("quotas");
78   configureLabel = document.getElementById("quotas_config");
79   if (quotasCheckbox.checked){
80     configureLabel.style.visibility = "visible";
81   } else {
82     configureLabel.style.visibility = "hidden";
83   }
84
85   var weekViewCheckbox = document.getElementById("week_view");
86   configureLabel = document.getElementById("week_view_config");
87   if (weekViewCheckbox.checked){
88     configureLabel.style.visibility = "visible";
89   } else {
90     configureLabel.style.visibility = "hidden";
91   }
92 }
93 </script>
94
95 {$forms.profileForm.open}
96
97 {if $user->canManageTeam()}
98 {include file="datetime_format_preview.tpl"}
99 {/if}
100
101 <table cellspacing="4" cellpadding="7" border="0">
102     <tr>
103       <td>
104         <table cellspacing="1" cellpadding="2" border="0">
105           <tr>
106             <td align="right" nowrap>{$i18n.label.person_name} (*):</td>
107             <td>{$forms.profileForm.name.control}</td>
108           </tr>
109           <tr>
110             <td align="right" nowrap>{$i18n.label.login} (*):</td>
111             <td>{$forms.profileForm.login.control}</td>
112           </tr>
113 {if !$auth_external}
114           <tr>
115             <td align="right" nowrap>{$i18n.label.password} (*):</td>
116             <td>{$forms.profileForm.password1.control}</td>
117           </tr>
118           <tr>
119             <td align="right" nowrap>{$i18n.label.confirm_password} (*):</td>
120             <td>{$forms.profileForm.password2.control}</td>
121           </tr>
122 {/if}
123           <tr>
124             <td align="right" nowrap>{$i18n.label.email}:</td>
125             <td>{$forms.profileForm.email.control}</td>
126           </tr>
127           <tr>
128             <td></td>
129             <td>{$i18n.label.required_fields}</td>
130           </tr>
131
132 {if $user->isManager() || ($user->canManageTeam() && !defined(MANAGER_ONLY_TEAM_SETTINGS))}
133           <tr>
134             <td colspan="2">&nbsp;</td>
135           </tr>
136           <tr>
137             <td align="right" nowrap>{$i18n.label.team_name}:</td>
138             <td>{$forms.profileForm.team_name.control}</td>
139           </tr>
140           <tr>
141             <td align="right">{$i18n.label.currency}:</td>
142             <td>{$forms.profileForm.currency.control}</td>
143           </tr>
144   {if defined(DEBUG_ROLES)}
145           <tr>
146             <td align="right" nowrap>{$i18n.label.roles}:</td>
147             <td><a href="roles.php">{$i18n.label.configure}</a></td>
148           </tr>
149   {/if}
150           <tr>
151            <td align="right" nowrap>{$i18n.label.language}:</td>
152            <td>{$forms.profileForm.lang.control}</td>
153           </tr>
154           <tr>
155             <td align="right">{$i18n.label.decimal_mark}:</td>
156             <td>{$forms.profileForm.decimal_mark.control} <font id="decimal_preview" color="#777777">&nbsp;</font></td>
157           <tr>
158             <td align="right" nowrap>{$i18n.label.date_format}:</td>
159             <td>{$forms.profileForm.date_format.control} <font id="date_format_preview" color="#777777">&nbsp;</font></td>
160           </tr>
161           <tr>
162             <td align="right" nowrap>{$i18n.label.time_format}:</td>
163             <td>{$forms.profileForm.time_format.control} <font id="time_format_preview" color="#777777">&nbsp;</font></td>
164           </tr>
165           <tr>
166             <td align="right" nowrap>{$i18n.label.week_start}:</td>
167             <td>{$forms.profileForm.start_week.control}</td>
168           </tr>
169           <tr>
170             <td align="right" nowrap>{$i18n.form.profile.show_holidays}:</td>
171             <td>{$forms.profileForm.show_holidays.control} <a href="https://www.anuko.com/lp/tt_14.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
172           </tr>
173           <tr>
174             <td align="right" nowrap>{$i18n.form.profile.tracking_mode}:</td>
175             <td>{$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control} <span id="task_required_label"><label for="task_required">{$i18n.label.required}</label></span></td>
176           </tr>
177           <tr>
178             <td align="right" nowrap>{$i18n.form.profile.record_type}:</td>
179             <td>{$forms.profileForm.record_type.control}</td>
180           </tr>
181           <tr>
182             <td align="right" nowrap>{$i18n.form.profile.punch_mode}:</td>
183             <td>{$forms.profileForm.punch_mode.control} <a href="https://www.anuko.com/lp/tt_18.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
184           </tr>
185           <tr>
186             <td align="right" nowrap>{$i18n.form.profile.allow_overlap}:</td>
187             <td>{$forms.profileForm.allow_overlap.control} <a href="https://www.anuko.com/lp/tt_16.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
188           </tr>
189           <tr>
190             <td align="right" nowrap>{$i18n.form.profile.future_entries}:</td>
191             <td>{$forms.profileForm.future_entries.control} <a href="https://www.anuko.com/lp/tt_17.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
192           </tr>
193           <tr>
194             <td align="right" nowrap>{$i18n.form.profile.uncompleted_indicators}:</td>
195             <td>{$forms.profileForm.uncompleted_indicators.control} <a href="https://www.anuko.com/lp/tt_15.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
196           </tr>
197 {if $user->isManager()}
198           <tr>
199             <td align="right" nowrap>{$i18n.label.bcc}:</td>
200             <td>{$forms.profileForm.bcc_email.control} <a href="https://www.anuko.com/lp/tt_10.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
201           </tr>
202 {/if}
203           {* initialize preview text *}
204           <script>
205             MakeFormatPreview("date_format_preview", document.getElementById("date_format"));
206             MakeFormatPreview("time_format_preview", document.getElementById("time_format"));
207
208             function adjustDecimalPreview()
209             {
210               var mark = document.getElementById("decimal_mark").value;
211               var example = document.getElementById("decimal_preview");
212               example.innerHTML = "<i>3"+mark+"14</i>";
213             }
214             adjustDecimalPreview();
215           </script>
216
217           <tr>
218             <td>&nbsp;</td>
219             <td>&nbsp;</td>
220           </tr>
221
222           <tr>
223              <td colspan="2" class="sectionHeader">{$i18n.form.profile.plugins}</td>
224           </tr>
225           <tr><td>&nbsp;</td></tr>
226           <tr>
227             <td align="right" nowrap>{$forms.profileForm.charts.control}</td>
228             <td><label for="charts">{$i18n.title.charts}</label></td>
229           </tr>
230           <tr>
231             <td align="right" nowrap>{$forms.profileForm.clients.control}</td>
232             <td><label for="clients">{$i18n.title.clients}</label> {$forms.profileForm.client_required.control} <span id="client_required_label"><label for="client_required">{$i18n.label.required}</label></span></td>
233           </tr>
234           <tr>
235             <td align="right" nowrap>{$forms.profileForm.invoices.control}</td>
236             <td><label for="invoices">{$i18n.title.invoices}</label></td>
237           </tr>
238           <tr>
239             <td align="right" nowrap>{$forms.profileForm.paid_status.control}</td>
240             <td><label for="paid_status">{$i18n.label.paid_status}</label></td>
241           </tr>
242           <tr>
243             <td align="right" nowrap>{$forms.profileForm.custom_fields.control}</td>
244             <td><label for="custom_fields">{$i18n.label.custom_fields}</label> <span id="cf_config"><a href="cf_custom_fields.php">{$i18n.label.configure}</a></span></td>
245           </tr>
246           <tr>
247             <td align="right" nowrap>{$forms.profileForm.expenses.control}</td>
248             <td><label for="expenses">{$i18n.title.expenses}</label> {$forms.profileForm.tax_expenses.control} <span id="tax_label"><label for="tax_expenses">{$i18n.label.tax}</label></span> <span id="expenses_config"><a href="predefined_expenses.php">{$i18n.label.configure}</a></span></td>
249           </tr>
250           <tr>
251             <td align="right" nowrap>{$forms.profileForm.notifications.control}</td>
252             <td><label for="notifications">{$i18n.title.notifications}</label> <span id="notifications_config"><a href="notifications.php">{$i18n.label.configure}</a></span></td>
253           </tr>
254           <tr>
255             <td align="right" nowrap>{$forms.profileForm.locking.control}</td>
256             <td><label for="locking">{$i18n.title.locking}</label> <span id="locking_config"><a href="locking.php">{$i18n.label.configure}</a></span></td>
257           </tr>
258           <tr>
259             <td align="right" nowrap>{$forms.profileForm.quotas.control}</td>
260             <td><label for="quotas">{$i18n.label.monthly_quotas}</label> <span id="quotas_config"><a href="quotas.php">{$i18n.label.configure}</a></span></td>
261           </tr>
262           <tr>
263             <td align="right" nowrap>{$forms.profileForm.week_view.control}</td>
264             <td><label for="week_view">{$i18n.label.week_view}</label> <span id="week_view_config"><a href="week_view.php">{$i18n.label.configure}</a></span></td>
265           </tr>
266 {/if}
267
268           <tr>
269             <td colspan="2">&nbsp;</td>
270           </tr>
271           <tr>
272             <td colspan="2" height="50" align="center">{$forms.profileForm.btn_save.control}</td>
273           </tr>
274         </table>
275       </td>
276     </tr>
277 </table>
278 {$forms.profileForm.close}