This commit is contained in:
Guan Xiying
2021-06-22 17:28:12 +08:00
2 changed files with 5 additions and 7 deletions
+3 -3
View File
@@ -646,16 +646,16 @@ class gitlabModel extends model
}
/**
* Get account name in zentao sys.
* Get account in zentaopms.
*
* @param int $gitlabID
* @param int $userID
* @access public
* @return string|false
*/
public function getAccountName($gitlabID, $userID)
public function getAccount($gitlabID, $userID)
{
return $this->dao->select("account")
return $this->dao->select('account')
->from(TABLE_OAUTH)
->where('providerType')->eq('gitlab')
->andwhere('providerID')->eq($gitlabID)
+2 -4
View File
@@ -232,8 +232,7 @@ class repoModel extends model
if($this->post->SCM == 'Gitlab')
{
$this->loadModel("gitlab")->initLabels($this->post->gitlabHost, $this->post->gitlabProject);
$this->loadModel("gitlab")->createAssociat($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
$this->loadModel("gitlab")->saveRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
/* create webhook for zentao */
$this->loadModel("gitlab")->createWebhook($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
@@ -300,9 +299,8 @@ class repoModel extends model
$this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($id)->exec();
if($repo->SCM == 'Gitlab')
{
$this->loadModel("gitlab")->initLabels($this->post->gitlabHost, $this->post->gitlabProject);
$this->loadModel("gitlab")->createWebhook($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
$this->loadModel("gitlab")->saveRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject);
}
return false;