From c71f23239181b9181853e0414367f350d569bb76 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Fri, 2 Apr 2021 10:32:17 +0300 Subject: [PATCH] * Fix bug. --- module/build/control.php | 5 +++-- module/execution/control.php | 19 ++++++++++--------- module/execution/view/story.html.php | 15 +++++++-------- module/story/control.php | 6 ++---- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/module/build/control.php b/module/build/control.php index 8a253f992d..5885571c91 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -215,8 +215,9 @@ class build extends control ->beginIF($type == 'story')->orderBy($orderBy)->fi() ->page($storyPager) ->fetchAll('id'); - $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage'); - foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage; + + $stages = $this->dao->select('*')->from(TABLE_STORYSTAGE)->where('story')->in($build->stories)->andWhere('branch')->eq($build->branch)->fetchPairs('story', 'stage'); + foreach($stages as $storyID => $stage) $stories[$storyID]->stage = $stage; /* Set menu. */ if($this->app->openApp == 'project') diff --git a/module/execution/control.php b/module/execution/control.php index c8e82606cb..f4d61dad70 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -676,7 +676,8 @@ class execution extends control $this->loadModel('user'); $this->app->loadLang('testcase'); - $type = strtolower($type); + $type = strtolower($type); + $param = (int)$param; setcookie('storyPreExecutionID', $executionID, $this->config->cookieLife, $this->config->webRoot, '', false, true); if($this->cookie->storyPreExecutionID != $executionID) { @@ -687,20 +688,20 @@ class execution extends control } if($type == 'bymodule') { - $_COOKIE['storyModuleParam'] = (int)$param; + $_COOKIE['storyModuleParam'] = $param; $_COOKIE['storyProductParam'] = 0; $_COOKIE['storyBranchParam'] = 0; - setcookie('storyModuleParam', (int)$param, 0, $this->config->webRoot, '', false, true); + setcookie('storyModuleParam', $param, 0, $this->config->webRoot, '', false, true); setcookie('storyProductParam', 0, 0, $this->config->webRoot, '', false, true); setcookie('storyBranchParam', 0, 0, $this->config->webRoot, '', false, true); } elseif($type == 'byproduct') { $_COOKIE['storyModuleParam'] = 0; - $_COOKIE['storyProductParam'] = (int)$param; + $_COOKIE['storyProductParam'] = $param; $_COOKIE['storyBranchParam'] = 0; setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, true); - setcookie('storyProductParam', (int)$param, 0, $this->config->webRoot, '', false, true); + setcookie('storyProductParam', $param, 0, $this->config->webRoot, '', false, true); setcookie('storyBranchParam', 0, 0, $this->config->webRoot, '', false, true); } elseif($type == 'bybranch') @@ -727,7 +728,7 @@ class execution extends control /* Append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); - $queryID = ($type == 'bysearch') ? (int)$param : 0; + $queryID = ($type == 'bysearch') ? $param : 0; $execution = $this->commonAction($executionID); $executionID = $execution->id; @@ -738,10 +739,10 @@ class execution extends control $stories = $this->story->getExecutionStories($executionID, 0, 0, $sort, $type, $param, 'story', '', $pager); $this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false); - $users = $this->user->getPairs('noletter'); + $users = $this->user->getPairs('noletter'); /* Build the search form. */ - $modules = array(); + $modules = array(); $executionModules = $this->loadModel('tree')->getTaskTreeModules($executionID, true); $products = $this->execution->getProducts($executionID); foreach($products as $product) @@ -802,7 +803,7 @@ class execution extends control $this->view->type = $this->session->executionStoryBrowseType; $this->view->param = $param; $this->view->moduleTree = $this->loadModel('tree')->getProjectStoryTreeMenu($executionID, $startModuleID = 0, array('treeModel', 'createStoryLink')); - $this->view->modulePairs = $this->tree->getModulePairs($productID, 'story', true); + $this->view->modulePairs = $this->tree->getModulePairs(0, 'story', true); $this->view->tabID = 'story'; $this->view->storyTasks = $storyTasks; $this->view->storyBugs = $storyBugs; diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 476d20d06f..153ea07f4e 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -120,14 +120,13 @@ id}&orderBy=%s&type=$type¶m=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?> diff --git a/module/story/control.php b/module/story/control.php index 909181391e..fb5e7e3306 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -864,6 +864,8 @@ class story extends control /* Set the menu. */ $from = $this->app->openApp; + $this->product->setMenu($story->product, $story->branch); + if($from == 'execution') { $this->execution->setMenu($param); @@ -872,10 +874,6 @@ class story extends control { $this->loadModel('project')->setMenu($param); } - elseif($from == 'product') - { - $this->product->setMenu($story->product, $story->branch); - } elseif($from == 'qa') { $products = $this->product->getProductPairsByProject(0, 'noclosed');