From 085811d8d4a14499aac36d821bc14abb71b6da53 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Tue, 6 Jul 2021 09:25:38 +0800 Subject: [PATCH] * Fix bug #13495. --- module/execution/control.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index dacd3fe109..23996478a0 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -673,6 +673,7 @@ class execution extends control $type = strtolower($type); $param = $param; $productID = 0; + $branchID = 0; setcookie('storyPreExecutionID', $executionID, $this->config->cookieLife, $this->config->webRoot, '', false, true); if($this->cookie->storyPreExecutionID != $executionID) { @@ -728,11 +729,20 @@ class execution extends control $execution = $this->commonAction($executionID); $executionID = $execution->id; + if($this->cookie->storyModuleParam) $this->view->module = $this->loadModel('tree')->getById($this->cookie->storyModuleParam); + if($this->cookie->storyProductParam) $this->view->product = $this->loadModel('product')->getById($this->cookie->storyProductParam); + if($this->cookie->storyBranchParam) + { + $branchID = $this->cookie->storyBranchParam; + if(strpos($branchID, ',') !== false) list($productID, $branchID) = explode(',', $branchID); + $this->view->branch = $this->loadModel('branch')->getById($branchID, $productID); + } + /* Load pager. */ $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); - $stories = $this->story->getExecutionStories($executionID, 0, 0, $sort, $type, $param, 'story', '', $pager); + $stories = $this->story->getExecutionStories($executionID, 0, $branchID, $sort, $type, $param, 'story', '', $pager); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false); $users = $this->user->getPairs('noletter'); @@ -772,15 +782,6 @@ class execution extends control foreach($plans as $plan) $allPlans += $plan; } - if($this->cookie->storyModuleParam) $this->view->module = $this->loadModel('tree')->getById($this->cookie->storyModuleParam); - if($this->cookie->storyProductParam) $this->view->product = $this->loadModel('product')->getById($this->cookie->storyProductParam); - if($this->cookie->storyBranchParam) - { - $branchID = $this->cookie->storyBranchParam; - if(strpos($branchID, ',') !== false) list($productID, $branchID) = explode(',', $branchID); - $this->view->branch = $this->loadModel('branch')->getById($branchID, $productID); - } - /* Get execution's product. */ $productPairs = $this->loadModel('product')->getProductPairsByProject($executionID);