diff --git a/module/action/config.php b/module/action/config.php index 8319fefa2a..568e426ba1 100755 --- a/module/action/config.php +++ b/module/action/config.php @@ -46,3 +46,4 @@ $config->action->majorList['execution'] = array('opened', 'edited'); $config->action->needGetProjectType = 'build,task,bug,case,testcase,caselib,testtask,testsuite,testreport,doc,issue,release,risk,design,opportunity,trainplan,gapanalysis,researchplan,researchreport,'; $config->action->needGetRelateField = ',story,productplan,release,task,build,bug,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,'; +$config->action->noLinkModules = ',doclib,module,webhook,gitlab,pipeline,jenkins,'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 6c13ef31b2..8ad8254d42 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -103,7 +103,9 @@ $lang->action->objectTypes['entry'] = 'Entry'; $lang->action->objectTypes['webhook'] = 'Webhook'; $lang->action->objectTypes['team'] = 'Team'; $lang->action->objectTypes['whitelist'] = 'Whitelist'; -$lang->action->objectTypes['pipeline'] = 'GitLib'; +$lang->action->objectTypes['pipeline'] = 'GitLab'; +$lang->action->objectTypes['gitlab'] = 'GitLab'; +$lang->action->objectTypes['jenkins'] = 'Jenkins'; /* Used to describe operation history. */ $lang->action->desc = new stdclass(); diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 668e3db99d..ff168d25af 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -103,7 +103,9 @@ $lang->action->objectTypes['entry'] = '应用'; $lang->action->objectTypes['webhook'] = 'Webhook'; $lang->action->objectTypes['team'] = '团队'; $lang->action->objectTypes['whitelist'] = '白名单'; -$lang->action->objectTypes['pipeline'] = 'GitLib'; +$lang->action->objectTypes['pipeline'] = 'GitLab'; +$lang->action->objectTypes['gitlab'] = 'GitLab'; +$lang->action->objectTypes['jenkins'] = 'Jenkins'; /* 用来描述操作历史记录。*/ $lang->action->desc = new stdclass(); diff --git a/module/action/model.php b/module/action/model.php index 7d37907654..e735fcfb39 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -569,12 +569,29 @@ class actionModel extends model $objectIds = array_unique($objectIds); $table = $this->config->objectTables[$objectType]; $field = $this->config->action->objectNameFields[$objectType]; - - $objectNames[$objectType] = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->fetchPairs(); + if($objectType == 'pipeline') + { + $objectNames['jenkins'] = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->andWhere('type')->eq('jenkins')->fetchPairs(); + $objectNames['gitlab'] = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->andWhere('type')->eq('gitlab')->fetchPairs(); + } + else + { + $objectNames[$objectType] = $this->dao->select("id, $field AS name")->from($table)->where('id')->in($objectIds)->fetchPairs(); + } } /* Add name field to the trashes. */ - foreach($trashes as $trash) $trash->objectName = isset($objectNames[$trash->objectType][$trash->objectID]) ? $objectNames[$trash->objectType][$trash->objectID] : ''; + foreach($trashes as $trash) + { + $objectType = $trash->objectType; + if($objectType == 'pipeline') + { + if(isset($objectNames['gitlab'][$trash->objectID])) $objectType = 'gitlab'; + if(isset($objectNames['jenkins'][$trash->objectID])) $objectType = 'jenkins'; + $trash->objectType = $objectType; + } + $trash->objectName = isset($objectNames[$objectType][$trash->objectID]) ? $objectNames[$objectType][$trash->objectID] : ''; + } return $trashes; } diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php index 1e0f21625f..bb1a8d656d 100755 --- a/module/action/view/trash.html.php +++ b/module/action/view/trash.html.php @@ -62,7 +62,7 @@ $flow = $config->action->customFlows[$action->objectType]; $module = $flow->module; } - if(strpos(',doclib,module,webhook,', ",{$module},") !== false) + if(strpos($this->config->action->noLinkModules, ",{$module},") !== false) { echo $action->objectName; } diff --git a/module/gitlab/view/importissue.html.php b/module/gitlab/view/importissue.html.php index dfb478ea02..7411bd12a6 100644 --- a/module/gitlab/view/importissue.html.php +++ b/module/gitlab/view/importissue.html.php @@ -14,6 +14,11 @@