From 8e5360356bbec768b9405bf9a78e76e41fa85c4d Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 11 Aug 2022 10:11:54 +0800 Subject: [PATCH 1/2] * Finish task#63769. --- module/story/control.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index 947203fb69..49e9bbb5a3 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -114,6 +114,8 @@ class story extends control $this->view->$fromObjectName = $fromObject; } + $copyStoryID = $storyID; + if(!empty($_POST)) { $response['result'] = 'success'; @@ -237,7 +239,18 @@ class story extends control setcookie('storyModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false); $branchID = $this->post->branch ? $this->post->branch : $branch; $response['locate'] = $this->createLink('product', 'browse', "productID=$productID&branch=$branchID&browseType=¶m=0&type=$type&orderBy=id_desc"); - if($this->session->storyList) $response['locate'] = $this->session->storyList; + if($this->session->storyList) + { + if($copyStoryID and strpos($this->session->storyList, 'productplan-view') !== false) + { + $storyInfo = $this->story->getByList(array($storyID, $copyStoryID)); + if($storyInfo[$storyID]->plan == $storyInfo[$copyStoryID]->plan or $storyInfo[$storyID]->product != $storyInfo[$copyStoryID]->product) $response['locate'] = $this->session->storyList; + } + else + { + $response['locate'] = $this->session->storyList; + } + } } else { From 809b70a5b8dd71e56e4eb5ac1d9e2adefe263376 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 11 Aug 2022 10:29:04 +0800 Subject: [PATCH 2/2] * Code for task#63769. Story#32949. --- module/story/control.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/story/control.php b/module/story/control.php index 49e9bbb5a3..3abd90d2f6 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -241,7 +241,8 @@ class story extends control $response['locate'] = $this->createLink('product', 'browse', "productID=$productID&branch=$branchID&browseType=¶m=0&type=$type&orderBy=id_desc"); if($this->session->storyList) { - if($copyStoryID and strpos($this->session->storyList, 'productplan-view') !== false) + /* When copying story in the product plan, return to different pages for story#32949. */ + if($copyStoryID and strpos($this->session->storyList, 'productplan') !== false) { $storyInfo = $this->story->getByList(array($storyID, $copyStoryID)); if($storyInfo[$storyID]->plan == $storyInfo[$copyStoryID]->plan or $storyInfo[$storyID]->product != $storyInfo[$copyStoryID]->product) $response['locate'] = $this->session->storyList;