From 26da1c72cb5f210c0579df41a6eec7b6297fff0f Mon Sep 17 00:00:00 2001 From: liumengyi Date: Thu, 25 Nov 2021 15:52:15 +0800 Subject: [PATCH] * Finish task#45157. --- module/my/control.php | 1 + module/task/model.php | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/module/my/control.php b/module/my/control.php index 36e5c00177..d8f53a4f8b 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -304,6 +304,7 @@ class my extends control $task->parentName = $parent->name; } } + if($task->isSuspened) unset($tasks[$task->id]); } /* Get the story language configuration. */ diff --git a/module/task/model.php b/module/task/model.php index 52acee0b86..0ca43d3a79 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -2158,6 +2158,24 @@ class taskModel extends model $projectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($projectList)->fetchPairs('id'); foreach($tasks as $task) $task->projectName = zget($projectPairs, $task->project); + $suspendedLists = $this->dao->select('id')->from(TABLE_PROJECT) + ->where('deleted')->eq(0) + ->andWhere('status')->eq('suspended') + ->andWhere('type')->in('project,sprint') + ->fetchAll('id'); + foreach($tasks as $task) + { + foreach($suspendedLists as $suspendedList) + { + if($task->project == $suspendedList->id || $task->execution == $suspendedList->id) + { + $task->isSuspened = 1; + break; + } + } + if(!isset($task->isSuspened)) $task->isSuspened = 0; + } + if($tasks) return $this->processTasks($tasks); return array(); } @@ -2478,6 +2496,7 @@ class taskModel extends model } } } + return $tasks; }