Merge branch 'master' into zenops_46

This commit is contained in:
caoyanyi
2022-11-08 09:24:42 +08:00
512 changed files with 9642 additions and 5068 deletions
+9 -19
View File
@@ -91,7 +91,7 @@ class taskModel extends model
->setDefault('execution', $executionID)
->setDefault('estimate,left,story', 0)
->setDefault('status', 'wait')
->setIF($this->config->systemMode == 'new', 'project', $this->getProjectID($executionID))
->setDefault('project', $this->getProjectID($executionID))
->setIF($this->post->estimate != false, 'left', $this->post->estimate)
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))
->setDefault('estStarted', '0000-00-00')
@@ -369,7 +369,7 @@ class taskModel extends model
$data[$i]->pri = $tasks->pri[$i];
$data[$i]->estimate = $tasks->estimate[$i];
$data[$i]->left = $tasks->estimate[$i];
$data[$i]->project = $this->config->systemMode == 'new' ? $projectID : 0;
$data[$i]->project = $projectID;
$data[$i]->execution = $executionID;
$data[$i]->estStarted = $estStarted;
$data[$i]->deadline = $deadline;
@@ -1466,11 +1466,9 @@ class taskModel extends model
return false;
}
if($this->config->systemMode == 'new')
{
$project = $this->loadModel('project')->getByID($oldTask->project);
if($project->model == 'waterfall') $this->config->task->edit->requiredFields .= ',estStarted,deadline';
}
$project = $this->loadModel('project')->getByID($oldTask->project);
if($project->model == 'waterfall') $this->config->task->edit->requiredFields .= ',estStarted,deadline';
foreach(explode(',', $this->config->task->edit->requiredFields) as $field)
{
$field = trim($field);
@@ -2609,11 +2607,11 @@ class taskModel extends model
{
if(!$this->loadModel('common')->checkField(TABLE_TASK, $type)) return array();
$orderBy = str_replace('pri_', 'priOrder_', $orderBy);
$tasks = $this->dao->select("t1.*, t2.id as executionID, t2.name as executionName, t2.type as executionType, t3.id as storyID, t3.title as storyTitle, t3.status AS storyStatus, t3.version AS latestStoryVersion, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder")
$tasks = $this->dao->select("t1.*, t4.id as project, t2.id as executionID, t2.name as executionName, t4.name as projectName, t2.multiple as executionMultiple, t2.type as executionType, t3.id as storyID, t3.title as storyTitle, t3.status AS storyStatus, t3.version AS latestStoryVersion, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder")
->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on("t1.execution = t2.id")
->leftJoin(TABLE_STORY)->alias('t3')->on('t1.story = t3.id')
->leftJoin(TABLE_PROJECT)->alias('t4')->on("t1.project = t4.id")
->leftJoin(TABLE_PROJECT)->alias('t4')->on("t2.project = t4.id")
->leftJoin(TABLE_TASKTEAM)->alias('t5')->on("t5.task = t1.id and t5.account = '{$account}'")
->where('t1.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
@@ -2639,15 +2637,7 @@ class taskModel extends model
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task', false);
$taskTeam = $this->dao->select('*')->from(TABLE_TASKTEAM)->where('task')->in(array_keys($tasks))->fetchGroup('task');
if(!empty($taskTeam))
{
foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team;
}
$projectList = array();
foreach($tasks as $task) $projectList[$task->project] = $task->project;
$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);
foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team;
if($tasks) return $this->processTasks($tasks);
return array();
@@ -2708,7 +2698,7 @@ class taskModel extends model
->andWhere('t1.deleted')->eq(0)
->beginIF($this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi()
->andWhere('t2.deleted')->eq(0)
->beginIF($this->config->systemMode == 'new')->andWhere('t3.deleted')->eq(0)->fi()
->andWhere('t3.deleted')->eq(0)
->fetchAll('id');
return $tasks;
}