* Adjust mr create logic
This commit is contained in:
@@ -83,4 +83,10 @@ $(function()
|
||||
});
|
||||
});
|
||||
|
||||
$("#needCI").change(function()
|
||||
{
|
||||
if(this.checked == false) $("#jobID").parent().parent().addClass('hidden');
|
||||
if(this.checked == true) $("#jobID").parent().parent().removeClass('hidden');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -34,6 +34,7 @@ $lang->mr->commits = 'commits';
|
||||
$lang->mr->changes = 'changes';
|
||||
$lang->mr->gitlabID = 'GitLab';
|
||||
$lang->mr->repoID = 'Repo';
|
||||
$lang->mr->jobID = 'Compile job';
|
||||
|
||||
$lang->mr->approval = 'Approval';
|
||||
$lang->mr->approve = 'Approve';
|
||||
|
||||
@@ -34,6 +34,7 @@ $lang->mr->commits = '提交数';
|
||||
$lang->mr->changes = '更改数';
|
||||
$lang->mr->gitlabID = 'GitLab';
|
||||
$lang->mr->repoID = '版本库';
|
||||
$lang->mr->jobID = '构建任务';
|
||||
|
||||
$lang->mr->canMerge = "可合并";
|
||||
$lang->mr->cantMerge = "不可合并";
|
||||
|
||||
@@ -85,6 +85,9 @@ class mrModel extends model
|
||||
public function create()
|
||||
{
|
||||
$MR = fixer::input('post')
|
||||
->setDefault('jobID', 0)
|
||||
->setDefault('repoID', 0)
|
||||
->setDefault('needCI', 0)
|
||||
->add('createdBy', $this->app->user->account)
|
||||
->add('createdDate', helper::now())
|
||||
->get();
|
||||
@@ -103,6 +106,7 @@ class mrModel extends model
|
||||
|
||||
$this->dao->insert(TABLE_MR)->data($MR, $this->config->mr->create->skippedFields)
|
||||
->batchCheck($this->config->mr->create->requiredFields, 'notempty')
|
||||
->checkIF($MR->needCI, 'jobID', 'notempty')
|
||||
->autoCheck()
|
||||
->exec();
|
||||
if(dao::isError()) return array('result' => 'fail', 'message' => dao::getError());
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
<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->devops->repo;?></th>
|
||||
<td colspan='1' class='required'><?php echo html::select('repoID', array(''), '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->mr->needCI;?></th>
|
||||
<td colspan='1'>
|
||||
@@ -60,13 +64,9 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->devops->repo;?></th>
|
||||
<td colspan='1' class='required'><?php echo html::select('repoID', array(''), '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class='hidden'>
|
||||
<th><?php echo $lang->job->common;?></th>
|
||||
<td colspan='1'><?php echo html::select('jobID', array(''), '', "class='form-control chosen'");?></td>
|
||||
<td colspan='1' class='required'><?php echo html::select('jobID', array(''), '', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->mr->assignee;?></th>
|
||||
|
||||
Reference in New Issue
Block a user