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