Merge branch 'devops_caoyanyi_47227' into 'devops19'
cyy:Finish task 47227. See merge request easycorp/zentaopms!1368
This commit is contained in:
@@ -134,6 +134,7 @@ $lang->action->objectTypes['kanbanregion'] = 'Kanban Region';
|
||||
$lang->action->objectTypes['kanbanlane'] = 'Kanban Lane';
|
||||
$lang->action->objectTypes['kanbancolumn'] = 'Kanban Column';
|
||||
$lang->action->objectTypes['kanbancard'] = 'Kanban Card';
|
||||
$lang->action->objectTypes['sonarqube'] = 'SonarQube Server';
|
||||
|
||||
/* Used to describe operation history. */
|
||||
$lang->action->desc = new stdclass();
|
||||
|
||||
@@ -134,6 +134,7 @@ $lang->action->objectTypes['kanbanregion'] = '看板区域';
|
||||
$lang->action->objectTypes['kanbanlane'] = '看板泳道';
|
||||
$lang->action->objectTypes['kanbancolumn'] = '看板列';
|
||||
$lang->action->objectTypes['kanbancard'] = '看板卡片';
|
||||
$lang->action->objectTypes['sonarqube'] = 'SonarQube服务器';
|
||||
|
||||
/* 用来描述操作历史记录。*/
|
||||
$lang->action->desc = new stdclass();
|
||||
|
||||
@@ -112,4 +112,26 @@ class sonarqube extends control
|
||||
{
|
||||
echo $this->fetch('job', 'exec', "jobID=$jobID");
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a sonarqube.
|
||||
*
|
||||
* @param int $sonarqubeID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($sonarqubeID, $confirm = 'no')
|
||||
{
|
||||
if($confirm != 'yes') die(js::confirm($this->lang->sonarqube->confirmDelete, inlink('delete', "id=$sonarqubeID&confirm=yes")));
|
||||
|
||||
$oldSonarQube = $this->sonarqube->getByID($sonarqubeID);
|
||||
$this->loadModel('action');
|
||||
$this->sonarqube->delete(TABLE_PIPELINE, $sonarqubeID);
|
||||
|
||||
$sonarQube = $this->sonarqube->getByID($sonarqubeID);
|
||||
$actionID = $this->action->create('sonarqube', $sonarqubeID, 'deleted');
|
||||
$changes = common::createChanges($oldSonarQube, $sonarQube);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
echo js::reload('parent');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ class sonarqubeModel extends model
|
||||
/**
|
||||
* Get sonarqube api base url and header by id.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $sonarqubeID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getApiBase($id)
|
||||
public function getApiBase($sonarqubeID)
|
||||
{
|
||||
$sonarqube = $this->loadModel('pipeline')->getByID($id);
|
||||
$sonarqube = $this->loadModel('pipeline')->getByID($sonarqubeID);
|
||||
if(!$sonarqube) return '';
|
||||
|
||||
$url = rtrim($sonarqube->url, '/') . '/api/%s';
|
||||
|
||||
Reference in New Issue
Block a user