* adjust for show pipeline in trash.

This commit is contained in:
wangyidong
2021-08-05 16:03:46 +08:00
parent 4ce49042d3
commit c4d0eabcf3
5 changed files with 28 additions and 6 deletions
+1
View File
@@ -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,';
+3 -1
View File
@@ -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();
+3 -1
View File
@@ -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();
+20 -3
View File
@@ -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;
}
+1 -1
View File
@@ -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;
}