Initial repo created
[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 </script>
49
50 {$forms.profileForm.open}
51
52 {if $user->canManageTeam()}
53 {include file="datetime_format_preview.tpl"}
54 {/if}
55
56 <table cellspacing="4" cellpadding="7" border="0">
57     <tr>
58       <td>
59         <table cellspacing="1" cellpadding="2" border="0">
60           <tr>
61             <td align="right" nowrap>{$i18n.label.person_name} (*):</td>
62             <td>{$forms.profileForm.name.control}</td>
63           </tr>
64           <tr>
65             <td align="right" nowrap>{$i18n.label.login} (*):</td>
66             <td>{$forms.profileForm.login.control}</td>
67           </tr>
68
69 {if !$auth_external}
70           <tr>
71             <td align="right" nowrap>{$i18n.label.password} (*):</td>
72             <td>{$forms.profileForm.password1.control}</td>
73           </tr>
74           <tr>
75             <td align="right" nowrap>{$i18n.label.confirm_password} (*):</td>
76             <td>{$forms.profileForm.password2.control}</td>
77           </tr>
78 {/if}
79
80           <tr>
81             <td align="right" nowrap>{$i18n.label.email}:</td>
82             <td>{$forms.profileForm.email.control}</td>
83           </tr>
84           <tr>
85             <td></td>
86             <td>{$i18n.label.required_fields}</td>
87           </tr>
88
89 {if $user->canManageTeam()}
90           <tr>
91             <td colspan="2">&nbsp;</td>
92           </tr>
93           <tr>
94             <td align="right" nowrap>{$i18n.label.team_name}:</td>
95             <td>{$forms.profileForm.team_name.control}</td>
96           </tr>
97           <!-- <tr>
98             <td align="right">{$i18n.label.address}:</td>
99             <td>{$forms.profileForm.address.control}</td>
100           </tr> -->
101           <tr>
102             <td align="right">{$i18n.label.currency}:</td>
103             <td>{$forms.profileForm.currency.control}</td>
104           </tr>
105           <tr>
106             <td align="right" nowrap>{$i18n.label.lock_interval}:</td>
107             <td>{$forms.profileForm.lock_interval.control}</td>
108           </tr>
109           <tr>
110            <td align="right" nowrap>{$i18n.label.language}:</td>
111            <td>{$forms.profileForm.lang.control}</td>
112           </tr>
113           <tr>
114             <td align="right">{$i18n.label.decimal_mark}:</td>
115             <td>{$forms.profileForm.decimal_mark.control} <font id="decimal_preview" color="#777777">&nbsp;</font></td>
116           <tr>
117             <td align="right" nowrap>{$i18n.label.date_format}:</td>
118             <td>{$forms.profileForm.format_date.control} <font id="date_format_preview" color="#777777">&nbsp;</font></td>
119           </tr>
120           <tr>
121             <td align="right" nowrap>{$i18n.label.time_format}:</td>
122             <td>{$forms.profileForm.format_time.control} <font id="time_format_preview" color="#777777">&nbsp;</font></td>
123           </tr>
124           <tr>
125             <td align="right" nowrap>{$i18n.label.week_start}:</td>
126             <td>{$forms.profileForm.start_week.control}</td>
127           </tr>
128           <tr>
129             <td align="right" nowrap>{$i18n.form.profile.tracking_mode}:</td>
130             <td>{$forms.profileForm.tracking_mode.control}</td>
131           </tr>
132           <tr>
133             <td align="right" nowrap>{$i18n.form.profile.record_type}:</td>
134             <td>{$forms.profileForm.record_type.control}</td>
135           </tr>
136
137           {* initialize preview text *}
138           <script>
139             MakeFormatPreview("date_format_preview", document.getElementById("format_date"));
140             MakeFormatPreview("time_format_preview", document.getElementById("format_time"));
141             
142             function adjustDecimalPreview()
143             {
144               var mark = document.getElementById("decimal_mark").value;
145               var example = document.getElementById("decimal_preview");
146               example.innerHTML = "<i>3"+mark+"14</i>";
147             }
148             adjustDecimalPreview();
149           </script>
150
151           <tr>
152             <td>&nbsp;</td>
153             <td>&nbsp;</td>
154           </tr>
155
156           <tr>
157              <td colspan="2" class="sectionHeader">{$i18n.form.profile.plugins}</td>
158           </tr>
159           <tr><td>&nbsp;</td></tr>
160           <tr>
161             <td align="right" nowrap>{$forms.profileForm.charts.control}</td>
162             <td><label for="charts">{$i18n.title.charts}</label></td>
163           </tr>
164           <tr>
165             <td align="right" nowrap>{$forms.profileForm.clients.control}</td>
166             <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>
167           </tr>
168           <tr>
169             <td align="right" nowrap>{$forms.profileForm.invoices.control}</td>
170             <td><label for="invoices">{$i18n.title.invoices}</label></td>
171           </tr>
172           <tr>
173             <td align="right" nowrap>{$forms.profileForm.custom_fields.control}</td>
174             <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>
175           </tr>
176           <tr>
177             <td align="right" nowrap>{$forms.profileForm.expenses.control}</td>
178             <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>
179           </tr>
180           <tr>
181             <td align="right" nowrap>{$forms.profileForm.notifications.control}</td>
182             <td><label for="notifications">{$i18n.title.notifications}</label> <span id="notifications_config"><a href="notifications.php">{$i18n.label.configure}</a></span></td>
183           </tr>
184 {/if}
185
186           <tr>
187             <td colspan="2">&nbsp;</td>
188           </tr>
189           <tr>
190             <td colspan="2" height="50" align="center">{$forms.profileForm.btn_save.control}</td>
191           </tr>
192         </table>
193       </td>
194     </tr>
195 </table>
196 {$forms.profileForm.close}