From c5cf0a831e020edcfb9654b55a57a5fa2eca1102 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 26 Mar 2024 15:12:09 +0800 Subject: [PATCH] * Fix bug #47294. --- module/execution/control.php | 2 +- module/execution/ui/linkstory.html.php | 4 ++-- module/product/ui/browse.html.php | 2 +- module/projectstory/control.php | 5 +++-- module/story/tao.php | 6 ++++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 66216ebdd5..97729909e5 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2266,7 +2266,7 @@ class execution extends control } /* Build the search form. */ - $actionURL = $this->createLink($this->app->rawModule, 'linkStory', "objectID=$objectID&browseType=bySearch&queryID=myQueryID&orderBy=$orderBy&recPerPage=$recPerPage&pageID=$pageID&storyType=$storyType"); + $actionURL = $this->createLink($this->app->rawModule, 'linkStory', "objectID=$objectID&browseType=bySearch&queryID=myQueryID&orderBy=$orderBy&recPerPage=$recPerPage&pageID=$pageID&extra=$extra&storyType=$storyType"); $branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products)); $queryID = ($browseType == 'bySearch') ? (int)$param : 0; $this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $object); diff --git a/module/execution/ui/linkstory.html.php b/module/execution/ui/linkstory.html.php index 26e3d9f3c6..a2526732bf 100644 --- a/module/execution/ui/linkstory.html.php +++ b/module/execution/ui/linkstory.html.php @@ -71,13 +71,13 @@ dtable set::cols($cols), set::data($allStories), set::orderBy($orderBy), - set::sortLink(createLink($objectType, 'linkStory', "objectID={$object->id}&browseType={$browseType}¶m={$param}&orderBy={name}_{sortType}")), + set::sortLink(createLink($objectType, 'linkStory', "objectID={$object->id}&browseType={$browseType}¶m={$param}&orderBy={name}_{sortType}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}&extra={$extra}&storyType={$storyType}")), set::checkable(true), set::onRenderCell(jsRaw('window.onRenderLinkStoryCell')), set::showToolbarOnChecked(false), set::footToolbar($footToolbar), set::footPager(usePager(array( - 'linkCreator' => helper::createLink($objectType, 'linkStory', "objectID={$object->id}&browseType={$browseType}¶m={$param}&orderBy=$orderBy&recPerPage={recPerPage}&page={page}&extra=$extra") . "#app={$app->tab}" + 'linkCreator' => helper::createLink($objectType, 'linkStory', "objectID={$object->id}&browseType={$browseType}¶m={$param}&orderBy=$orderBy&recPerPage={recPerPage}&page={page}&extra=$extra&storyType={$storyType}") . "#app={$app->tab}" ))) ); diff --git a/module/product/ui/browse.html.php b/module/product/ui/browse.html.php index a35d69c873..cd23463b7d 100644 --- a/module/product/ui/browse.html.php +++ b/module/product/ui/browse.html.php @@ -146,7 +146,7 @@ $fnBuildLinkStoryButton = function() use($lang, $app, $product, $projectHasProdu $canLinkStory = common::hasPriv('projectstory', 'linkStory'); $canlinkPlanStory = !empty($product) && common::hasPriv('projectstory', 'importPlanStories') && $storyType == 'story'; - $linkStoryUrl = $this->createLink('projectstory', 'linkStory', "project=$project->id&browseType=¶m=0&recTotal=0&recPerPage=50&pageID=1&storyType=$storyType"); + $linkStoryUrl = $this->createLink('projectstory', 'linkStory', "project=$project->id&browseType=¶m=0&orderBy=id_desc&recPerPage=50&pageID=1&extra=&storyType=$storyType"); $linkItem = array('text' => $lang->execution->linkStory, 'url' => $linkStoryUrl); $linkPlanItem = array('text' => $lang->execution->linkStoryByPlan, 'url' => '#linkStoryByPlan', 'data-toggle' => 'modal', 'data-size' => 'sm'); if($canLinkStory && $canlinkPlanStory) diff --git a/module/projectstory/control.php b/module/projectstory/control.php index 02d5f4f343..08cb484420 100644 --- a/module/projectstory/control.php +++ b/module/projectstory/control.php @@ -123,13 +123,14 @@ class projectStory extends control * @param string $orderBy * @param int $recPerPage * @param int $pageID + * @param string $extra * @param string $storyType * @access public * @return void */ - public function linkStory($projectID = 0, $browseType = '', $param = 0, $orderBy = 'id_desc', $recPerPage = 50, $pageID = 1, $storyType = 'story') + public function linkStory($projectID = 0, $browseType = '', $param = 0, $orderBy = 'id_desc', $recPerPage = 50, $pageID = 1, $extra = '', $storyType = 'story') { - echo $this->fetch('execution', 'linkStory', "projectID={$projectID}&browseType={$browseType}¶m={$param}&orderBy={$orderBy}&recPerPage={$recPerPage}&pageID={$pageID}&extra=&storyType=$storyType"); + echo $this->fetch('execution', 'linkStory', "projectID={$projectID}&browseType={$browseType}¶m={$param}&orderBy={$orderBy}&recPerPage={$recPerPage}&pageID={$pageID}&extra={$extra}&storyType=$storyType"); } /** diff --git a/module/story/tao.php b/module/story/tao.php index 10c9dd6054..a9b9cdaa2a 100644 --- a/module/story/tao.php +++ b/module/story/tao.php @@ -314,14 +314,16 @@ class storyTao extends storyModel /* Merge subdivided stories for requirement. */ if(empty($relationGroups[$story->id])) continue; - $story->parent = '-1'; + $story->parent = '-1'; + $story->children = array(); foreach($relationGroups[$story->id] as $SRID => $SRStory) { if(empty($SRStory)) continue; + if(!isset($projectIDList[$SRID])) continue; $children = clone $SRStory; $children->parent = $story->id; - $children->project = isset($projectIDList[$SRID]) ? $projectIDList[$SRID] : 0; + $children->project = $projectIDList[$SRID]; $story->children[$SRID] = $children; } $story->linkStories = implode(',', array_column($story->children, 'title'));