gitlab->importIssue;?>

+ +
+ goback, $this->createLink('repo', 'maintain'), 'self', '', 'btn btn-primary');?> +
+
diff --git a/module/job/control.php b/module/job/control.php index 34862bbd1f..477133b475 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -70,22 +70,25 @@ class job extends control } $this->app->loadLang('action'); - $repoList = $this->loadModel('repo')->getList($this->projectID); - $repoPairs = array(0 => ''); - $repoTypes = array(); + $repoList = $this->loadModel('repo')->getList($this->projectID); + $repoPairs = array(0 => ''); + $gitlabRepos = array(0 => ''); + $repoTypes = array(); foreach($repoList as $repo) { if(empty($repo->synced)) continue; $repoPairs[$repo->id] = $repo->name; $repoTypes[$repo->id] = $repo->SCM; + if($repo->SCM == 'Gitlab') $gitlabRepos[$repo->id] = $repo->name; } - $this->view->title = $this->lang->ci->job . $this->lang->colon . $this->lang->job->create; - $this->view->position[] = html::a(inlink('browse'), $this->lang->ci->job); - $this->view->position[] = $this->lang->job->create; - $this->view->repoPairs = $repoPairs; - $this->view->repoTypes = $repoTypes; - $this->view->products = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->projectID); + $this->view->title = $this->lang->ci->job . $this->lang->colon . $this->lang->job->create; + $this->view->position[] = html::a(inlink('browse'), $this->lang->ci->job); + $this->view->position[] = $this->lang->job->create; + $this->view->repoPairs = $repoPairs; + $this->view->gitlabRepos = $gitlabRepos; + $this->view->repoTypes = $repoTypes; + $this->view->products = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->projectID); $this->view->jenkinsServerList = $this->loadModel('jenkins')->getPairs(); diff --git a/module/job/js/create.js b/module/job/js/create.js index 7038077ab2..cc0301ae01 100644 --- a/module/job/js/create.js +++ b/module/job/js/create.js @@ -1,5 +1,10 @@ $(document).ready(function() { + $('#gitlabRepo').change(function() + { + $('#repo').val($(this).val()).change(); + }) + $('#repo').change(function() { var repoID = $(this).val(); @@ -125,10 +130,14 @@ $(document).ready(function() if($(this).val() == 'gitlab') { $('#triggerType').find('[value=schedule]').remove(); + $('tr.gitlabRepo').show(); + $('tr.commonRepo').hide(); } else if($('#triggerType').find('[value=schedule]').size() == 0 ) { $('#triggerType').append(scheduleOption); + $('tr.gitlabRepo').hide(); + $('tr.commonRepo').show(); } }); diff --git a/module/job/view/create.html.php b/module/job/view/create.html.php index d87f540ff6..8cf317f36e 100644 --- a/module/job/view/create.html.php +++ b/module/job/view/create.html.php @@ -42,9 +42,13 @@ job->engineTips->success;?> - + job->repo; ?> - + + + + job->repo; ?> + job->product; ?> diff --git a/module/my/control.php b/module/my/control.php index 3e9a8abc7b..2bb5f21477 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -196,10 +196,13 @@ class my extends control /* Append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); + $stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'story'); + if(!empty($stories)) $stories = $this->story->mergeReviewer($stories); + /* Assign. */ $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story; $this->view->position[] = $this->lang->my->story; - $this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'story'); + $this->view->stories = $stories; $this->view->users = $this->user->getPairs('noletter'); $this->view->projects = $this->loadModel('project')->getPairsByProgram(); $this->view->type = $type; @@ -237,10 +240,13 @@ class my extends control /* Append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); + $stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement'); + if(!empty($stories)) $stories = $this->story->mergeReviewer($stories); + /* Assign. */ $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story; $this->view->position[] = $this->lang->my->story; - $this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'requirement'); + $this->view->stories = $stories; $this->view->users = $this->user->getPairs('noletter'); $this->view->projects = $this->loadModel('project')->getPairsByProgram(); $this->view->type = $type; diff --git a/module/my/view/requirement.html.php b/module/my/view/requirement.html.php index f4031f5183..80f50d034a 100644 --- a/module/my/view/requirement.html.php +++ b/module/my/view/requirement.html.php @@ -99,10 +99,10 @@ if($canBeChanged) { $vars = "story={$story->id}"; - common::printIcon('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true); - common::printIcon('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true); - common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'"); + echo common::buildIconButton('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true); + echo common::buildIconButton('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true); + echo common::buildIconButton('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); + echo common::buildIconButton('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'"); } ?> diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index e48763c06e..2385c4cde1 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -101,11 +101,11 @@ if($canBeChanged) { $vars = "story={$story->id}"; - common::printIcon('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true); - common::printIcon('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true); - common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'"); - common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'"); + echo common::buildIconButton('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true); + echo common::buildIconButton('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true); + echo common::buildIconButton('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); + echo common::buildIconButton('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'"); + echo common::buildIconButton('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'"); } ?> diff --git a/module/story/model.php b/module/story/model.php index cf0f32c553..74b5585b98 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2709,7 +2709,7 @@ class storyModel extends model ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($type != 'all') ->beginIF($type == 'assignedTo')->andWhere('assignedTo')->eq($account)->fi() - ->beginIF($type == 'reviewBy')->andWhere('t3.reviewer')->eq($account)->andWhere('t3.result')->eq('')->fi() + ->beginIF($type == 'reviewBy')->andWhere('t3.reviewer')->eq($account)->andWhere('t3.result')->eq('')->andWhere('t1.status')->in('draft,changed')->fi() ->beginIF($type == 'openedBy')->andWhere('openedBy')->eq($account)->fi() ->beginIF($type == 'reviewedBy')->andWhere("CONCAT(',', reviewedBy, ',')")->like("%,$account,%")->fi() ->beginIF($type == 'closedBy')->andWhere('closedBy')->eq($account)->fi()