From c49fdeed8fb29da8a3b4944166a2bcbb776a94c2 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 14 Jan 2025 10:00:55 +0800 Subject: [PATCH] * [bug#59214] adjust bug view page actions for devops. --- module/bug/control.php | 4 +++- module/bug/zen.php | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/module/bug/control.php b/module/bug/control.php index ba7f604ce0..9917bc8d82 100755 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -196,17 +196,19 @@ class bug extends control $branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product); $projects = $this->product->getProjectPairsByProduct($bug->product, (string)$bug->branch); $projectID = isset($projects[$bug->project]) ? $bug->project : key($projects); + if(in_array($this->app->tab, array('project', 'execution'))) { $objectType = $this->app->tab == 'project' ? 'projectID' : 'executionID'; $this->view->{$objectType} = $this->session->{$this->app->tab}; } + if($this->app->tab == 'devops') $this->bugZen->processRepoIssueActions((int)$bug->repo); + $this->session->set('project', $projectID, 'project'); $this->session->set('storyList', '', 'product'); $this->session->set('projectList', $this->app->getURI(true) . "#app={$this->app->tab}", 'project'); - if($this->app->tab == 'devops') $this->view->repoID = $bug->repo; $this->view->title = "BUG #$bug->id $bug->title - " . $product->name; $this->view->branchID = $bug->branch; $this->view->product = $product; diff --git a/module/bug/zen.php b/module/bug/zen.php index 3a8526c4bb..9c5079b3cd 100644 --- a/module/bug/zen.php +++ b/module/bug/zen.php @@ -2425,4 +2425,19 @@ class bugZen extends bug return $chartOption; } + + /** + * 处理代码问题页面的操作。 + * Process the code issue actions. + * + * @param int $repoID + * @access protected + * @return void + */ + protected function processRepoIssueActions(int $repoID) + { + $this->view->repoID = $repoID; + $this->config->bug->actions->view['mainActions'] = array('confirm', 'assignTo', 'resolve', 'close', 'activate'); + $this->config->bug->actions->view['suffixActions'] = array('delete'); + } }