From a7b349727787d88258e5c212004ae7a70fdfbc86 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Tue, 23 Jan 2024 14:47:16 +0800 Subject: [PATCH] * Fix default lane error. bug #44682. --- module/bug/zen.php | 18 +++++++++++++----- module/execution/js/kanban.ui.js | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/module/bug/zen.php b/module/bug/zen.php index c2147cc5af..4aca307b33 100644 --- a/module/bug/zen.php +++ b/module/bug/zen.php @@ -951,7 +951,8 @@ class bugZen extends bug $linkedProducts = $this->product->getProducts($executionID); foreach($linkedProducts as $product) $products[$product->id] = $product->name; - $projectID = $bug->execution->project; + $execution = $this->loadModel('execution')->getByID($executionID); + $projectID = $execution->project; $this->loadModel('execution')->setMenu($executionID); } @@ -1001,7 +1002,7 @@ class bugZen extends bug $productID = (int)$bug->productID; $branch = (string)$bug->branch; $moduleID = (int)$bug->moduleID; - $modules = $this->tree->getOptionMenu($bug->productID, 'bug', 0, ($bug->branch === 'all' || !isset($bug->branches[$bug->branch])) ? 'all' : $bug->branch); + $modules = $this->tree->getOptionMenu($productID, 'bug', 0, ($branch === 'all' || !isset($bug->branches[$branch])) ? 'all' : $branch); $moduleID = isset($modules[$moduleID]) ? $moduleID : ''; return $this->updateBug($bug, array('modules' => $modules, 'moduleID' => $moduleID)); @@ -1199,7 +1200,7 @@ class bugZen extends bug $this->view->bug = $bug; $this->view->allBuilds = !empty($bug->allBuilds) ? $bug->allBuilds : ''; $this->view->allUsers = !empty($bug->allUsers) ? $bug->allUsers : ''; - $this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds((int)$bug->productID, $bug->branch); + $this->view->releasedBuilds = $this->loadModel('release')->getReleasedBuilds((int)$bug->productID, (string)$bug->branch); $this->view->resultFiles = !empty($resultID) && !empty($stepIdList) ? $this->loadModel('file')->getByObject('stepResult', (int)$resultID, str_replace('_', ',', $stepIdList)) : array(); $this->view->contactList = $this->loadModel('user')->getContactLists(); $this->view->branchID = $bug->branch != 'all' ? $bug->branch : '0'; @@ -1464,8 +1465,15 @@ class bugZen extends bug { $regionPairs = $this->loadModel('kanban')->getRegionPairs($execution->id, 0, 'execution'); $regionID = !empty($output['regionID']) ? $output['regionID'] : key($regionPairs); - $lanePairs = $this->kanban->getLanePairsByRegion((int)$regionID, 'bug'); - $laneID = !empty($output['laneID']) ? $output['laneID'] : key($lanePairs); + + if(!empty($output['groupID'])) + { + $lanePairs = $this->kanban->getLanePairsByGroup((int)$output['groupID']); + $laneID = !empty($output['laneID']) ? $output['laneID'] : key($lanePairs); + } + + $lanePairs = $this->kanban->getLanePairsByRegion((int)$regionID, 'bug'); + if(empty($laneID)) $laneID = !empty($output['laneID']) ? $output['laneID'] : key($lanePairs); $this->view->executionType = $execution->type; $this->view->regionID = $regionID; diff --git a/module/execution/js/kanban.ui.js b/module/execution/js/kanban.ui.js index 79e4432643..04032cea01 100644 --- a/module/execution/js/kanban.ui.js +++ b/module/execution/js/kanban.ui.js @@ -118,7 +118,7 @@ window.buildColCardActions = function(col) } else if(col.type == 'unconfirmed') { - if(priv.canCreateBug) actions.push({text: bugLang.create, url: $.createLink('bug', 'create', 'productID=' + productID + '&moduleID=0&extra=regionID=' + col.region + ',laneID=' + 0 + ',columnID=' + col.id + ',executionID=' + executionID), 'data-toggle': 'modal', 'data-size' : 'lg'}); + if(priv.canCreateBug) actions.push({text: bugLang.create, url: $.createLink('bug', 'create', 'productID=' + productID + '&moduleID=0&extra=regionID=' + col.region + ',groupID=' + col.group + ',laneID=' + 0 + ',columnID=' + col.id + ',executionID=' + executionID), 'data-toggle': 'modal', 'data-size' : 'lg'}); if(priv.canBatchCreateBug) actions.push({text: bugLang.batchCreate, url: productCount > 1 ? '#batchCreateBug' : $.createLink('bug', 'batchcreate', 'productID=' + productID + '&branch=all&executionID=' + executionID + '&module=0&extra=regionID=' + col.region + ',laneID=' + 0 + ',columnID=' + col.id), 'data-toggle': 'modal', 'data-size': 'lg'}); } else if(col.type == 'wait')