* adjust for task #6893.
This commit is contained in:
@@ -66,19 +66,16 @@ $('#triggerType').change(function()
|
||||
var type = $(this).val();
|
||||
if(type == 'tag')
|
||||
{
|
||||
$('.tag-fields').removeClass('hidden');
|
||||
$('.comment-fields').addClass('hidden');
|
||||
$('.custom-fields').addClass('hidden');
|
||||
}
|
||||
else if(type == 'commit')
|
||||
{
|
||||
$('.tag-fields').addClass('hidden');
|
||||
$('.comment-fields').removeClass('hidden');
|
||||
$('.custom-fields').addClass('hidden');
|
||||
}
|
||||
else if(type == 'schedule')
|
||||
{
|
||||
$('.tag-fields').addClass('hidden');
|
||||
$('.comment-fields').addClass('hidden');
|
||||
$('.custom-fields').removeClass('hidden');
|
||||
}
|
||||
|
||||
@@ -68,19 +68,16 @@ $('#triggerType').change(function()
|
||||
var type = $(this).val();
|
||||
if(type == 'tag')
|
||||
{
|
||||
$('.tag-fields').removeClass('hidden');
|
||||
$('.comment-fields').addClass('hidden');
|
||||
$('.custom-fields').addClass('hidden');
|
||||
}
|
||||
else if(type == 'commit')
|
||||
{
|
||||
$('.tag-fields').addClass('hidden');
|
||||
$('.comment-fields').removeClass('hidden');
|
||||
$('.custom-fields').addClass('hidden');
|
||||
}
|
||||
else if(type == 'schedule')
|
||||
{
|
||||
$('.tag-fields').addClass('hidden');
|
||||
$('.comment-fields').addClass('hidden');
|
||||
$('.custom-fields').removeClass('hidden');
|
||||
}
|
||||
|
||||
@@ -18,8 +18,7 @@ $lang->integration->scheduleDay = 'Custom Days';
|
||||
$lang->integration->lastExec = 'Last Executed';
|
||||
|
||||
$lang->integration->example = 'e.g.';
|
||||
$lang->integration->tagEx = 'build_#15, to build Jenkins job that id is 15.';
|
||||
$lang->integration->commitEx = 'start build #15, to build Jenkins job that id is 15.';
|
||||
$lang->integration->commitEx = '%build% %integration% %id%15, to build Jenkins job that id is 15.';
|
||||
$lang->integration->cronSample = 'e.g. 0 0 2 * * 2-6/1 means 2:00 a.m. every weekday.';
|
||||
$lang->integration->sendExec = 'Send execute request success.';
|
||||
|
||||
|
||||
@@ -20,8 +20,7 @@ $lang->integration->scheduleDay = '自定义天数';
|
||||
$lang->integration->lastExec = '最后执行';
|
||||
|
||||
$lang->integration->example = '举例';
|
||||
$lang->integration->tagEx = 'build_#15,其中15为Jenkins任务编号';
|
||||
$lang->integration->commitEx = 'start build #15,其中15为Jenkins任务编号';
|
||||
$lang->integration->commitEx = '%build% %integration% %id%15,其中15为Jenkins任务编号';
|
||||
$lang->integration->cronSample = '如 0 0 2 * * 2-6/1 表示每个工作日凌晨2点';
|
||||
$lang->integration->sendExec = '发送执行请求成功!';
|
||||
|
||||
|
||||
@@ -75,6 +75,10 @@ class integrationModel extends model
|
||||
if(!isset($integration->scheduleDay)) $integration->scheduleDay = array();
|
||||
$integration->scheduleDay = join(',', $integration->scheduleDay);
|
||||
}
|
||||
else
|
||||
{
|
||||
$integration->scheduleDay = '';
|
||||
}
|
||||
|
||||
$this->dao->insert(TABLE_INTEGRATION)->data($integration)
|
||||
->batchCheck($this->config->integration->create->requiredFields, 'notempty')
|
||||
@@ -99,7 +103,7 @@ class integrationModel extends model
|
||||
public function update($id)
|
||||
{
|
||||
$oldIntegration = $this->getById($id);
|
||||
$integration = fixer::input('post')
|
||||
$integration = fixer::input('post')
|
||||
->add('editedBy', $this->app->user->account)
|
||||
->add('editedDate', helper::now())
|
||||
->remove('repoType')
|
||||
@@ -109,6 +113,10 @@ class integrationModel extends model
|
||||
if(!isset($integration->scheduleDay)) $integration->scheduleDay = array();
|
||||
$integration->scheduleDay = join(',', $integration->scheduleDay);
|
||||
}
|
||||
else
|
||||
{
|
||||
$integration->scheduleDay = '';
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_INTEGRATION)->data($integration)
|
||||
->batchCheck($this->config->integration->edit->requiredFields, 'notempty')
|
||||
|
||||
@@ -45,13 +45,10 @@
|
||||
<td><?php echo html::select('triggerType', $lang->integration->triggerTypeList, '', "class='form-control chosen'");?></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr class="tag-fields" class="tag-fields">
|
||||
<th><?php echo $lang->integration->example; ?></th>
|
||||
<td colspan="3"><?php echo $lang->integration->tagEx; ?></td>
|
||||
</tr>
|
||||
<tr class="comment-fields" class="comment-fields">
|
||||
<th><?php echo $lang->integration->example; ?></th>
|
||||
<td colspan="3"><?php echo $lang->integration->commitEx; ?></td>
|
||||
<?php if(is_string($config->repo->matchComment)) $config->repo->matchComment = json_decode($config->repo->matchComment, true);?>
|
||||
<td colspan="3"><?php echo str_replace(array('%build%', '%integration%', '%id%'), array($config->repo->matchComment['integration']['start'], $config->repo->matchComment['module']['integration'], $config->repo->matchComment['id']['mark']), $lang->integration->commitEx);?></td>
|
||||
</tr>
|
||||
<tr class="custom-fields">
|
||||
<th><?php echo $lang->integration->scheduleDay; ?></th>
|
||||
|
||||
@@ -49,13 +49,10 @@
|
||||
<td><?php echo html::select('triggerType', $lang->integration->triggerTypeList, $job->triggerType, "class='form-control chosen'"); ?></td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr class="tag-fields">
|
||||
<th><?php echo $lang->integration->example; ?></th>
|
||||
<td colspan="3"><?php echo $lang->integration->tagEx; ?></td>
|
||||
</tr>
|
||||
<tr class="comment-fields">
|
||||
<th><?php echo $lang->integration->example; ?></th>
|
||||
<td colspan="3"><?php echo $lang->integration->commitEx; ?></td>
|
||||
<?php if(is_string($config->repo->matchComment)) $config->repo->matchComment = json_decode($config->repo->matchComment, true);?>
|
||||
<td colspan="3"><?php echo str_replace(array('%build%', '%integration%', '%id%'), array($config->repo->matchComment['integration']['start'], $config->repo->matchComment['module']['integration'], $config->repo->matchComment['id']['mark']), $lang->integration->commitEx);?></td>
|
||||
</tr>
|
||||
<tr class="custom-fields">
|
||||
<th><?php echo $lang->integration->scheduleDay;?></th>
|
||||
|
||||
@@ -49,7 +49,7 @@ $config->repo->matchComment['task']['finish'] = 'Finish';
|
||||
$config->repo->matchComment['task']['cancel'] = 'Cancel';
|
||||
$config->repo->matchComment['task']['consumed'] = 'Cost';
|
||||
$config->repo->matchComment['task']['left'] = 'Left';
|
||||
$config->repo->matchComment['bug']['resolve'] = 'Resolve';
|
||||
$config->repo->matchComment['bug']['resolve'] = 'Fix';
|
||||
$config->repo->matchComment['bug']['resolvedBuild'] = 'Build';
|
||||
$config->repo->matchComment['integration']['start'] = 'Start';
|
||||
$config->repo->matchComment['id']['mark'] = '#';
|
||||
|
||||
@@ -577,12 +577,14 @@ class repo extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setMatchComment()
|
||||
public function setMatchComment($module = '')
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$module = $this->post->selectModule;
|
||||
unset($_POST['selectModule']);
|
||||
$this->loadModel('setting')->setItem('system.repo.matchComment', json_encode($this->post->matchComment));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('setMatchComment')));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('setMatchComment', "module={$module}")));
|
||||
}
|
||||
|
||||
$this->repo->setMenu($this->repos, $this->session->repoID, false);
|
||||
@@ -596,6 +598,7 @@ class repo extends control
|
||||
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->setMatchComment;
|
||||
$this->view->position[] = $this->lang->repo->setMatchComment;
|
||||
|
||||
$this->view->selectModule = $module;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ $lang->repo->deleteBug = 'Delete Bug';
|
||||
$lang->repo->addComment = 'Add Comment';
|
||||
$lang->repo->editComment = 'Edit Comment';
|
||||
$lang->repo->deleteComment = 'Delete Comment';
|
||||
$lang->repo->selectModule = 'Select Module';
|
||||
|
||||
$lang->repo->submit = 'Submit';
|
||||
$lang->repo->cancel = 'Cancel';
|
||||
|
||||
@@ -21,6 +21,7 @@ $lang->repo->deleteBug = '删除评审';
|
||||
$lang->repo->addComment = '添加备注';
|
||||
$lang->repo->editComment = '编辑备注';
|
||||
$lang->repo->deleteComment = '删除备注';
|
||||
$lang->repo->selectModule = '选择模块';
|
||||
|
||||
$lang->repo->submit = '提交';
|
||||
$lang->repo->cancel = '取消';
|
||||
@@ -127,9 +128,11 @@ $lang->repo->notice->lastSyncTime = '最后更新于:';
|
||||
|
||||
$lang->repo->matchComment = new stdclass();
|
||||
$lang->repo->matchComment->exampleLabel = "注释示例";
|
||||
$lang->repo->matchComment->example['task']['start'] = "%start% %task% %id%1%split%2 %cost%%consumedmark%1 %left%%leftmark%3";
|
||||
$lang->repo->matchComment->example['task']['finish'] = "%finish% %task% %id%1%split%2 %cost%%consumedmark%10";
|
||||
$lang->repo->matchComment->example['bug']['resolve'] = "%resolve% %bug% %id%1%split%2 %resolvedBuild% %buildmark%10";
|
||||
$lang->repo->matchComment->example['story']['common'] = "%story% %id%1%split%2";
|
||||
$lang->repo->matchComment->example['task']['start'] = "%start% %task% %id%1%split%2 %cost%%consumedmark%1 %left%%leftmark%3";
|
||||
$lang->repo->matchComment->example['task']['finish'] = "%finish% %task% %id%1%split%2 %cost%%consumedmark%10";
|
||||
$lang->repo->matchComment->example['bug']['resolve'] = "%resolve% %bug% %id%1%split%2 %resolvedBuild% %buildmark%10";
|
||||
$lang->repo->matchComment->example['integration']['start'] = "%build% %integration% %id%1%split%2";
|
||||
|
||||
$lang->repo->error = new stdclass();
|
||||
$lang->repo->error->useless = '你的服务器禁用了exec,shell_exec方法,无法使用该功能';
|
||||
|
||||
@@ -19,19 +19,29 @@
|
||||
<table class='table table-form'>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='w-100px'><?php echo $lang->repo->module;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php foreach($config->repo->matchComment['module'] as $module => $match):?>
|
||||
<span class='input-group-addon'><?php echo $lang->{$module}->common;?></span>
|
||||
<?php echo html::input("matchComment[module][{$module}]", $match, "class='form-control'");?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<th class='w-100px'><?php echo $lang->repo->selectModule;?></th>
|
||||
<td class='w-200px'>
|
||||
<?php
|
||||
foreach($config->repo->matchComment['module'] as $module => $match) $modules[$module] = $lang->{$module}->common;
|
||||
echo html::select('selectModule', $modules, $selectModule, "class='form-control chosen'");
|
||||
?>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->task->common;?></th>
|
||||
<th class='w-100px'><?php echo $lang->repo->module;?></th>
|
||||
<td>
|
||||
<?php foreach($config->repo->matchComment['module'] as $module => $match):?>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon hidden <?php echo $module . 'Item';?>'><?php echo $lang->{$module}->common;?></span>
|
||||
<?php echo html::input("matchComment[module][{$module}]", $match, "class='form-control hidden {$module}Item'");?>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class='taskItem hidden'>
|
||||
<th><?php echo $lang->task->common;?></th>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php foreach($config->repo->matchComment['task'] as $method => $match):?>
|
||||
<span class='input-group-addon'><?php echo $lang->task->$method;?></span>
|
||||
@@ -40,9 +50,9 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class='bugItem hidden'>
|
||||
<th><?php echo $lang->bug->common;?></th>
|
||||
<td>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php foreach($config->repo->matchComment['bug'] as $method => $match):?>
|
||||
<span class='input-group-addon'><?php echo $lang->bug->$method;?></span>
|
||||
@@ -51,7 +61,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class='integrationItem hidden'>
|
||||
<th><?php echo $lang->integration->common;?></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
@@ -64,7 +74,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->idAB;?></th>
|
||||
<td>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php foreach($config->repo->matchComment['id'] as $method => $match):?>
|
||||
<span class='input-group-addon'><?php echo $lang->repo->$method;?></span>
|
||||
@@ -73,23 +83,24 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class='taskItem bugItem hidden'>
|
||||
<th><?php echo $lang->repo->mark;?></th>
|
||||
<td>
|
||||
<td colspan='2'>
|
||||
<div class='input-group'>
|
||||
<?php foreach($config->repo->matchComment['mark'] as $method => $match):?>
|
||||
<span class='input-group-addon'><?php echo isset($lang->task->$method) ? $lang->task->$method : $lang->bug->$method;?></span>
|
||||
<?php echo html::input("matchComment[mark][{$method}]", $match, "class='form-control'");?>
|
||||
<?php $module = isset($lang->task->$method) ? 'task' : 'bug';?>
|
||||
<span class='input-group-addon hidden <?php echo $module . 'Item';?>'><?php echo $lang->{$module}->$method?></span>
|
||||
<?php echo html::input("matchComment[mark][{$method}]", $match, "class='form-control hidden {$module}Item'");?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->repo->matchComment->exampleLabel;?></th>
|
||||
<td id='example'></td>
|
||||
<td colspan='2' id='example'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2' class='text-center'>
|
||||
<td colspan='3' class='text-center'>
|
||||
<?php echo html::submitButton();?>
|
||||
<?php echo html::backButton();?>
|
||||
</td>
|
||||
@@ -102,36 +113,62 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
replaceExample();
|
||||
$('#selectModule').change()
|
||||
$('input').keyup(function(){replaceExample()});
|
||||
})
|
||||
|
||||
$('#selectModule').change(function()
|
||||
{
|
||||
var module = $(this).val();
|
||||
$('[class*=Item]').addClass('hidden');
|
||||
$('.' + module + 'Item').removeClass('hidden');
|
||||
replaceExample();
|
||||
})
|
||||
|
||||
function replaceExample()
|
||||
{
|
||||
exampleTaskStart = matchCommentExample['task']['start'].replace('%start%', $('[id*=start').val())
|
||||
.replace('%task%', $('[id*=module][id*=task]').val())
|
||||
.replace('%id%', $('[id*=id][id*=mark]').val())
|
||||
.replace('%split%', $('[id*=id][id*=split]').val())
|
||||
.replace('%cost%', $('[id*=task][id*=consumed]').val())
|
||||
.replace('%consumedmark%', $('[id*=mark][id*=consumed]').val())
|
||||
.replace('%left%', $('[id*=task][id*=left]').val())
|
||||
.replace('%leftmark%', $('[id*=mark][id*=left]').val());
|
||||
exampleTaskFinish = matchCommentExample['task']['finish'].replace('%finish%', $('[id*=finish]').val())
|
||||
.replace('%task%', $('[id*=module][id*=task]').val())
|
||||
.replace('%id%', $('[id*=id][id*=mark]').val())
|
||||
.replace('%split%', $('[id*=id][id*=split]').val())
|
||||
.replace('%cost%', $('[id*=task][id*=consumed]').val())
|
||||
.replace('%consumedmark%', $('[id*=mark][id*=consumed]').val());
|
||||
exampleBugResolve = matchCommentExample['bug']['resolve'].replace('%resolve%', $('[id*=bug][id*="resolve\]"]').val())
|
||||
.replace('%bug%', $('[id*=module][id*=bug]').val())
|
||||
.replace('%id%', $('[id*=id][id*=mark]').val())
|
||||
.replace('%split%', $('[id*=id][id*=split]').val())
|
||||
.replace('%resolvedBuild%', $('[id*=bug][id*=resolvedBuild]').val())
|
||||
.replace('%buildmark%', $('[id*=mark][id*=resolvedBuild]').val());
|
||||
var module = $('#selectModule').val();
|
||||
var html = '';
|
||||
if(module == 'story')
|
||||
{
|
||||
html = matchCommentExample['story']['common'].replace('%story%', $('[id*=module][id*=story]').val())
|
||||
.replace('%id%', $('[id*=id][id*=mark]').val())
|
||||
.replace('%split%', $('[id*=id][id*=split]').val());
|
||||
}
|
||||
else if(module == 'task')
|
||||
{
|
||||
html = matchCommentExample['task']['start'].replace('%start%', $('[id*=start').val())
|
||||
.replace('%task%', $('[id*=module][id*=task]').val())
|
||||
.replace('%id%', $('[id*=id][id*=mark]').val())
|
||||
.replace('%split%', $('[id*=id][id*=split]').val())
|
||||
.replace('%cost%', $('[id*=task][id*=consumed]').val())
|
||||
.replace('%consumedmark%', $('[id*=mark][id*=consumed]').val())
|
||||
.replace('%left%', $('[id*=task][id*=left]').val())
|
||||
.replace('%leftmark%', $('[id*=mark][id*=left]').val());
|
||||
html += '<br />' + matchCommentExample['task']['finish'].replace('%finish%', $('[id*=finish]').val())
|
||||
.replace('%task%', $('[id*=module][id*=task]').val())
|
||||
.replace('%id%', $('[id*=id][id*=mark]').val())
|
||||
.replace('%split%', $('[id*=id][id*=split]').val())
|
||||
.replace('%cost%', $('[id*=task][id*=consumed]').val())
|
||||
.replace('%consumedmark%', $('[id*=mark][id*=consumed]').val());
|
||||
}
|
||||
else if(module == 'bug')
|
||||
{
|
||||
html = matchCommentExample['bug']['resolve'].replace('%resolve%', $('[id*=bug][id*="resolve\]"]').val())
|
||||
.replace('%bug%', $('[id*=module][id*=bug]').val())
|
||||
.replace('%id%', $('[id*=id][id*=mark]').val())
|
||||
.replace('%split%', $('[id*=id][id*=split]').val())
|
||||
.replace('%resolvedBuild%', $('[id*=bug][id*=resolvedBuild]').val())
|
||||
.replace('%buildmark%', $('[id*=mark][id*=resolvedBuild]').val());
|
||||
}
|
||||
else if(module == 'integration')
|
||||
{
|
||||
html = matchCommentExample['integration']['start'].replace('%build%', $('[id*=integration][id*=start]').val())
|
||||
.replace('%integration%', $('[id*=module][id*=integration]').val())
|
||||
.replace('%id%', $('[id*=id][id*=mark]').val())
|
||||
.replace('%split%', $('[id*=id][id*=split]').val())
|
||||
}
|
||||
|
||||
html = exampleTaskStart;
|
||||
html += '<br />' + exampleTaskFinish;
|
||||
html += '<br />' + exampleBugResolve;
|
||||
$('#example').html(html);
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user