From 7ff7bfd43571d6caa3ea3f02a17703d4c190da77 Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 19 Mar 2018 16:54:29 +0800 Subject: [PATCH] * Adjust task page for chilrenTask. --- module/project/control.php | 12 ++++++++++++ module/task/model.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/module/project/control.php b/module/project/control.php index 49b9820e30..216eb761ee 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -189,6 +189,18 @@ class project extends control /* Get tasks. */ $tasks = $this->project->getTasks($productID, $projectID, $this->projects, $browseType, $queryID, $moduleID, $sort, $pager); + if($browseType != 'unclosed' and $browseType != 'all') + { + foreach($tasks as $task) + { + if(isset($task->children)) + { + $task->children = true; + unset($task->children); + } + } + } + /* Build the search form. */ $actionURL = $this->createLink('project', 'task', "projectID=$projectID&status=bySearch¶m=myQueryID"); $this->config->project->search['onMenuBar'] = 'yes'; diff --git a/module/task/model.php b/module/task/model.php index 4707407095..61234bdf0b 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -1269,7 +1269,7 @@ class taskModel extends model ->leftJoin(TABLE_TEAM)->alias('t4')->on('t4.root = t1.id') ->leftJoin(TABLE_MODULE)->alias('t5')->on('t1.module = t5.id') ->where('t1.project')->eq((int)$projectID) - ->beginIF(!in_array($type, array('assignedtome', 'myinvolved')))->andWhere('t1.parent')->eq(0)->fi() + ->beginIF($type =='all' || is_array($type))->andWhere('t1.parent')->eq(0)->fi() ->beginIF($type == 'myinvolved') ->andWhere("((t4.`account` = '{$this->app->user->account}' AND t4.`type` = 'task') OR t1.`assignedTo` = '{$this->app->user->account}' OR t1.`finishedby` = '{$this->app->user->account}')") ->fi()