X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=mobile%2Fclients.php;h=d1e6b38f3fc5f816c466fe8b453b8f07adfbad99;hb=237f5fae68a9410971ce1c4895a07fe2fa0fbd52;hp=6312c2dd4e3c207115c5b2ec9ec52364d6528106;hpb=5fdf8659516ad2b07458deba8eda234e8e07c554;p=timetracker.git diff --git a/mobile/clients.php b/mobile/clients.php index 6312c2dd..d1e6b38f 100644 --- a/mobile/clients.php +++ b/mobile/clients.php @@ -28,16 +28,27 @@ require_once('../initialize.php'); import('form.Form'); -import('ttTeamHelper'); +import('ttGroupHelper'); -// Access check. -if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('cl')) { +// Access checks. +if (!(ttAccessAllowed('view_own_clients') || ttAccessAllowed('manage_clients'))) { header('Location: access_denied.php'); exit(); } +if (!$user->isPluginEnabled('cl')) { + header('Location: feature_disabled.php'); + exit(); +} +// End of access checks. + +if($user->can('manage_clients')) { + $active_clients = ttGroupHelper::getActiveClients(true); + $inactive_clients = ttGroupHelper::getInactiveClients(true); +} else + $active_clients = $user->getAssignedClients(); -$smarty->assign('active_clients', ttTeamHelper::getActiveClients($user->team_id, true)); -$smarty->assign('inactive_clients', ttTeamHelper::getInactiveClients($user->team_id, true)); -$smarty->assign('title', $i18n->getKey('title.clients')); +$smarty->assign('active_clients', $active_clients); +$smarty->assign('inactive_clients', $inactive_clients); +$smarty->assign('title', $i18n->get('title.clients')); $smarty->assign('content_page_name', 'mobile/clients.tpl'); $smarty->display('mobile/index.tpl');