From 035a221e71deeffd3eb49e0cda9f9fe68b21cf91 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Fri, 17 May 2024 13:40:47 +0800 Subject: [PATCH] * Fix bug #49712. --- module/execution/control.php | 2 +- module/execution/model.php | 4 +++- module/execution/ui/story.html.php | 2 +- module/execution/zen.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 31c48e3bcc..f2f9b7fdf4 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2296,7 +2296,7 @@ class execution extends control $this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $object); $project = (strpos('sprint,stage,kanban', $object->type) !== false) ? $this->loadModel('project')->getByID($object->project) : $object; - $storyType = (($object->type == 'stage' && in_array($object->attribute, array('mix', 'request', 'design')) || $object->type == 'project')) ? $project->storyType : 'story'; + $storyType = (($object->type == 'stage' && in_array($object->attribute, array('mix', 'request', 'design'))) || $object->type == 'project' || !$object->multiple) ? $project->storyType : 'story'; if($browseType == 'bySearch') $allStories = $this->story->getBySearch('all', '', $queryID, $orderBy, $objectID, $storyType); if($browseType != 'bySearch') $allStories = $this->story->getProductStories(implode(',', array_keys($products)), $branchIDList, '0', 'active', $storyType, $orderBy, false, '', null); diff --git a/module/execution/model.php b/module/execution/model.php index 0e95104272..4c5d20b689 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2864,7 +2864,7 @@ class executionModel extends model $story = zget($storyList, $storyID, ''); if(empty($story)) continue; if(strpos($project->storyType, "$story->type") === false) continue; - if($execution->type != 'project' && !($execution->type == 'stage' && in_array($execution->attribute, array('mix', 'request', 'design'))) && $story->type != 'story') continue; + if($execution->type != 'project' && !($execution->type == 'stage' && in_array($execution->attribute, array('mix', 'request', 'design'))) && $story->type != 'story' && $execution->multiple) continue; if(!empty($lanes[$storyID])) $laneID = $lanes[$storyID]; $columnID = $this->kanban->getColumnIDByLaneID((int)$laneID, 'backlog'); @@ -4888,6 +4888,7 @@ class executionModel extends model $executionData->project = $projectID; $executionData->name = $project->name; $executionData->grade = 1; + $executionData->storyType = $project->storyType; $executionData->begin = $project->begin; $executionData->end = $project->end; $executionData->status = 'wait'; @@ -4947,6 +4948,7 @@ class executionModel extends model $postData = new stdclass(); $postData->project = $projectID; $postData->name = $project->name; + $postData->storyType = $project->storyType; $postData->begin = $project->begin; $postData->end = $project->end; $postData->realBegan = $project->realBegan ? $project->realBegan : null; diff --git a/module/execution/ui/story.html.php b/module/execution/ui/story.html.php index 15b85d2104..88fe3ba45f 100644 --- a/module/execution/ui/story.html.php +++ b/module/execution/ui/story.html.php @@ -112,7 +112,7 @@ if(commonModel::isTutorialMode()) if($canOpreate['create']) $createItem[] = array('text' => $lang->story->create, 'url' => $createLink); if($canOpreate['batchCreate']) $createItem[] = array('text' => $lang->story->batchCreate . $lang->SRCommon, 'url' => $batchCreateLink); -if(in_array($execution->attribute, array('mix', 'request', 'design'))) +if(in_array($execution->attribute, array('mix', 'request', 'design')) || !$execution->multiple) { if($canOpreate['createEpic']) $createItem[] = array('text' => $lang->epic->create, 'url' => $createEpicLink); if($canOpreate['batchCreateEpic']) $createItem[] = array('text' => $lang->epic->batchCreate . $lang->ERCommon, 'url' => $batchCreateEpicLink); diff --git a/module/execution/zen.php b/module/execution/zen.php index 2a669e57f7..3fa1c56b1e 100644 --- a/module/execution/zen.php +++ b/module/execution/zen.php @@ -258,7 +258,7 @@ class executionZen extends execution } $project = $this->loadModel('project')->fetchByID($execution->project); - if(!($execution->type == 'stage' && in_array($execution->attribute, array('mix', 'request', 'design')))) $project->storyType = 'story'; + if(!($execution->type == 'stage' && in_array($execution->attribute, array('mix', 'request', 'design'))) && $project->multiple) $project->storyType = 'story'; $productPairs = $this->loadModel('product')->getProductPairsByProject($execution->id); // Get execution's product. if(empty($productID)) $productID = (int)key($productPairs);