This commit is contained in:
hufangzhou
2021-08-05 16:10:59 +08:00
7 changed files with 38 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;
}
+5
View File
@@ -14,6 +14,11 @@
<div id="mainContent" class="main-content">
<div class="main-header">
<h2><?php echo $lang->gitlab->importIssue;?></h2>
<?php if(!isonlybody() and empty($importable)):?>
<div class='pull-right'>
<?php echo html::linkButton($lang->goback, $this->createLink('repo', 'maintain'), 'self', '', 'btn btn-primary');?>
</div>
<?php endif;?>
</div>
<?php if($importable):?>
<form method='post' class='load-indicator main-form form-ajax' enctype='multipart/form-data'>
+5
View File
@@ -1,5 +1,10 @@
$(document).ready(function()
{
$('#gitlabRepo').change(function()
{
$('#repo').val($(this).val()).change();
})
$('#repo').change(function()
{
var repoID = $(this).val();