- if ($user->can('view_own_reports'))
- $options = array('max_rank'=>$max_rank,'include_self'=>true);
- else
- $options = array('max_rank'=>$max_rank);
- $users = $user->getUsers($options); // Active and inactive users.
+ 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);