+ if ($user->can('view_reports') || $user->can('view_all_reports')) {
+ $rank = $user->getMaxRankForGroup($user->getGroup());
+ if ($user->can('view_all_reports')) $max_rank = MAX_RANK;
+ if ($user->can('view_own_reports')) {
+ $options_active = array('max_rank'=>$max_rank,'include_self'=>true,'status'=>ACTIVE);
+ $options_inactive = array('max_rank'=>$max_rank,'include_self'=>true,'status'=>INACTIVE);
+ } else {
+ $options_active = array('max_rank'=>$max_rank,'status'=>ACTIVE);
+ $options_inactive = array('max_rank'=>$max_rank,'status'=>INACTIVE);
+ }
+ $active_users = $user->getUsers($options_active);
+ $inactive_users = $user->getUsers($options_inactive);
+ }
+ elseif ($user->isClient()) {
+ $options_active = array('status'=>ACTIVE);
+ $options_inactive = array('status'=>INACTIVE);
+ $active_users = ttGroupHelper::getUsersForClient($options_active);
+ $inactive_users = ttGroupHelper::getUsersForClient($options_inactive);
+ }
+
+ foreach ($active_users as $single_user) {
+ $user_list_active[$single_user['id']] = $single_user['name'];
+ $projects = ttProjectHelper::getAssignedProjects($single_user['id']);
+ if ($projects) {
+ foreach ($projects as $single_project) {
+ $assigned_projects[$single_user['id']][] = $single_project['id'];
+ }
+ }
+ }
+ $row_count = ceil(count($user_list_active)/3);
+ $form->addInput(array('type'=>'checkboxgroup',
+ 'name'=>'users_active',
+ 'data'=>$user_list_active,
+ 'layout'=>'V',
+ 'groupin'=>$row_count,
+ 'style'=>'width: 100%;'));