From 95c604cef66d01e2bb787e4e9662c460b42b64d9 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Tue, 30 Mar 2021 09:31:32 +0800 Subject: [PATCH] * Fix bug #11540. --- module/execution/control.php | 1 + module/execution/model.php | 3 +-- module/task/control.php | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index e559b948b7..8f690b67c3 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1193,6 +1193,7 @@ class execution extends control { if($this->app->openApp == 'project') { + if(!empty($copyExecutionID)) $projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($copyExecutionID)->fetch('project'); $project = $this->project->getByID($projectID); $model = $project->model; diff --git a/module/execution/model.php b/module/execution/model.php index 66dcc35e0d..d302e3a905 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1810,7 +1810,6 @@ class executionModel extends model $bugToTasks = fixer::input('post')->get(); $bugs = $this->bug->getByList(array_keys($bugToTasks->import)); - $projectID = $this->loadModel('task')->getProjectID($executionID); foreach($bugToTasks->import as $key => $value) { $bug = zget($bugs, $key, ''); @@ -1818,7 +1817,7 @@ class executionModel extends model $task = new stdClass(); $task->bug = $bug; - $task->project = $projectID; + $task->project = $execution->project; $task->execution = $executionID; $task->story = $bug->story; $task->storyVersion = $bug->storyVersion; diff --git a/module/task/control.php b/module/task/control.php index 347fb8ec83..2042306eb4 100644 --- a/module/task/control.php +++ b/module/task/control.php @@ -258,7 +258,14 @@ class task extends control } $execution = $this->execution->getById($executionID); - $taskLink = $this->createLink('execution', 'browse', "executionID=$executionID&tab=task"); + if($this->app->openApp == 'my') + { + $taskLink = $this->createLink('my', 'work', 'mode=task'); + } + else + { + $taskLink = $this->createLink('execution', 'browse', "executionID=$executionID"); + } $storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('execution', 'story', "executionID=$executionID"); /* Set menu. */ @@ -279,7 +286,7 @@ class task extends control /* Locate the browser. */ if(!empty($iframe)) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); - $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $storyLink)); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $taskLink)); } /* Set Custom*/