X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=projects.php;h=1b137895eae380c549fff0547292e5213ad2c6bc;hb=HEAD;hp=5315c4f70015d9da5b79c28a1ee7cce0634f65a6;hpb=030d2c3ffbf8229cc945427e9e9f7704226effe1;p=timetracker.git diff --git a/projects.php b/projects.php index 5315c4f7..1b137895 100644 --- a/projects.php +++ b/projects.php @@ -27,27 +27,30 @@ // +----------------------------------------------------------------------+ require_once('initialize.php'); -import('form.Form'); -import('ttTeamHelper'); +import('ttGroupHelper'); // Access checks. -if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) { +if (!(ttAccessAllowed('view_own_projects') || ttAccessAllowed('manage_projects'))) { header('Location: access_denied.php'); exit(); } -if (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode) { +if (MODE_PROJECTS != $user->getTrackingMode() && MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) { header('Location: feature_disabled.php'); exit(); } +// End of access checks. -if($user->canManageTeam()) { - $active_projects = ttTeamHelper::getActiveProjects($user->team_id); - $inactive_projects = ttTeamHelper::getInactiveProjects($user->team_id); +$showFiles = $user->isPluginEnabled('at'); + +if($user->can('manage_projects')) { + $active_projects = ttGroupHelper::getActiveProjects($showFiles); + $inactive_projects = ttGroupHelper::getInactiveProjects($showFiles); } else - $active_projects = $user->getAssignedProjects(); + $active_projects = $user->getAssignedProjects($showFiles); $smarty->assign('active_projects', $active_projects); $smarty->assign('inactive_projects', $inactive_projects); +$smarty->assign('show_files', $showFiles); $smarty->assign('title', $i18n->get('title.projects')); $smarty->assign('content_page_name', 'projects.tpl'); $smarty->display('index.tpl');