From 77dc69032fb4b318c4fb92c3fe54e0e1b03dae4e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 13 Dec 2018 20:46:30 +0000 Subject: [PATCH] Removed group selector from tasks.php to keep things simple. --- WEB-INF/lib/ttUser.class.php | 5 ++++- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/tasks.tpl | 10 ---------- tasks.php | 32 -------------------------------- 4 files changed, 5 insertions(+), 44 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index c00bd9f4..2d7f1c98 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -294,8 +294,11 @@ class ttUser { $mdb2 = getConnection(); $tasks = implode(',', $task_ids); // This is a comma-separated list of task ids. + $group_id = $this->getGroup(); + $org_id = $this->org_id; + $sql = "select id, name, description from tt_tasks". - " where group_id = $this->group_id and status = 1 and id in ($tasks) order by name"; + " where group_id = $group_id and org_id = $org_id and status = 1 and id in ($tasks) order by name"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { while ($val = $res->fetchRow()) { diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 95df44bc..ce84ca07 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.30.4648 | Copyright © Anuko | +  Anuko Time Tracker 1.18.30.4649 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/tasks.tpl b/WEB-INF/templates/tasks.tpl index 9db99069..647a6a78 100644 --- a/WEB-INF/templates/tasks.tpl +++ b/WEB-INF/templates/tasks.tpl @@ -6,16 +6,6 @@
{if $user->can('manage_tasks')} - {if $group_dropdown} -{$forms.tasksForm.open} {* tasksForm consists only of one dropdown group control *} - - - - -
{$i18n.label.group}: {$forms.tasksForm.group.control}
-{$forms.tasksForm.close} - {/if} - {if $inactive_tasks} diff --git a/tasks.php b/tasks.php index ba91ed01..7b5f9979 100644 --- a/tasks.php +++ b/tasks.php @@ -39,46 +39,14 @@ if (MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) { 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); - // Tasks feature may not be available in new group, check and redirect. - if (MODE_PROJECTS_AND_TASKS != $user->getTrackingMode()) { - header('Location: feature_disabled.php'); - exit(); - } -} else { - $group_id = $user->getGroup(); -} - -$form = new Form('tasksForm'); -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_tasks')) { $active_tasks = ttGroupHelper::getActiveTasks(); $inactive_tasks = ttGroupHelper::getInactiveTasks(); } else $active_tasks = $user->getAssignedTasks(); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('active_tasks', $active_tasks); $smarty->assign('inactive_tasks', $inactive_tasks); $smarty->assign('title', $i18n->get('title.tasks')); -- 2.20.1
{$i18n.form.tasks.active_tasks}