From 7928df6cfae32edc575be0cd0072bb6c5294fcaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Wed, 20 Dec 2017 10:44:18 +0800 Subject: [PATCH] * Fix bug for task export. --- module/task/control.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/task/control.php b/module/task/control.php index b4d02d1461..93ce31df69 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -1233,6 +1233,13 @@ class task extends control $relatedStoryIdList = array(); foreach($tasks as $task) $relatedStoryIdList[$task->story] = $task->story; + /* Get team for multiple task. */ + $taskTeam = $this->dao->select('*')->from(TABLE_TEAM)->where('task')->in(array_keys($tasks))->fetchGroup('task'); + if(!empty($taskTeam)) + { + foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team; + } + /* Get related objects title or names. */ $relatedStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($relatedStoryIdList)->fetchPairs(); $relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('task')->andWhere('objectID')->in(@array_keys($tasks))->andWhere('extra')->ne('editor')->fetchGroup('objectID'); @@ -1280,6 +1287,7 @@ class task extends control if(isset($users[$task->lastEditedBy])) $task->lastEditedBy = $users[$task->lastEditedBy]; if(!empty($task->parent)) $task->name = '[' . $taskLang->childrenAB . '] ' . $task->name; + if(!empty($task->team)) $task->name = '[' . $taskLang->multipleAB . '] ' . $task->name; $task->openedDate = substr($task->openedDate, 0, 10); $task->assignedDate = substr($task->assignedDate, 0, 10);