From ef857cfb496a8648905e2a0212b734665d4820b6 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 1 Nov 2023 09:26:04 +0800 Subject: [PATCH] * Fix bug #39993. --- module/common/lang/menu.php | 2 +- module/execution/model.php | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 458b5e1a48..4cc0806ea2 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -352,7 +352,7 @@ if($config->edition != 'open') $lang->execution->menu->view = array('link' => "$ $lang->execution->menu->storyGroup = array('link' => "{$lang->common->story}|execution|story|executionID=%s",'class' => 'dropdown dropdown-hover', 'subModule' => 'story', 'alias' => 'batchcreate,storykanban'); $lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'storykanban,linkstory'); $lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|bug|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport'); -$lang->execution->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo,mr', 'alias' => 'create'); +$lang->execution->menu->devops = array('link' => "{$lang->devops->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo,mr', 'alias' => 'create'); $lang->execution->menu->doc = array('link' => "{$lang->doc->common}|execution|doc|objectID=%s", 'subModule' => 'doc'); $lang->execution->menu->build = array('link' => "{$lang->build->common}|execution|build|executionID=%s", 'subModule' => 'build'); $lang->execution->menu->action = array('link' => "$lang->dynamic|execution|dynamic|executionID=%s"); diff --git a/module/execution/model.php b/module/execution/model.php index 2f95610f47..9b0961acf4 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -171,8 +171,15 @@ class executionModel extends model preg_match('/^\[(\w+)\]/', $repoName, $matches); if(isset($matches[1]) && in_array($matches[1], $this->config->repo->gitServiceList)) $showMR = true; } - if(!$showMR) unset($this->lang->execution->menu->devops['subMenu']->mr); - if(!$showMR && $this->config->edition == 'open') unset($this->lang->execution->menu->devops['subMenu']); + if(!$showMR && $this->config->edition == 'open') + { + unset($this->lang->execution->menu->devops['subMenu']->mr); + if($this->config->edition == 'open' || !common::hasPriv('repo', 'review')) + { + unset($this->lang->execution->menu->devops['subMenu']); + $this->lang->execution->menu->devops['link'] = str_replace($this->lang->devops->common, $this->lang->repo->common, $this->lang->execution->menu->devops['link']); + } + } } if($this->cookie->executionMode == 'noclosed' and $execution and ($execution->status == 'done' or $execution->status == 'closed')) @@ -2666,9 +2673,9 @@ class executionModel extends model } /** - * Get execution by build id. - * - * @param int $buildID + * Get execution by build id. + * + * @param int $buildID * @access public * @return object */