diff --git a/db/standard/zentao15.0.rc3.sql b/db/standard/zentao15.0.rc3.sql index 68b0271093..d59660d05a 100644 --- a/db/standard/zentao15.0.rc3.sql +++ b/db/standard/zentao15.0.rc3.sql @@ -447,7 +447,7 @@ CREATE TABLE `zt_history` ( PRIMARY KEY (`id`), KEY `action` (`action`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE `zt_pipeline` ( +CREATE TABLE `zt_jenkins` ( `id` smallint(8) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `url` varchar(255) DEFAULT NULL, diff --git a/module/repo/model.php b/module/repo/model.php index b9609b7fe5..f7ac6b78e9 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -181,6 +181,7 @@ class repoModel extends model if($repo->encrypt == 'base64') $repo->password = base64_decode($repo->password); $repo->acl = json_decode($repo->acl); if($type == 'haspriv' and !$this->checkPriv($repo)) unset($repos[$i]); + if(strtolower($repo->SCM) == 'gitlab') $repo = $this->processGitlab($repo); } return $repos; @@ -613,6 +614,7 @@ class repoModel extends model { $repo = $this->getRepoByID($repoID); if(empty($repo)) return array(); + return $this->dao->select('id,name')->from(TABLE_PRODUCT) ->where('id')->in($repo->product) ->andWhere('deleted')->eq(0) @@ -1786,10 +1788,11 @@ class repoModel extends model */ public function processGitlab($repo) { - $gitlab = $this->loadModel('gitlab')->getByID($repo->client); // The $repo->client is gitlabID + $gitlab = $this->loadModel('gitlab')->getByID($repo->client); // The $repo->client is gitlabID. if(!$gitlab) return $repo; + $repo->gitlab = $gitlab->id; - $repo->project = $repo->path; // The projectID in gitlab + $repo->project = $repo->path; // The projectID in gitlab. $repo->path = sprintf($this->config->repo->gitlab->apiPath, $gitlab->url, $repo->path); $repo->client = $gitlab->url; $repo->password = $gitlab->token;