From 8164c499f11c1a09f585d81b4e7b6a2a291e70ba Mon Sep 17 00:00:00 2001 From: dingguodong Date: Thu, 5 Aug 2021 10:50:17 +0800 Subject: [PATCH 1/4] * Fix bug when editing a pipeline with parameters. --- module/job/model.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/module/job/model.php b/module/job/model.php index 2d40eaba0d..3600f69ee0 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -203,6 +203,23 @@ class jobModel extends model ->add('editedDate', helper::now()) ->remove('repoType') ->get(); + + if($job->engine == 'jenkins') + { + $job->server = $job->jkServer; + $job->pipeline = $job->jkTask; + } + + if(strtolower($job->engine) == 'gitlab') + { + $repo = $this->loadModel('repo')->getRepoByID($job->repo); + $job->server = $repo->gitlab; + $job->pipeline = $repo->project; + } + + unset($job->jkServer); + unset($job->jkTask); + if($job->triggerType == 'schedule') $job->atDay = empty($_POST['atDay']) ? '' : join(',', $this->post->atDay); $job->svnDir = ''; From f2bcfa15a57750173317f43dff1f69490a8513b6 Mon Sep 17 00:00:00 2001 From: holan20180123 Date: Thu, 5 Aug 2021 10:52:27 +0800 Subject: [PATCH 2/4] * Adjust page style of gitlab browse. --- module/gitlab/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/gitlab/view/browse.html.php b/module/gitlab/view/browse.html.php index 31b054a9cf..3ddbdcdf5a 100644 --- a/module/gitlab/view/browse.html.php +++ b/module/gitlab/view/browse.html.php @@ -42,7 +42,7 @@ $gitlab): ?> - name;?> + name;?> url;?> Date: Thu, 5 Aug 2021 10:54:31 +0800 Subject: [PATCH 3/4] * Adjust the doc module link in drop menu. --- module/doc/model.php | 2 +- module/execution/model.php | 5 ++++- module/product/model.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/module/doc/model.php b/module/doc/model.php index 9ec28509f3..360c777d88 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2306,7 +2306,7 @@ EOT; if($libID == 0) $libID = key($libs); $this->lang->modulePageNav = $this->select($type, $objects, $objectID, $libs, $libID); - $this->app->rawMethod = $type; + if($this->app->openApp == 'doc') $this->app->rawMethod = $type; $object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch(); if(empty($object)) die(js::locate(helper::createLink($type, 'create'))); diff --git a/module/execution/model.php b/module/execution/model.php index c5301e4413..0e416d6bb5 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1300,7 +1300,10 @@ class executionModel extends model $link = helper::createLink($module, $method, "executionID=%s"); } - if($module == 'doc') $link = helper::createLink('doc', 'objectLibs', "type=execution&objectID=%s&from=execution"); + if($module == 'doc') + { + $link = helper::createLink('doc', $method, "type=execution&objectID=%s&from=execution"); + } return $link; } diff --git a/module/product/model.php b/module/product/model.php index fee25cb4c4..ef6dccf915 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -1785,7 +1785,7 @@ class productModel extends model } else if($module == 'doc') { - $link = helper::createLink('doc', 'objectLibs', "type=product&objectID=%s&from=product"); + $link = helper::createLink('doc', $method, "type=product&objectID=%s&from=product"); } elseif($module == 'design') { From e8c6079cd67080b5b890a60d74dd7caa49309b6a Mon Sep 17 00:00:00 2001 From: holan20180123 Date: Thu, 5 Aug 2021 10:55:25 +0800 Subject: [PATCH 4/4] * Hide product when permission is available in repo. --- module/repo/view/maintain.html.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/module/repo/view/maintain.html.php b/module/repo/view/maintain.html.php index 3faa6d9ea1..ff384ebb31 100644 --- a/module/repo/view/maintain.html.php +++ b/module/repo/view/maintain.html.php @@ -41,7 +41,11 @@ $productList = explode(',', str_replace(' ', '', $repo->product)); if(isset($productList) and $productList[0]) { - foreach($productList as $productID) echo ' ' . html::a($this->createLink('product', 'browse', "productID=$productID"), zget($products, $productID, $productID)); + foreach($productList as $productID) + { + if(!isset($products[$productID])) continue; + echo ' ' . html::a($this->createLink('product', 'browse', "productID=$productID"), zget($products, $productID, $productID)); + } } ?>