Merge branch 'master_xieqiyu_28400' into 'master'

* Code for bug#28400.

See merge request easycorp/zentaopms!7090
This commit is contained in:
王怡栋
2023-03-01 00:30:04 +00:00
2 changed files with 11 additions and 4 deletions

View File

@@ -2936,14 +2936,17 @@ class executionModel extends model
$this->loadModel('task');
$taskStories = array();
$parents = array();
$execution = $this->getByID($executionID);
$tasks = $this->dao->select('id,execution,assignedTo,story,consumed,status')->from(TABLE_TASK)->where('id')->in($this->post->tasks)->fetchAll('id');
$tasks = $this->dao->select('id,execution,assignedTo,story,consumed,status,parent')->from(TABLE_TASK)->where('id')->in($this->post->tasks)->fetchAll('id');
foreach($tasks as $task)
{
/* Save the assignedToes and stories, should linked to execution. */
$assignedToes[$task->assignedTo] = $task->execution;
$taskStories[$task->story] = $task->story;
if($task->parent < 0) $parents[$task->id] = $task->id;
$data = new stdclass();
$data->project = $execution->project;
$data->execution = $executionID;
@@ -2963,6 +2966,10 @@ class executionModel extends model
$this->loadModel('action')->create('task', $task->id, 'moved', '', $task->execution);
}
/* Get stories of children task. */
$childrens = $this->dao->select('*')->from(TABLE_TASK)->where('parent')->in($parents)->fetchAll('id');
foreach($childrens as $children) $taskStories[$children->story] = $children->story;
/* Remove empty story. */
unset($taskStories[0]);

View File

@@ -926,9 +926,6 @@ class storyModel extends model
->setDefault('assignedDate', $oldStory->assignedDate)
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('reviewedBy', $oldStory->reviewedBy)
->setDefault('title', $oldStory->title)
->setDefault('spec', $oldStory->spec)
->setDefault('verify', $oldStory->verify)
->setDefault('mailto', '')
->setDefault('deleteFiles', array())
->add('id', $storyID)
@@ -945,6 +942,9 @@ class storyModel extends model
->setIF(!in_array($this->post->source, $this->config->story->feedbackSource), 'feedbackBy', '')
->setIF(!in_array($this->post->source, $this->config->story->feedbackSource), 'notifyEmail', '')
->setIF(!empty($_POST['plan'][0]) and $oldStory->stage == 'wait', 'stage', 'planned')
->setIF(!isset($_POST['title']), 'title', $oldStory->title)
->setIF(!isset($_POST['spec']), 'spec', $oldStory->spec)
->setIF(!isset($_POST['verify']), 'verify', $oldStory->verify)
->stripTags($this->config->story->editor->edit['id'], $this->config->allowedTags)
->join('mailto', ',')
->join('linkStories', ',')