*Finish 44403,44406,44406,44401

This commit is contained in:
xiawenlong
2021-11-17 10:53:37 +08:00
parent 86431ddb80
commit 8c1f8ea70c
11 changed files with 222 additions and 152 deletions
+13 -1
View File
@@ -23,6 +23,18 @@ class compileModel extends model
return $this->dao->select('*')->from(TABLE_COMPILE)->where('id')->eq($buildID)->fetch();
}
/**
* Get By Queue.
*
* @param int $queue
* @access public
* @return void
*/
public function getByQueue($queue)
{
return $this->dao->select('*')->from(TABLE_COMPILE)->where('queue')->eq($queue)->fetch();
}
/**
* Get build list.
*
@@ -45,7 +57,7 @@ class compileModel extends model
->page($pager)
->fetchAll('id');
}
/**
* Get list by jobID.
*
+2 -2
View File
@@ -303,10 +303,10 @@ class gitlabModel extends model
$refList = array();
$branches = $this->apiGetBranches($gitlabID, $projectID);
foreach($branches as $branch) $refList[$branch->name] = "Branch::" . $branch->name;
if(is_array($branches)) foreach($branches as $branch) $refList[$branch->name] = "Branch::" . $branch->name;
$tags = $this->apiGetTags($gitlabID, $projectID);
foreach($tags as $tag) $refList[$tag->name] = "Tag::" . $tag->name;
if(is_array($tags)) foreach($tags as $tag) $refList[$tag->name] = "Tag::" . $tag->name;
return $refList;
+41
View File
@@ -373,4 +373,45 @@ class job extends control
$refList = $this->loadModel('gitlab')->getReferenceOptions($repo->gitlab, $repo->project);
$this->send(array('result' => 'success', 'refList' => $refList));
}
/**
* Ajax get repo list.
*
* @param int $engine
* @access public
* @return void
*/
public function ajaxGetRepoList($engine)
{
$repoList = $this->loadModel('repo')->getList($this->projectID);
$repoPairs = array(0 => '');
foreach($repoList as $repo)
{
if(empty($repo->synced)) continue;
if($engine == 'gitlab')
{
if(strtolower($repo->SCM) == 'gitlab') $repoPairs[$repo->id] = $repo->name;
}
else
{
$repoPairs[$repo->id] = $repo->name;
}
}
echo html::select('repo', $repoPairs, '', "class='form-control chosen'");
die();
}
/**
* Ajax get an repo type.
*
* @param int $repoID
* @access public
* @return void
*/
public function ajaxGetRepoType($repoID)
{
$repo = $this->loadModel('repo')->getRepoByID($repoID);
$this->send(array('result' => 'success', 'type' => strtolower($repo->SCM)));
}
}
+14
View File
@@ -64,3 +64,17 @@ function setValueInput(obj)
$(obj).closest('.input-group').find('select').removeAttr('disabled');
}
}
function loadRepoList(engine = '')
{
var link = createLink('job', 'ajaxGetRepoList', 'engine=' + engine);
$.get(link, function(data)
{
if(data)
{
$('#repo').replaceWith(data)
$('#repo_chosen').remove();
$('#repo').chosen();
}
});
}
+56 -53
View File
@@ -1,13 +1,11 @@
$(document).ready(function()
{
$('#gitlabRepo').change(function()
{
$('#repo').val($(this).val()).change();
})
$('#repo').change(function()
$(document).on('change', '#repo', function()
{
var _this = this;
var repoID = $(this).val();
if(repoID <= 0) return;
var link = createLink('repo', 'ajaxLoadProducts', 'repoID=' + repoID);
$.get(link, function(data)
{
@@ -19,33 +17,54 @@ $(document).ready(function()
}
});
var type = 'Git';
if(typeof(repoTypes[repoID]) != 'undefined') type = repoTypes[repoID];
$('.svn-fields').addClass('hidden');
if(type == 'Subversion' && $('#triggerType').val() == 'tag') $('.svn-fields').removeClass('hidden');
$('#repoType').val(type);
$('#triggerType option[value=tag]').html(type == 'Subversion' ? dirChange : buildTag).trigger('chosen:updated');
if(type == 'Subversion')
/* Add new way get repo type. */
var link = createLink('job', 'ajaxGetRepoType', 'repoID=' + repoID);
$.getJSON(link, function(data)
{
$('#svnDirBox .input-group').empty();
$('#svnDirBox .input-group').append("<div class='load-indicator loading'></div>");
$.getJSON(createLink('repo', 'ajaxGetSVNDirs', 'repoID=' + repoID), function(tags)
if(data.result == 'success')
{
html = "<select id='svnDir' name='svnDir[]' class='form-control'>";
for(path in tags)
if(data.type == 'gitlab')
{
var encodePath = tags[path];
html += "<option value='" + path + "' data-encodePath='" + encodePath + "'>" + path + "</option>";
$('.reference').show();
$('.svn-fields').addClass('hidden');
$('#reference option').remove();
$.getJSON(createLink('job', 'ajaxGetRefList', "repoID=" + repoID), function(response)
{
if(response.result == 'success')
{
$.each(response.refList, function(reference, name)
{
$('#reference').append("<option value='" + reference + "'>" + name + "</option>");
});
}
$('#reference').trigger('chosen:updated');
});
}
html += '</select>';
$('#svnDirBox .loading').remove();
$('#svnDirBox .input-group').append(html);
$('#svnDirBox #svnDir').chosen();
})
}
})
else
{
if($('#triggerType').val() == 'tag') $('.svn-fields').removeClass('hidden');
$('#svnDirBox .input-group').empty();
$('#svnDirBox .input-group').append("<div class='load-indicator loading'></div>");
$.getJSON(createLink('repo', 'ajaxGetSVNDirs', 'repoID=' + repoID), function(tags)
{
html = "<select id='svnDir' name='svnDir[]' class='form-control'>";
for(path in tags)
{
var encodePath = tags[path];
html += "<option value='" + path + "' data-encodePath='" + encodePath + "'>" + path + "</option>";
}
html += '</select>';
$('#svnDirBox .loading').remove();
$('#svnDirBox .input-group').append(html);
$('#svnDirBox #svnDir').chosen();
})
}
$('#triggerggerType option[value=tag]').html(data.type == 'gitlab' ? buildTag : dirChange).trigger('chosen:updated');
}
});
});
$(document).on('change', '[name^=svnDir]', function()
{
@@ -124,15 +143,19 @@ $(document).ready(function()
var scheduleOption = "<option value='schedule'>" + $('#triggerType').find('[value=schedule]').text() + "</option>";
$('#engine').change(function()
{
$('#jenkinsServerTR').toggle($('#engine').val() == 'jenkins');
$('#gitlabServerTR').toggle($('#engine').val() == 'gitlab');
var engine = $(this).val();
$('.reference').hide();
loadRepoList(engine);
$('#jenkinsServerTR').toggle(engine == 'jenkins');
$('#gitlabServerTR').toggle(engine == 'gitlab');
if($(this).val() == 'gitlab')
if(engine == 'gitlab')
{
$('tr.gitlabRepo').show();
$('tr.commonRepo').hide();
}
else if($('#triggerType').find('[value=schedule]').size() == 0 )
//else if($('#triggerType').find('[value=schedule]').size() == 0)
else
{
$('tr.gitlabRepo').hide();
$('tr.commonRepo').show();
@@ -140,26 +163,6 @@ $(document).ready(function()
});
$('#engine').change();
$('#gitlabRepo').change(function()
{
$('#reference option').remove();
var repoID = $(this).val();
if(repoID > 0)
{
$.getJSON(createLink('job', 'ajaxGetRefList', "repoID=" + repoID), function(response)
{
if(response.result == 'success')
{
$.each(response.refList, function(reference, name)
{
$('#reference').append("<option value='" + reference + "'>" + name + "</option>");
});
}
$('#reference').trigger('chosen:updated');
});
}
});
$('#triggerType').change();
});
+1 -2
View File
@@ -152,10 +152,9 @@ class jobModel extends model
if(strtolower($job->engine) == 'gitlab')
{
$repo = $this->loadModel('repo')->getRepoByID($job->gitlabRepo);
$repo = $this->loadModel('repo')->getRepoByID($job->repo);
$project = zget($repo, 'project');
$job->repo = $job->gitlabRepo;
$job->server = (int)zget($repo, 'gitlab', 0);
$job->pipeline = json_encode(array('project' => $project, 'reference' => $this->post->reference));
}
+3 -7
View File
@@ -42,14 +42,10 @@
<span id="gitlabServerTR"><?php echo $lang->job->engineTips->success;?></span>
</td>
</tr>
<tr class='commonRepo'>
<tr>
<th><?php echo $lang->job->repo; ?></th>
<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='chosen form-control'");?> </td>
<td> <?php echo html::select('reference', array(), '', "class='chosen form-control'");?> </td>
<td><?php echo html::select('repo', $repoPairs, '', "class='form-control chosen'"); ?></td>
<td class='reference hide'><?php echo html::select('reference', array(), '', "class='chosen form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->job->product; ?></th>
+28 -10
View File
@@ -84,12 +84,11 @@ class mrModel extends model
*/
public function create()
{
if (!empty($_POST['compile']))
if (!empty($_POST['job']))
{
$repoID = $this->post->repo;
$jobID = $this->post->job;
$compileID = $this->post->compile;
$compileStatus = $this->loadModel('compile')->getByID($this->post->compile)->status;
$MR = fixer::input('post')
->add('createdBy', $this->app->user->account)
@@ -97,7 +96,6 @@ class mrModel extends model
->add('repoID', $repoID)
->add('jobID', $jobID)
->add('compileID', $compileID)
->add('compileStatus', $compileStatus)
->get();
}
else
@@ -108,6 +106,18 @@ class mrModel extends model
->get();
}
/* Exec Job */
if($MR->jobID)
{
$pipeline = $this->loadModel('job')->exec($MR->jobID);
if($pipeline->queue)
{
$compile = $this->loadModel('compile')->getByQueue($pipeline->queue);
$MR->compileID = $compile->id;
$MR->compileStatus = $compile->status;
}
}
$this->dao->insert(TABLE_MR)->data($MR, $this->config->mr->create->skippedFields)
->batchCheck($this->config->mr->create->requiredFields, 'notempty')
->autoCheck()
@@ -172,20 +182,16 @@ class mrModel extends model
*/
public function update($MRID)
{
if (!empty($_POST['compile']))
if (!empty($_POST['job']))
{
$repoID = $this->post->repo;
$jobID = $this->post->job;
$compileID = $this->post->compile;
$compileStatus = $this->loadModel('compile')->getByID($this->post->compile)->status;
$MR = fixer::input('post')
->setDefault('editedBy', $this->app->user->account)
->setDefault('editedDate', helper::now())
->add('repoID', $repoID)
->add('jobID', $jobID)
->add('compileID', $compileID)
->add('compileStatus', $compileStatus)
->get();
}
else
@@ -195,6 +201,20 @@ class mrModel extends model
->setDefault('editedDate', helper::now())
->get();
}
$oldMR = $this->getByID($MRID);
/* Exec Job */
if($MR->jobID)
{
$pipeline = $this->loadModel('job')->exec($MR->jobID);
if($pipeline->queue && $MR->jobID != $oldMR->jobID)
{
$compile = $this->loadModel('compile')->getByQueue($pipeline->queue);
$MR->compileID = $compile->id;
$MR->compileStatus = $compile->status;
}
}
/* Update MR in GitLab. */
$newMR = new stdclass;
@@ -203,8 +223,6 @@ class mrModel extends model
$newMR->assignee_ids = $MR->assignee;
$newMR->target_branch = $MR->targetBranch;
$oldMR = $this->getByID($MRID);
/* Known issue: `reviewer_ids` takes no effect. */
$rawMR = $this->apiUpdateMR($oldMR->gitlabID, $oldMR->targetProject, $oldMR->mriid, $newMR);
+24 -29
View File
@@ -41,44 +41,39 @@
<?php endif;?>
</p>
</div>
<?php else: ?>
<?php else:?>
<form class='main-table' id='ajaxForm' method='post'>
<table id='gitlabProjectList' class='table has-sort-head table-fixed'>
<thead>
<tr>
<?php $vars = "mode=$mode&param=$param&objectID=$objectID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
<th class='w-60px text-left'><?php common::printOrderLink('id', $orderBy, $vars, $lang->mr->id); ?></th>
<th class='w-200px text-left'><?php common::printOrderLink('title', $orderBy, $vars, $lang->mr->title); ?></th>
<th class='text-left'><?php common::printOrderLink('sourceProject', $orderBy, $vars, $lang->mr->sourceProject); ?></th>
<th class='w-120px text-left'><?php common::printOrderLink('sourceBranch', $orderBy, $vars, $lang->mr->sourceBranch); ?></th>
<th class='text-left'><?php common::printOrderLink('targetProject', $orderBy, $vars, $lang->mr->targetProject); ?></th>
<th class='w-120px text-left'><?php common::printOrderLink('targetBranch', $orderBy, $vars, $lang->mr->targetBranch); ?></th>
<th class='w-120px text-left'><?php common::printOrderLink('mergeStatus', $orderBy, $vars, $lang->mr->mergeStatus); ?></th>
<th class='w-120px text-left'><?php common::printOrderLink('approvalStatus', $orderBy, $vars, $lang->mr->approvalStatus); ?></th>
<th class='w-120px c-actions-3'><?php echo $lang->actions; ?></th>
<?php $vars = "mode=$mode&param=$param&objectID=$objectID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<th class='w-60px text-left'><?php common::printOrderLink('id', $orderBy, $vars, $lang->mr->id);?></th>
<th class='w-200px text-left'><?php common::printOrderLink('title', $orderBy, $vars, $lang->mr->title);?></th>
<th class='w-200px text-left'><?php common::printOrderLink('sourceBranch', $orderBy, $vars, $lang->mr->sourceBranch);?></th>
<th class='w-200px text-left'><?php common::printOrderLink('targetBranch', $orderBy, $vars, $lang->mr->targetBranch);?></th>
<th class='w-120px text-left'><?php common::printOrderLink('mergeStatus', $orderBy, $vars, $lang->mr->mergeStatus);?></th>
<th class='w-120px text-left'><?php common::printOrderLink('approvalStatus', $orderBy, $vars, $lang->mr->approvalStatus);?></th>
<th class='w-120px c-actions-3'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($MRList as $MR):?>
<tr>
<td class='text'><?php echo $MR->id; ?></td>
<td class='text'><?php echo $MR->title; ?></td>
<td class='text'><?php echo $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->sourceProject)->name_with_namespace; ?></td>
<td class='text'><?php echo $MR->sourceBranch;?></td>
<td class='text'><?php echo $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->targetProject)->name_with_namespace; ?></td>
<td class='text'><?php echo $MR->targetBranch;?></td>
<td class='text'><?php echo $MR->id;?></td>
<td class='text'><?php echo $MR->title;?></td>
<td class='text'><?php echo $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->sourceProject)->name_with_namespace . ':' . $MR->sourceBranch;?></td>
<td class='text'><?php echo $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->targetProject)->name_with_namespace . ':' . $MR->targetBranch;?></td>
<?php if($MR->status == 'closed'):?>
<td class='text'><?php echo zget($lang->mr->statusList, $MR->status);?></td>
<?php else:?>
<td class='text'><?php echo ($MR->status == 'merged') ? zget($lang->mr->statusList, $MR->status) : zget($lang->mr->mergeStatusList, $MR->mergeStatus);?></td>
<?php endif;?>
<?php if($MR->status == 'closed'): ?>
<td class='text'><?php echo zget($lang->mr->statusList, $MR->status); ?></td>
<?php else: ?>
<td class='text'><?php echo ($MR->status == 'merged') ? zget($lang->mr->statusList, $MR->status) : zget($lang->mr->mergeStatusList, $MR->mergeStatus); ?></td>
<?php endif; ?>
<?php if($MR->status == 'merged' or $MR->status == 'closed'): ?>
<td class='text'><?php echo '-'; ?></td> <!-- Keep page clean that make user focus to the MR not reviewed. -->
<?php else: ?>
<td><?php echo empty($MR->approvalStatus) ? $lang->mr->approvalStatusList['notReviewed'] : $lang->mr->approvalStatusList[$MR->approvalStatus]; ?></td>
<?php endif; ?>
<?php if($MR->status == 'merged' or $MR->status == 'closed'):?>
<td class='text'><?php echo '-';?></td> <!-- Keep page clean that make user focus to the MR not reviewed. -->
<?php else:?>
<td><?php echo empty($MR->approvalStatus) ? $lang->mr->approvalStatusList['notReviewed'] : $lang->mr->approvalStatusList[$MR->approvalStatus];?></td>
<?php endif;?>
<td class='c-actions'>
<?php
common::printLink('mr', 'view', "mr={$MR->id}", '<i class="icon icon-eye"></i>', '', "title='{$lang->mr->view}' class='btn btn-info'");
@@ -95,4 +90,4 @@
</form>
<?php endif;?>
</div>
<?php include '../../common/view/footer.html.php'; ?>
<?php include '../../common/view/footer.html.php';?>
+25 -29
View File
@@ -9,50 +9,50 @@
* @version $Id: create.html.php $
*/
?>
<?php include '../../common/view/header.html.php'; ?>
<?php include '../../common/view/header.html.php';?>
<div id='mainContent' class='main-row'>
<div class='main-col main-content'>
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->mr->create; ?></h2>
<h2><?php echo $lang->mr->create;?></h2>
</div>
<form id='mrForm' method='post' class='form-ajax'>
<table class='table table-form'>
<tr>
<th><?php echo $lang->gitlab->common; ?></th>
<th><?php echo $lang->gitlab->common;?></th>
<!-- Use `array('') + $gitlabHosts` here because of this field must be changed when creating this MR. -->
<td class='required'><?php echo html::select('gitlabID', array('') + $gitlabHosts, '', "class='form-control'"); ?></td>
<td class='required'><?php echo html::select('gitlabID', array('') + $gitlabHosts, '', "class='form-control'");?></td>
</tr>
<tr>
<th style="white-space: nowrap;"><?php echo $lang->mr->sourceProject; ?></th>
<th style="white-space: nowrap;"><?php echo $lang->mr->sourceProject;?></th>
<td>
<div class='input-group required'>
<?php echo html::select('sourceProject', array(''), '', "class='form-control chosen'"); ?>
<?php echo html::select('sourceProject', array(''), '', "class='form-control chosen'");?>
<span class='input-group-addon fix-border'><?php echo $lang->mr->sourceBranch ?></span>
<?php echo html::select('sourceBranch', array(''), '', "class='form-control chosen'"); ?>
<?php echo html::select('sourceBranch', array(''), '', "class='form-control chosen'");?>
</div>
</td>
</tr>
<tr>
<th style="white-space: nowrap;"><?php echo $lang->mr->targetProject; ?></th>
<th style="white-space: nowrap;"><?php echo $lang->mr->targetProject;?></th>
<td>
<div class='input-group required'>
<?php echo html::select('targetProject', array(''), '', "class='form-control chosen'"); ?>
<?php echo html::select('targetProject', array(''), '', "class='form-control chosen'");?>
<span class='input-group-addon fix-border'><?php echo $lang->mr->targetBranch ?></span>
<?php echo html::select('targetBranch', array(''), '', "class='form-control chosen'"); ?>
<?php echo html::select('targetBranch', array(''), '', "class='form-control chosen'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->mr->title; ?></th>
<td class='required'><?php echo html::input('title', '', "class='form-control'"); ?></td>
<th><?php echo $lang->mr->title;?></th>
<td class='required'><?php echo html::input('title', '', "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->mr->description; ?></th>
<td colspan='1'><?php echo html::textarea('description', '', "rows='3' class='form-control'"); ?></td>
<th><?php echo $lang->mr->description;?></th>
<td colspan='1'><?php echo html::textarea('description', '', "rows='3' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->mr->needCI; ?></th>
<th><?php echo $lang->mr->needCI;?></th>
<td colspan='1'>
<div class="checkbox-primary">
<input type="checkbox" name="needCI" value="1" id="needCI">
@@ -61,29 +61,25 @@
</td>
</tr>
<tr>
<th><?php echo $lang->devops->repo; ?></th>
<td colspan='1' class='required'><?php echo html::select('repo', array(''), '', "class='form-control chosen'"); ?></td>
<th><?php echo $lang->devops->repo;?></th>
<td colspan='1' class='required'><?php echo html::select('repo', array(''), '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->job->common; ?></th>
<td colspan='1'><?php echo html::select('job', array(''), '', "class='form-control chosen'"); ?></td>
<th><?php echo $lang->job->common;?></th>
<td colspan='1'><?php echo html::select('job', array(''), '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->compile->result; ?></th>
<td colspan='1'><?php echo html::select('compile', array(''), '', "class='form-control chosen'"); ?></td>
</tr>
<tr>
<th><?php echo $lang->mr->assignee; ?></th>
<td><?php echo html::select('assignee', array(''), '', "class='form-control chosen'") ?></td>
<th><?php echo $lang->mr->assignee;?></th>
<td><?php echo html::select('assignee', array(''), '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th></th>
<td><?php echo $lang->mr->usersTips; ?></td>
<td><?php echo $lang->mr->usersTips;?></td>
</tr>
<tr>
<td colspan='2' class='text-center form-actions'>
<?php echo html::submitButton(); ?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"'); ?>
<?php echo html::submitButton();?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"');?>
</td>
<td></td>
</tr>
@@ -92,4 +88,4 @@
</div>
</div>
</div>
<?php include '../../common/view/footer.html.php'; ?>
<?php include '../../common/view/footer.html.php';?>
+15 -19
View File
@@ -16,8 +16,8 @@
<div id='mainContent'>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->mr->notFound; ?></span>
<?php echo html::a($this->createLink('mr', 'browse'), "<i class='icon icon-plus'></i> " . $lang->mr->browse, '', "class='btn btn-info'"); ?>
<span class="text-muted"><?php echo $lang->mr->notFound;?></span>
<?php echo html::a($this->createLink('mr', 'browse'), "<i class='icon icon-plus'></i> " . $lang->mr->browse, '', "class='btn btn-info'");?>
</p>
</div>
</div>
@@ -40,7 +40,7 @@
<td>
<div>
<span class='fix-border text-left'>
<?php echo $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->sourceProject)->name_with_namespace; ?>:
<?php echo $this->loadModel('gitlab')->apiGetSingleProject($MR->gitlabID, $MR->sourceProject)->name_with_namespace;?>:
<?php echo $MR->sourceBranch;?>
</span>
</div>
@@ -59,37 +59,33 @@
</tr>
<tr>
<th><?php echo $lang->mr->title;?></th>
<td class='required'><?php echo html::input('title', $MR->title, "class='form-control'"); ?></td>
<td class='required'><?php echo html::input('title', $MR->title, "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->mr->description; ?></th>
<td colspan='1'><?php echo html::textarea('description', $MR->description, "rows='3' class='form-control'"); ?></td>
<th><?php echo $lang->mr->description;?></th>
<td colspan='1'><?php echo html::textarea('description', $MR->description, "rows='3' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->mr->needCI; ?></th>
<th><?php echo $lang->mr->needCI;?></th>
<td colspan='1'>
<div class="checkbox-primary">
<?php $checked = $MR->needCI == '1' ? 'checked' : '' ?>
<input type="checkbox" <?php echo $checked; ?> name="needCI" value="1" id="needCI">
<input type="checkbox" <?php echo $checked;?> name="needCI" value="1" id="needCI">
<label for="needCI"></label>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->devops->repo; ?></th>
<td colspan='1' class='required'><?php echo html::select('repo', $repoList, $MR->repoID, "class='form-control chosen'"); ?></td>
<th><?php echo $lang->devops->repo;?></th>
<td colspan='1' class='required'><?php echo html::select('repo', $repoList, $MR->repoID, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->job->common; ?></th>
<td colspan='1'><?php echo html::select('job', $jobList, $MR->jobID, "class='form-control chosen'"); ?></td>
</tr>
<tr>
<th><?php echo $lang->compile->result; ?></th>
<td colspan='1'><?php echo html::select('compile', $compileList, $MR->compileID, "class='form-control chosen'"); ?></td>
<th><?php echo $lang->job->common;?></th>
<td colspan='1'><?php echo html::select('job', $jobList, $MR->jobID, "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->mr->assignee;?></th>
<td><?php echo html::select('assignee', $users, $assignee, "class='form-control chosen'")?></td>
<td><?php echo html::select('assignee', $users, $assignee, "class='form-control chosen'");?></td>
</tr>
<tr>
<th></th>
@@ -97,7 +93,7 @@
</tr>
<tr>
<td colspan='2' class='text-center form-actions'>
<?php echo html::submitButton(); ?>
<?php echo html::submitButton();?>
<?php if(!isonlybody()) echo html::a(inlink('browse', ""), $lang->goback, '', 'class="btn btn-wide"');?>
</td>
<th></th>
@@ -107,4 +103,4 @@
</div>
</div>
</div>
<?php include '../../common/view/footer.html.php'; ?>
<?php include '../../common/view/footer.html.php';?>