X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=projects.php;h=1b137895eae380c549fff0547292e5213ad2c6bc;hb=HEAD;hp=8b4537e796579c462a6a71ca591f54c9ddddd3e4;hpb=75ff7ff29a038803d3b6e2c31b793049bbb2fbd4;p=timetracker.git diff --git a/projects.php b/projects.php index 8b4537e7..1b137895 100644 --- a/projects.php +++ b/projects.php @@ -27,8 +27,6 @@ // +----------------------------------------------------------------------+ require_once('initialize.php'); -import('form.Form'); -import('ttTeamHelper'); import('ttGroupHelper'); // Access checks. @@ -40,48 +38,19 @@ if (MODE_PROJECTS != $user->getTrackingMode() && MODE_PROJECTS_AND_TASKS != $use header('Location: feature_disabled.php'); exit(); } -if ($request->isPost() && !$user->isGroupValid($request->getParameter('group'))) { - header('Location: access_denied.php'); // Wrong group id in post. - exit(); -} // End of access checks. -if ($request->isPost()) { - $group_id = $request->getParameter('group'); - $user->setOnBehalfGroup($group_id); - // Projects feature may not be available in new group, check and redirect. - if (MODE_PROJECTS != $user->getTrackingMode() && MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) { - header('Location: feature_disabled.php'); - exit(); - } -} else { - $group_id = $user->getGroup(); -} - -$form = new Form('projectsForm'); -if ($user->can('manage_subgroups')) { - $groups = $user->getGroupsForDropdown(); - if (count($groups) > 1) { - $form->addInput(array('type'=>'combobox', - 'onchange'=>'this.form.submit();', - 'name'=>'group', - 'style'=>'width: 250px;', - 'value'=>$group_id, - 'data'=>$groups, - 'datakeys'=>array('id','name'))); - $smarty->assign('group_dropdown', 1); - } -} +$showFiles = $user->isPluginEnabled('at'); if($user->can('manage_projects')) { - $active_projects = ttGroupHelper::getActiveProjects(); - $inactive_projects = ttGroupHelper::getInactiveProjects(); + $active_projects = ttGroupHelper::getActiveProjects($showFiles); + $inactive_projects = ttGroupHelper::getInactiveProjects($showFiles); } else - $active_projects = $user->getAssignedProjects(); + $active_projects = $user->getAssignedProjects($showFiles); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); $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');