X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=mobile%2Fclients.php;h=d1e6b38f3fc5f816c466fe8b453b8f07adfbad99;hb=d18d90a3f3050def6c646eef7d5420c2d2091393;hp=4f03510ce7722b83bd705ac80807512400d0a2df;hpb=45c855269d952873285f7a835e82fc2b3eff3971;p=timetracker.git diff --git a/mobile/clients.php b/mobile/clients.php index 4f03510c..d1e6b38f 100644 --- a/mobile/clients.php +++ b/mobile/clients.php @@ -28,10 +28,10 @@ require_once('../initialize.php'); import('form.Form'); -import('ttTeamHelper'); +import('ttGroupHelper'); // Access checks. -if (!ttAccessAllowed('manage_clients')) { +if (!(ttAccessAllowed('view_own_clients') || ttAccessAllowed('manage_clients'))) { header('Location: access_denied.php'); exit(); } @@ -39,9 +39,16 @@ if (!$user->isPluginEnabled('cl')) { header('Location: feature_disabled.php'); exit(); } +// End of access checks. -$smarty->assign('active_clients', ttTeamHelper::getActiveClients($user->group_id, true)); -$smarty->assign('inactive_clients', ttTeamHelper::getInactiveClients($user->group_id, true)); +if($user->can('manage_clients')) { + $active_clients = ttGroupHelper::getActiveClients(true); + $inactive_clients = ttGroupHelper::getInactiveClients(true); +} else + $active_clients = $user->getAssignedClients(); + +$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');