+
-
diff --git a/module/bug/js/create.js b/module/bug/js/create.js index 831178a860..4b6ae0acc5 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -178,13 +178,13 @@ $(document).ready(function() projects = ''; $.each(gitlabProjects[host], function(id, obj){projects = projects + ',' + obj.gitlabProject}); url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host + "&projects=" + projects); - + $.get(url, function(response) { $('#gitlabProject').html('').append(response); - $('#gitlabProject').chosen().trigger("chosen:updated");; + $('#gitlabProject').chosen().trigger("chosen:updated"); }); }); - + }); diff --git a/module/common/lang/common.php b/module/common/lang/common.php index 20e9eebdcf..c165aa44c8 100644 --- a/module/common/lang/common.php +++ b/module/common/lang/common.php @@ -151,4 +151,4 @@ $lang->icons['unlock'] = 'unlock-alt'; $lang->icons['confirmStoryChange'] = 'search'; $lang->icons['score'] = 'tint'; -$lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry', 'jenkins','gitlab'); +$lang->noMenuModule = array('report', 'my', 'todo', 'effort', 'program', 'product', 'execution', 'task', 'build', 'productplan', 'project', 'projectrelease', 'projectstory', 'story', 'branch', 'release', 'attend', 'leave', 'makeup', 'overtime', 'lieu', 'custom', 'admin', 'mail', 'extension', 'dev', 'backup', 'action', 'cron', 'pssp', 'sms', 'message', 'webhook', 'search', 'score', 'stage', 'entry', 'jenkins', 'gitlab'); diff --git a/module/repo/control.php b/module/repo/control.php index 3b477f3efb..c81caab5b1 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -169,10 +169,10 @@ class repo extends control if($repo->SCM == 'Gitlab') { - $projects = $this->loadModel('gitlab')->apiGetProjects($repo->gitlab, $repo->password); + $projects = $this->repo->getGitlabProjects($repo->client, $repo->password); $options = array(); - foreach($projects as $project) $options[$project->id] = $project->name_with_namespace; + foreach($projects as $project) $options[$project->id] = $project->name . ':' . $project->http_url_to_repo; $this->view->projects = $options; } @@ -1116,10 +1116,10 @@ class repo extends control * @access public * @return void */ - public function ajaxGetGitlabProjects($host, $projectIdList = '') + public function ajaxGetGitlabProjects($host, $token) { - $projects = $this->loadModel('gitlab')->apiGetProjects($host); - + $host = helper::safe64Decode($host); + $projects = $this->repo->getGitlabProjects($host, $token); if(!$projects) return $this->send(array('message' => array())); $projectIdList = $projectIdList ? explode(',', $projectIdList) : null; $options = ""; diff --git a/module/repo/model.php b/module/repo/model.php index 3540f16975..e2c757409a 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -1754,7 +1754,6 @@ class repoModel extends model { $host = rtrim($host, '/'); $host .= '/api/v4/projects'; - $allResults = array(); for($page = 1; true; $page ++) { @@ -1768,7 +1767,7 @@ class repoModel extends model /** * Process gitlab repo. - * + * * @param oobject $repo * @access public * @return object diff --git a/module/repo/view/showsynccommit.html.php b/module/repo/view/showsynccommit.html.php index 2de02c57a7..4989e99ec7 100644 --- a/module/repo/view/showsynccommit.html.php +++ b/module/repo/view/showsynccommit.html.php @@ -13,7 +13,7 @@