-if ($user->can('view_timesheets') || $user->can('view_all_timesheets') || $user->can('view_client_timesheets')) {
- // Prepare user list for dropdown.
- if ($notClient) {
- $rank = $user->can('view_all_timesheets') ? MAX_RANK : $user->getMaxRankForGroup($group_id);
- if ($user->can('view_own_timesheets'))
- $options = array('max_rank'=>$rank,'include_self'=>true,'self_first'=>true);
- else
- $options = array('max_rank'=>$rank);
- $user_list = $user->getUsers($options);
- } else
- $user_list = $users_for_client; // Obtained above.
-
+if ($user->can('track_time')) {
+ $rank = $user->getMaxRankForGroup($group_id);
+ if ($user->can('track_own_time'))
+ $options = array('status'=>ACTIVE,'max_rank'=>$rank,'include_self'=>true,'self_first'=>true);
+ else
+ $options = array('status'=>ACTIVE,'max_rank'=>$rank);
+ $user_list = $user->getUsers($options);