X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/1e79f87da93c796cf1a46d7f36eab5f0fef3db61..336dbb39dfa588646615c461e3f16b785998ea67:/WEB-INF/templates/user_edit.tpl?ds=inline diff --git a/WEB-INF/templates/user_edit.tpl b/WEB-INF/templates/user_edit.tpl index e7d9dd92..e17651b2 100644 --- a/WEB-INF/templates/user_edit.tpl +++ b/WEB-INF/templates/user_edit.tpl @@ -51,19 +51,35 @@ function setRate(element) { } } -// handleClientControl - controls visibility of the client dropdown depending on the selected user role. -// We need to show it only when the "Client" user role is selected. +// handleClientControl - controls visibility of the client dropdown depending on the selected user role, +// also hides and unselects projects when "Client" user role is selected. function handleClientControl() { var selectedRoleId = document.getElementById("role").value; var clientControl = document.getElementById("client"); + var nonClientBlock = document.getElementById("non_client_block"); + var projectsControl = document.getElementById("projects_control"); + var len = roles.length; for (var i = 0; i < len; i++) { if (selectedRoleId == roles[i][0]) { var isClient = roles[i][1]; - if (isClient == 1) + if (isClient == 1) { clientControl.style.visibility = "visible"; - else + nonClientBlock.style.display = "none"; + projectsControl.style.display = "none"; + + // Uncheck all project checkboxes. + var checkboxes = document.getElementsByName("projects[]"); + var j; + for (j = 0; j < checkboxes.length; j++) { + checkboxes[j].checked = false; + } + } else { + clientControl.value = ""; clientControl.style.visibility = "hidden"; + nonClientBlock.style.display = ""; + projectsControl.style.display = ""; + } break; } } @@ -110,16 +126,27 @@ function handleClientControl() { {$i18n.form.users.role}: {$user->role_name} {if $can_swap}{$i18n.form.user_edit.swap_roles}{/if} +{/if} + +{if $show_quota} + + {$i18n.label.quota} (%): + {$forms.userForm.quota_percent.control} {$i18n.label.what_is_it} + {/if} - {$i18n.form.users.default_rate} (0{$user->decimal_mark}00): + {$i18n.form.users.default_rate} (0{$user->getDecimalMark()}00): {$forms.userForm.rate.control} -{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} + +{if $show_projects} + +   {$i18n.label.projects}: {$forms.userForm.projects.control} + {/if} {$i18n.label.required_fields}