This commit is contained in:
wangyidong
2021-08-05 16:05:11 +08:00
8 changed files with 50 additions and 23 deletions
+5
View File
@@ -14,6 +14,11 @@
<div id="mainContent" class="main-content">
<div class="main-header">
<h2><?php echo $lang->gitlab->importIssue;?></h2>
<?php if(!isonlybody() and empty($importable)):?>
<div class='pull-right'>
<?php echo html::linkButton($lang->goback, $this->createLink('repo', 'maintain'), 'self', '', 'btn btn-primary');?>
</div>
<?php endif;?>
</div>
<?php if($importable):?>
<form method='post' class='load-indicator main-form form-ajax' enctype='multipart/form-data'>
+12 -9
View File
@@ -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();
+9
View File
@@ -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();
}
});
+6 -2
View File
@@ -42,9 +42,13 @@
<span id="gitlabServerTR"><?php echo $lang->job->engineTips->success;?></span>
</td>
</tr>
<tr>
<tr class='commonRepo'>
<th><?php echo $lang->job->repo; ?></th>
<td><?php echo html::select('repo', $repoPairs, '', "class='form-control chosen'"); ?></td>
<td><?php echo html::select('repo', $repoPairs, '', "class='form-control'"); ?></td>
</tr>
<tr class='gitlabRepo hide'>
<th><?php echo $lang->job->repo; ?></th>
<td><?php echo html::select('gitlabRepo', $gitlabRepos, '', "class='form-control'"); ?></td>
</tr>
<tr>
<th><?php echo $lang->job->product; ?></th>
+8 -2
View File
@@ -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;
+4 -4
View File
@@ -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%'");
}
?>
</td>
+5 -5
View File
@@ -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=&param=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=&param=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'");
}
?>
</td>
+1 -1
View File
@@ -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()