From 337ae7c9f4cf2cabcbf20f6844a6e71562263500 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 9 Dec 2018 14:23:25 +0000 Subject: [PATCH] Removed group selector from projects.php to keep things simple. --- WEB-INF/lib/ttUser.class.php | 2 +- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/projects.tpl | 10 ---------- projects.php | 33 --------------------------------- 4 files changed, 2 insertions(+), 45 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 5c21879b..e6f271df 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -250,9 +250,9 @@ class ttUser { $result = array(); $mdb2 = getConnection(); + $user_id = $this->getUser(); $group_id = $this->getGroup(); $org_id = $this->org_id; - $user_id = $this->getUser(); // Do a query with inner join to get assigned projects. $sql = "select p.id, p.name, p.description, p.tasks, upb.rate from tt_projects p". diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index d703090c..d6037b02 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.29.4618 | Copyright © Anuko | +  Anuko Time Tracker 1.18.29.4619 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/projects.tpl b/WEB-INF/templates/projects.tpl index 09966a84..58999365 100644 --- a/WEB-INF/templates/projects.tpl +++ b/WEB-INF/templates/projects.tpl @@ -6,16 +6,6 @@
{if $user->can('manage_projects')} - {if $group_dropdown} -{$forms.projectsForm.open} {* projectsForm consists only of one dropdown group control *} - - - - -
{$i18n.label.group}: {$forms.projectsForm.group.control}
-{$forms.projectsForm.close} - {/if} - {if $inactive_projects} diff --git a/projects.php b/projects.php index 8b4537e7..5b562366 100644 --- a/projects.php +++ b/projects.php @@ -28,7 +28,6 @@ require_once('initialize.php'); import('form.Form'); -import('ttTeamHelper'); import('ttGroupHelper'); // Access checks. @@ -40,46 +39,14 @@ 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); - } -} - if($user->can('manage_projects')) { $active_projects = ttGroupHelper::getActiveProjects(); $inactive_projects = ttGroupHelper::getInactiveProjects(); } else $active_projects = $user->getAssignedProjects(); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('active_projects', $active_projects); $smarty->assign('inactive_projects', $inactive_projects); $smarty->assign('title', $i18n->get('title.projects')); -- 2.20.1
{$i18n.form.projects.active_projects}