// Prepare user list part.
$userlist = -1;
- if (($user->canManageTeam() || $user->isClient()) && is_array($bean->getAttribute('users')))
+ if (($user->can('view_reports') || $user->isClient()) && is_array($bean->getAttribute('users')))
$userlist = join(',', $bean->getAttribute('users'));
// Prepare sql query part for user list.
$user_list_part = null;
- if ($user->canManageTeam() || $user->isClient())
+ if ($user->can('view_reports') || $user->isClient())
$user_list_part = " and l.user_id in ($userlist)";
else
$user_list_part = " and l.user_id = ".$user->id;
// Prepare user list part.
$userlist = -1;
- if (($user->canManageTeam() || $user->isClient())) {
+ if (($user->can('view_reports') || $user->isClient())) {
if ($report['users'])
$userlist = $report['users'];
else {
}
// Prepare sql query part for user list.
$user_list_part = null;
- if ($user->canManageTeam() || $user->isClient())
+ if ($user->can('view_reports') || $user->isClient())
$user_list_part = " and l.user_id in ($userlist)";
else
$user_list_part = " and l.user_id = ".$user->id;
// Prepare user list part.
$userlist = -1;
- if (($user->canManageTeam() || $user->isClient()) && is_array($bean->getAttribute('users')))
+ if (($user->can('view_reports') || $user->isClient()) && is_array($bean->getAttribute('users')))
$userlist = join(',', $bean->getAttribute('users'));
// Prepare sql query part for user list.
$user_list_part = null;
- if ($user->canManageTeam() || $user->isClient())
+ if ($user->can('view_reports') || $user->isClient())
$user_list_part = " and ei.user_id in ($userlist)";
else
$user_list_part = " and ei.user_id = ".$user->id;
// Prepare user list part.
$userlist = -1;
- if (($user->canManageTeam() || $user->isClient())) {
+ if (($user->can('view_reports') || $user->isClient())) {
if ($report['users'])
$userlist = $report['users'];
else {
}
// Prepare sql query part for user list.
$user_list_part = null;
- if ($user->canManageTeam() || $user->isClient())
+ if ($user->can('view_reports') || $user->isClient())
$user_list_part = " and ei.user_id in ($userlist)";
else
$user_list_part = " and ei.user_id = ".$user->id;
array_push($fields, 'l.id as id');
array_push($fields, '1 as type'); // Type 1 is for tt_log entries.
array_push($fields, 'l.date as date');
- if($user->canManageTeam() || $user->isClient())
+ if($user->can('view_reports') || $user->isClient())
array_push($fields, 'u.name as user');
// Add client name if it is selected.
if ($bean->getAttribute('chclient') || 'client' == $group_by_option)