From cdeb1c7e4cd6dcb9af1f66ebdf82a0761598260d Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 17 Mar 2023 07:07:40 +0000 Subject: [PATCH] * Finish task #86286. --- module/story/control.php | 20 +++++++++++++++----- module/tree/model.php | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/module/story/control.php b/module/story/control.php index e98a0e4ed9..9cca629934 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -1386,16 +1386,27 @@ class story extends control */ public function view($storyID, $version = 0, $param = 0, $storyType = 'story') { - $uri = $this->app->getURI(true); - $tab = $this->app->tab; + $uri = $this->app->getURI(true); + $tab = $this->app->tab; + $storyID = (int)$storyID; + $story = $this->story->getById($storyID, $version, true); + $product = $this->product->getByID($story->product); + if($tab == 'product' and !empty($product->shadow)) + { + $backLink = $this->session->productList ? $this->session->productList : inlink('product', 'all'); + $viewLink = $this->createLink('story', 'view', "storyID=$storyID&version=$version¶m=$param&storyType=$storyType") . '#app=project'; + $js = js::start(); + $js .= "setTimeout(\"parent.$.apps.open('$uri#app=project')\", 100)"; + $js .= js::end(); + return print(js::refresh($backLink . '#app=product', 'self', '10') . $js); + } + $buildApp = $tab == 'product' ? 'project' : $tab; $releaseApp = $tab == 'execution' ? 'product' : $tab; $this->session->set('productList', $uri . "#app={$tab}", 'product'); if(!isonlybody()) $this->session->set('buildList', $uri, $buildApp); $this->app->loadLang('bug'); - $storyID = (int)$storyID; - $story = $this->story->getById($storyID, $version, true); $linkModuleName = $this->config->vision == 'lite' ? 'project' : 'product'; if(!$story) return print(js::error($this->lang->notFound) . js::locate($this->createLink($linkModuleName, 'index'))); @@ -1407,7 +1418,6 @@ class story extends control $this->story->replaceURLang($story->type); - $product = $this->product->getByID($story->product); $plan = $this->dao->findById($story->plan)->from(TABLE_PRODUCTPLAN)->fetch('title'); $bugs = $this->dao->select('id,title,status,pri,severity')->from(TABLE_BUG)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->fetchAll(); $fromBug = $this->dao->select('id,title')->from(TABLE_BUG)->where('id')->eq($story->fromBug)->fetch(); diff --git a/module/tree/model.php b/module/tree/model.php index 23662f0bf8..966a38da52 100644 --- a/module/tree/model.php +++ b/module/tree/model.php @@ -139,7 +139,7 @@ class treeModel extends model */ public function getOptionMenu($rootID, $type = 'story', $startModule = 0, $branch = 0, $param = 'nodeleted', $grade = 'all') { - if(empty($branch)) $branch = 0; + if(empty($branch) and !is_array($branch)) $branch = 0; if(defined('TUTORIAL')) { $modulePairs = $this->loadModel('tutorial')->getModulePairs();