diff --git a/module/repo/control.php b/module/repo/control.php index c81caab5b1..130f006218 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -1118,17 +1118,18 @@ class repo extends control */ public function ajaxGetGitlabProjects($host, $token) { - $host = helper::safe64Decode($host); - $projects = $this->repo->getGitlabProjects($host, $token); - if(!$projects) return $this->send(array('message' => array())); - $projectIdList = $projectIdList ? explode(',', $projectIdList) : null; + $host = helper::safe64decode($host); + $projects = $this->repo->getgitlabprojects($host, $token); + + if(!$projects) $this->send(array('message' => array())); + $options = ""; foreach($projects as $project) { - if(!empty($projectIdList) and $project and !in_array($project->id, $projectIdList)) continue; - $options .= ""; + $options .= ""; } die($options); + } /** diff --git a/module/repo/js/create.js b/module/repo/js/create.js index 0af0d52404..c78d5fd862 100644 --- a/module/repo/js/create.js +++ b/module/repo/js/create.js @@ -6,7 +6,7 @@ $(function() $form = $(this).closest('form'); $form.css('min-height', $form.height()); }) - + $('#gitlabHost, #gitlabToken').change(function() { host = Base64.encode($('#gitlabHost').val()); @@ -20,13 +20,13 @@ $(function() $('#gitlabProject').chosen().trigger("chosen:updated");; }); }); - + $('#gitlabProject').change(function() { $option = $(this).find('option:selected'); $('#name').val($option.data('name')); }); - + }); function scmChanged(scm) @@ -37,7 +37,7 @@ function scmChanged(scm) $('.tips-git').removeClass('hidden'); $('.tips-svn').addClass('hidden'); - } + } else { $('.account-fields').removeClass('hidden'); diff --git a/module/repo/model.php b/module/repo/model.php index e2c757409a..4678b98dec 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -235,9 +235,6 @@ class repoModel extends model if($this->post->SCM == 'Gitlab') { $this->gitlab->saveProjectRelation($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject); - - /* create webhook for zentao */ - $this->gitlab->initWebhooks($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject); } return $repoID; } @@ -301,7 +298,6 @@ class repoModel extends model { $this->dao->delete()->from(TABLE_REPOHISTORY)->where('repo')->eq($id)->exec(); $this->dao->delete()->from(TABLE_REPOFILES)->where('repo')->eq($id)->exec(); - if($repo->SCM == 'Gitlab') $this->gitlab->initWebhooks($this->post->product, $this->post->gitlabHost, $this->post->gitlabProject); return false; } diff --git a/module/repo/view/maintain.html.php b/module/repo/view/maintain.html.php index cd358fb3ce..78de7a5120 100644 --- a/module/repo/view/maintain.html.php +++ b/module/repo/view/maintain.html.php @@ -49,7 +49,6 @@ id&objectID=$objectID", '', 'list', 'edit'); - if(strtolower($repo->SCM) == "gitlab") common::printIcon('gitlab', 'importIssue', "repo={$repo->id}", '', 'list', 'link'); // disable button instead of hiding it. if(common::hasPriv('repo', 'delete')) echo html::a($this->createLink('repo', 'delete', "repoID=$repo->id&objectID=$objectID"), '', 'hiddenwin', "title='{$lang->repo->delete}' class='btn'"); ?>