* [task#140892,done,2h,0h] Add manage task relation to programplan gantt.

This commit is contained in:
wangyuting
2025-04-14 10:41:30 +08:00
committed by 刘刚
parent a88489b1e0
commit c07e56b61b
13 changed files with 146 additions and 7 deletions
+29
View File
@@ -1792,6 +1792,35 @@ class taskModel extends model
return $taskPairs;
}
/**
* 获取项目下的任务列表。
* Get project task list.
*
* @param int $projectID
* @param bool $isPairs
* @access public
* @return array
*/
public function getProjectTaskList($projectID, $isPairs = false)
{
$taskList = $this->dao->select('*')->from(TABLE_TASK)
->where('deleted')->eq(0)
->beginIF($this->config->vision)->andWhere('vision')->eq($this->config->vision)->fi()
->andWhere('project')->eq($projectID)
->beginIF(!$this->app->user->admin)->andWhere('execution')->in($this->app->user->view->sprints)->fi()
->fetchAll('id');
$taskPairs = array();
foreach($taskList as $taskID => $task)
{
$prefix = $task->parent > 0 ? "[{$this->lang->task->childrenAB}] " : '';
$task->name = $prefix . "$task->id:" . (empty($task->finishedByRealName) ? '' : "$task->finishedByRealName:") . "$task->name";
$taskPairs[$taskID] = $task->name;
}
return $isPairs ? $taskPairs : $taskList;
}
/**
* 获取导出的任务数据。
* Get export task information.