Refactored profile_edit.tpl a bit.
[timetracker.git] / WEB-INF / templates / profile_edit.tpl
1 <script>
2 // handleControls - controls visibility of controls.
3 function handlePluginCheckboxes() {
4   var clientsCheckbox = document.getElementById("clients");
5   var invoicesCheckbox = document.getElementById("invoices");
6   var requiredCheckbox = document.getElementById("client_required");
7   var requiredLabel = document.getElementById("required_label");
8   if (clientsCheckbox.checked) {
9     requiredCheckbox.style.visibility = "visible";
10     requiredLabel.style.visibility = "visible";
11     invoicesCheckbox.disabled = false;
12   } else {
13     requiredCheckbox.checked = false;
14     requiredCheckbox.style.visibility = "hidden";
15     requiredLabel.style.visibility = "hidden";
16     invoicesCheckbox.checked = false;
17     invoicesCheckbox.disabled = true;
18   }
19
20   var expensesCheckbox = document.getElementById("expenses");
21   var taxCheckbox = document.getElementById("tax_expenses");
22   var taxLabel = document.getElementById("tax_label");
23   if (expensesCheckbox.checked) {
24     taxCheckbox.style.visibility = "visible";
25     taxLabel.style.visibility = "visible";
26   } else {
27     taxCheckbox.checked = false;
28     taxCheckbox.style.visibility = "hidden";
29     taxLabel.style.visibility = "hidden";
30   }
31
32   var customFieldsCheckbox = document.getElementById("custom_fields");
33   var configureLabel = document.getElementById("cf_config");
34   if (customFieldsCheckbox.checked) {
35     configureLabel.style.visibility = "visible";
36   } else {
37     configureLabel.style.visibility = "hidden";
38   }
39
40   var notificationsCheckbox = document.getElementById("notifications");
41   configureLabel = document.getElementById("notifications_config");
42   if (notificationsCheckbox.checked) {
43     configureLabel.style.visibility = "visible";
44   } else {
45     configureLabel.style.visibility = "hidden";
46   }
47
48   var lockingCheckbox = document.getElementById("locking");
49   configureLabel = document.getElementById("locking_config");
50   if (lockingCheckbox.checked) {
51     configureLabel.style.visibility = "visible";
52   } else {
53     configureLabel.style.visibility = "hidden";
54   }
55   
56   var quotasCheckbox = document.getElementById("quotas");
57   configureLabel = document.getElementById("quotas_config");
58   if (quotasCheckbox.checked){
59     configureLabel.style.visibility = "visible";
60   } else {
61     configureLabel.style.visibility = "hidden";
62   }
63 }
64 </script>
65
66 {$forms.profileForm.open}
67
68 {if $user->canManageTeam()}
69 {include file="datetime_format_preview.tpl"}
70 {/if}
71
72 <table cellspacing="4" cellpadding="7" border="0">
73     <tr>
74       <td>
75         <table cellspacing="1" cellpadding="2" border="0">
76           <tr>
77             <td align="right" nowrap>{$i18n.label.person_name} (*):</td>
78             <td>{$forms.profileForm.name.control}</td>
79           </tr>
80           <tr>
81             <td align="right" nowrap>{$i18n.label.login} (*):</td>
82             <td>{$forms.profileForm.login.control}</td>
83           </tr>
84 {if !$auth_external}
85           <tr>
86             <td align="right" nowrap>{$i18n.label.password} (*):</td>
87             <td>{$forms.profileForm.password1.control}</td>
88           </tr>
89           <tr>
90             <td align="right" nowrap>{$i18n.label.confirm_password} (*):</td>
91             <td>{$forms.profileForm.password2.control}</td>
92           </tr>
93 {/if}
94           <tr>
95             <td align="right" nowrap>{$i18n.label.email}:</td>
96             <td>{$forms.profileForm.email.control}</td>
97           </tr>
98           <tr>
99             <td></td>
100             <td>{$i18n.label.required_fields}</td>
101           </tr>
102
103 {if $user->canManageTeam()}
104           <tr>
105             <td colspan="2">&nbsp;</td>
106           </tr>
107           <tr>
108             <td align="right" nowrap>{$i18n.label.team_name}:</td>
109             <td>{$forms.profileForm.team_name.control}</td>
110           </tr>
111           <tr>
112             <td align="right">{$i18n.label.currency}:</td>
113             <td>{$forms.profileForm.currency.control}</td>
114           </tr>
115           <tr>
116            <td align="right" nowrap>{$i18n.label.language}:</td>
117            <td>{$forms.profileForm.lang.control}</td>
118           </tr>
119           <tr>
120             <td align="right">{$i18n.label.decimal_mark}:</td>
121             <td>{$forms.profileForm.decimal_mark.control} <font id="decimal_preview" color="#777777">&nbsp;</font></td>
122           <tr>
123             <td align="right" nowrap>{$i18n.label.date_format}:</td>
124             <td>{$forms.profileForm.format_date.control} <font id="date_format_preview" color="#777777">&nbsp;</font></td>
125           </tr>
126           <tr>
127             <td align="right" nowrap>{$i18n.label.time_format}:</td>
128             <td>{$forms.profileForm.format_time.control} <font id="time_format_preview" color="#777777">&nbsp;</font></td>
129           </tr>
130           <tr>
131             <td align="right" nowrap>{$i18n.label.week_start}:</td>
132             <td>{$forms.profileForm.start_week.control}</td>
133           </tr>
134           <tr>
135             <td align="right" nowrap>{$i18n.form.profile.tracking_mode}:</td>
136             <td>{$forms.profileForm.tracking_mode.control}</td>
137           </tr>
138           <tr>
139             <td align="right" nowrap>{$i18n.form.profile.record_type}:</td>
140             <td>{$forms.profileForm.record_type.control}</td>
141           </tr>
142
143           {* initialize preview text *}
144           <script>
145             MakeFormatPreview("date_format_preview", document.getElementById("format_date"));
146             MakeFormatPreview("time_format_preview", document.getElementById("format_time"));
147
148             function adjustDecimalPreview()
149             {
150               var mark = document.getElementById("decimal_mark").value;
151               var example = document.getElementById("decimal_preview");
152               example.innerHTML = "<i>3"+mark+"14</i>";
153             }
154             adjustDecimalPreview();
155           </script>
156
157           <tr>
158             <td>&nbsp;</td>
159             <td>&nbsp;</td>
160           </tr>
161
162           <tr>
163              <td colspan="2" class="sectionHeader">{$i18n.form.profile.plugins}</td>
164           </tr>
165           <tr><td>&nbsp;</td></tr>
166           <tr>
167             <td align="right" nowrap>{$forms.profileForm.charts.control}</td>
168             <td><label for="charts">{$i18n.title.charts}</label></td>
169           </tr>
170           <tr>
171             <td align="right" nowrap>{$forms.profileForm.clients.control}</td>
172             <td><label for="clients">{$i18n.title.clients}</label> {$forms.profileForm.client_required.control} <span id="required_label"><label for="client_required">{$i18n.label.required}</label></span></td>
173           </tr>
174           <tr>
175             <td align="right" nowrap>{$forms.profileForm.invoices.control}</td>
176             <td><label for="invoices">{$i18n.title.invoices}</label></td>
177           </tr>
178           <tr>
179             <td align="right" nowrap>{$forms.profileForm.custom_fields.control}</td>
180             <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>
181           </tr>
182           <tr>
183             <td align="right" nowrap>{$forms.profileForm.expenses.control}</td>
184             <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></td>
185           </tr>
186           <tr>
187             <td align="right" nowrap>{$forms.profileForm.notifications.control}</td>
188             <td><label for="notifications">{$i18n.title.notifications}</label> <span id="notifications_config"><a href="notifications.php">{$i18n.label.configure}</a></span></td>
189           </tr>
190           <tr>
191             <td align="right" nowrap>{$forms.profileForm.locking.control}</td>
192             <td><label for="locking">{$i18n.title.locking}</label> <span id="locking_config"><a href="locking.php">{$i18n.label.configure}</a></span></td>
193           </tr>
194           <tr>
195             <td align="right" nowrap>{$forms.profileForm.quotas.control}</td>
196             <td><label for="quotas">{$i18n.label.monthly_quotas}</label> <span id="quotas_config"><a href="quotas.php">{$i18n.label.configure}</a></span></td>
197           </tr>
198 {/if}
199
200           <tr>
201             <td colspan="2">&nbsp;</td>
202           </tr>
203           <tr>
204             <td colspan="2" height="50" align="center">{$forms.profileForm.btn_save.control}</td>
205           </tr>
206         </table>
207       </td>
208     </tr>
209 </table>
210 {$forms.profileForm.close}