diff --git a/module/mr/control.php b/module/mr/control.php index ff28a8efb4..6e74f224cc 100644 --- a/module/mr/control.php +++ b/module/mr/control.php @@ -42,7 +42,6 @@ class mr extends control $this->view->title = $this->lang->mr->create; $this->view->gitlabHosts = $this->loadModel('gitlab')->getPairs(); - $this->view->users = $this->gitlab->getUserIdRealnamePairs(14); $this->display(); } diff --git a/module/mr/js/create.js b/module/mr/js/create.js index d324201335..ae7c6decb1 100644 --- a/module/mr/js/create.js +++ b/module/mr/js/create.js @@ -2,22 +2,34 @@ $(function() { $('#gitlabID').change(function() { - host = $('#gitlabID').val(); - if(host == '') return false; + gitlabID = $('#gitlabID').val(); + if(gitlabID == '') return false; - url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host); + url = createLink('repo', 'ajaxgetgitlabprojects', "gitlabID=" + gitlabID); $.get(url, function(response) { $('#sourceProject').html('').append(response); $('#sourceProject').chosen().trigger("chosen:updated");; }); + + var assignee = $("#assignee").parents('td').find('select[name*=assignee]'); + var reviewer = $("#reviewer").parents('td').find('select[name*=reviewer]'); + usersUrl = createLink('gitlab', 'ajaxgetmruserpairs', "gitlabID=" + gitlabID); + $.get(usersUrl, function(response) + { + assignee.html('').append(response); + assignee.chosen().trigger("chosen:updated");; + reviewer.html('').append(response); + reviewer.chosen().trigger("chosen:updated");; + }); + }); $('#sourceProject,#targetProject').change(function() { sourceProject = $(this).val(); var branchSelect = $(this).parents('td').find('select[name*=Branch]'); - branchUrl = createLink('gitlab', 'ajaxgetprojectbranches', "gitlabID=" + host + "&projectID=" + sourceProject); + branchUrl = createLink('gitlab', 'ajaxgetprojectbranches', "gitlabID=" + gitlabID + "&projectID=" + sourceProject); $.get(branchUrl, function(response) { branchSelect.html('').append(response); @@ -29,7 +41,7 @@ $(function() $('#sourceProject').change(function() { sourceProject = $(this).val(); - projectUrl = createLink('mr', 'ajaxGetMRTragetProjects', "gitlabID=" + host + "&projectID=" + sourceProject); + projectUrl = createLink('mr', 'ajaxGetMRTragetProjects', "gitlabID=" + gitlabID + "&projectID=" + sourceProject); $.get(projectUrl, function(response) { $('#targetProject').html('').append(response); diff --git a/module/mr/lang/zh-cn.php b/module/mr/lang/zh-cn.php index 130955462d..8708c0be55 100644 --- a/module/mr/lang/zh-cn.php +++ b/module/mr/lang/zh-cn.php @@ -23,3 +23,5 @@ $lang->mr->sourceProject = '源项目'; $lang->mr->sourceBranch = '源分支'; $lang->mr->targetProject = '目标项目'; $lang->mr->targetBranch = '目标分支'; + +$lang->mr->usersTips = '提示:如果无法选择指派人和评审人,请先前往GitLab页面绑定用户。'; diff --git a/module/mr/view/create.html.php b/module/mr/view/create.html.php index 6acccf70ee..2ffc1dd4a4 100644 --- a/module/mr/view/create.html.php +++ b/module/mr/view/create.html.php @@ -12,6 +12,9 @@