From faff0f97858321f7a61882e7b9db51bbd763072c Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 1 Nov 2023 15:30:02 +0800 Subject: [PATCH] * Adjust 1.5 navbar param. --- module/execution/model.php | 2 +- module/mr/control.php | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 75f2095320..f5d2835764 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -161,7 +161,7 @@ class executionModel extends model $moduleName = $this->app->getModuleName(); $methodName = $this->app->getMethodName(); - if($moduleName == 'repo' && $moduleName == 'mr') + if($moduleName == 'repo' || $moduleName == 'mr') { $repoPairs = $this->loadModel('repo')->getRepoPairs('execution', $executionID); diff --git a/module/mr/control.php b/module/mr/control.php index 8f7de80d33..e719dd6ff8 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -12,9 +12,16 @@ class mr extends control /* This is essential when changing tab(menu) from gitlab to repo. */ /* Optional: common::setMenuVars('devops', $this->session->repoID); */ - if($this->app->getMethodName() != 'browse') $this->loadModel('ci')->setMenu(); - $this->view->objectID = $this->app->tab == 'execution' ? $this->session->execution : 0; - if($this->app->tab == 'execution') $this->view->executionID = $this->session->execution; + if($this->app->getMethodName() != 'browse') + { + $this->loadModel('ci')->setMenu(); + $this->view->objectID = $this->app->tab == 'execution' ? $this->session->execution : 0; + if($this->app->tab == 'execution') + { + $this->view->executionID = $this->session->execution; + $this->loadModel('execution')->setMenu($this->session->execution); + } + } } /** @@ -33,6 +40,16 @@ class mr extends control */ public function browse($repoID = 0, $mode = 'status', $param = 'opened', $objectID = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { + if($this->app->tab == 'execution') + { + $this->session->set('execution', $objectID); + $execution = $this->loadModel('execution')->getByID($objectID); + $features = $this->execution->getExecutionFeatures($execution); + if(!$features['devops']) return print($this->locate($this->createLink('execution', 'task', "objectID=$executionID"))); + + $this->loadModel('execution')->setMenu($objectID); + } + /* Save current URI to session. */ $this->session->set('mrList', $this->app->getURI(true), 'repo');