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