2 // The setDefaultRate function sets / unsets default rate for a project
3 // when a corresponding checkbox is ticked.
4 function setDefaultRate(element) {
5 var default_rate = document.userForm.rate.value;
6 if (default_rate == '') {
7 // No default rate, nothing to do!
10 // Iterate through elements of the form to find and set the project rate.
11 for (var i = 0; i < userForm.elements.length; i++) {
12 if ((userForm.elements[i].type == 'text') && (userForm.elements[i].name == ('rate_'+element.value))) {
13 if (element.checked) {
14 userForm.elements[i].value = default_rate;
16 userForm.elements[i].value = '';
18 break; // Element is found and set, nothing more to do, break out of the loop.
23 // handleClientControl - controls visibility of the client dropdown depending on the selected user role.
24 // We need to show it only when the "Client" user role is selected.
25 function handleClientControl() {
26 var clientControl = document.getElementById("client");
27 if ("16" == document.getElementById("role").value)
28 clientControl.style.visibility = "visible";
30 clientControl.style.visibility = "hidden";
34 {$forms.userForm.open}
35 <table cellspacing="4" cellpadding="7" border="0">
36 <table cellspacing="1" cellpadding="2" border="0">
38 <td align="right">{$i18n.label.person_name} (*):</td>
39 <td>{$forms.userForm.name.control}</td>
42 <td align="right">{$i18n.label.login} (*):</td>
43 <td>{$forms.userForm.login.control}</td>
47 <td align="right">{$i18n.label.password} (*):</td>
48 <td>{$forms.userForm.pas1.control}</td>
51 <td align="right">{$i18n.label.confirm_password} (*):</td>
52 <td>{$forms.userForm.pas2.control}</td>
56 <td align="right" nowrap>{$i18n.label.email}:</td>
57 <td>{$forms.userForm.email.control}</td>
59 {if $user->isManager()}
61 <td align="right">{$i18n.form.users.role}:</td>
62 <td>{$forms.userForm.role.control} {$forms.userForm.client.control}</td>
66 <td align="right">{$i18n.form.users.default_rate} (0{$user->decimal_mark}00):</td>
67 <td>{$forms.userForm.rate.control}</td>
69 {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}
71 <td align="right">{$i18n.label.projects}:</td>
72 <td>{$forms.userForm.projects.control}</td>
75 <td colspan="2" align="center">{$i18n.label.required_fields}</td>
79 <td colspan="2" align="center" height="50">{$forms.userForm.btn_submit.control}</td>
83 {$forms.userForm.close}