diff --git a/module/gitlab/model.php b/module/gitlab/model.php index d458546e7a..afd50000f2 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -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) diff --git a/module/repo/model.php b/module/repo/model.php index 639e67d651..9d4bfb0eb5 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -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;