X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=user_add.php;h=8a507e9ee42e99da9cdf0a4112539afc78fada28;hb=45a530c33fdd7ab2ccd1905c24a371c94e17eac5;hp=eb9391472acb6248ec9eb24fd3407730b6fd4a43;hpb=8fc038ec7505483c193e290423623b6a66ee3797;p=timetracker.git diff --git a/user_add.php b/user_add.php index eb939147..8a507e9e 100644 --- a/user_add.php +++ b/user_add.php @@ -29,6 +29,7 @@ require_once('initialize.php'); import('form.Form'); import('ttTeamHelper'); +import('ttGroupHelper'); import('ttUserHelper'); import('form.Table'); import('form.TableColumn'); @@ -46,7 +47,7 @@ if (!ttAccessAllowed('manage_users')) { @include('plugins/limit/user_add.php'); if ($user->isPluginEnabled('cl')) - $clients = ttTeamHelper::getActiveClients($user->group_id); + $clients = ttGroupHelper::getActiveClients(); $assigned_projects = array(); if ($request->isPost()) { @@ -90,7 +91,7 @@ if ($user->isPluginEnabled('cl')) $form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'rate','format'=>'.2','value'=>$cl_rate)); -$projects = ttTeamHelper::getActiveProjects($user->group_id); +$projects = ttGroupHelper::getActiveProjects(); // Define classes for the projects table. class NameCellRenderer extends DefaultCellRenderer { @@ -150,7 +151,7 @@ if ($request->isPost()) { 'login' => $cl_login, 'password' => $cl_password1, 'rate' => $cl_rate, - 'group_id' => $user->getActiveGroup(), + 'group_id' => $user->getGroup(), 'org_id' => $user->org_id, 'role_id' => $cl_role_id, 'client_id' => $cl_client_id, @@ -169,6 +170,7 @@ if ($request->isPost()) { $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('active_roles', $active_roles); $smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('show_projects', count($projects) > 0); $smarty->assign('onload', 'onLoad="document.userForm.name.focus();handleClientControl();"'); $smarty->assign('title', $i18n->get('title.add_user')); $smarty->assign('content_page_name', 'user_add.tpl');