This commit is contained in:
liuhong
2022-08-31 06:13:31 +00:00
parent 3dfd3ecfca
commit 18d6ed7f2d
2 changed files with 37 additions and 10 deletions
+32 -6
View File
@@ -364,6 +364,14 @@ function toggleSelectTestStory()
}
}
/**
* Add Ditto checkBox.
*
* @param object $obj
* @param int $index
* @access public
* @return void
*/
var index = 0;
function addItem(obj)
{
@@ -383,22 +391,33 @@ function addItem(obj)
$nextTr.find('.deadlineInput').attr('id', 'testDeadline\[' + index + '\]');
if($nextTr.find('.deadlineBox').length == 0)
$nextTr.find('.deadlineInput').after('<span class="input-group-addon deadlineBox"><input type="checkbox" name="deadlineDitto\[' +index + '\]" id="deadlineDitto\[' + index + '\]" checked/>同上</span>');
{
$nextTr.find('.deadlineInput').after('<span class="input-group-addon deadlineBox"><input type="checkbox" name="deadlineDitto\[' +index + '\]" id="deadlineDitto\[' + index + '\]" checked/>' + ditto + '</span>');
}
if($nextTr.find('.estStartedBox').length == 0)
$nextTr.find('.startInput').after('<span class="input-group-addon estStartedBox"><input type="checkbox" name="deadlineDitto\[' +index + '\]" id="deadlineDitto\[' + index + '\]" checked/>同上</span>');
{
$nextTr.find('.startInput').after('<span class="input-group-addon estStartedBox"><input type="checkbox" name="deadlineDitto\[' +index + '\]" id="deadlineDitto\[' + index + '\]" checked/>' + ditto + '</span>');
}
if($nextTr.find('.deadlineBox').is(':hidden'))
{
$nextTr.find('.deadlineBox').show();
$nextTr.find(".deadlineBox input[type='checkBox']").attr('checked', true);
$nextTr.find('.deadlineBox').show();
$nextTr.find(".deadlineBox input[type='checkBox']").attr('checked', true);
}
if($nextTr.find('.estStartedBox').is(':hidden'))
{
$nextTr.find('.estStartedBox').show();
$nextTr.find(".estStartedBox input[type='checkBox']").attr('checked', true);
$nextTr.find('.estStartedBox').show();
$nextTr.find(".estStartedBox input[type='checkBox']").attr('checked', true);
}
}
/**
* remove Ditto checkBox.
*
* @param object $obj
* @access public
* @return void
*/
function removeItem(obj)
{
if($(obj).closest('table').find('tbody tr').size() > 1) $(obj).closest('tr').remove();
@@ -652,6 +671,13 @@ $(window).unload(function(){
if(blockID) window.parent.refreshBlock($('#block' + blockID));
});
/**
* Toggle checkBox Ditto Whether to hide.
*
* @param object $obj
* @access public
* @return void
*/
function hiddenDitto(obj)
{
var $this = $(obj);
+5 -4
View File
@@ -15,6 +15,7 @@
<?php include '../../common/view/sortable.html.php';?>
<?php js::set('toTaskList', !empty($task->id));?>
<?php js::set('blockID', $blockID);?>
<?php js::set('ditto', $lang->task->ditto);?>
<?php js::set('teamMemberError', $lang->task->error->teamMember);?>
<?php js::set('vision', $config->vision);?>
<?php js::set('requiredFields', $config->task->create->requiredFields);?>
@@ -135,8 +136,8 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
<?php foreach($testStories as $storyID => $storyTitle):?>
<?php if($i > 0) $members['ditto'] = $lang->task->ditto;?>
<tr>
<td><?php echo html::select("testStory[]", array($storyID => $storyTitle), $storyID, "class='form-control chosen'");?></td>
<td><?php echo html::select("testPri[]", $lang->task->priList, $task->pri, "class='form-control chosen'");?></td>
<td><?php echo html::select("testStory[$i]", array($storyID => $storyTitle), $storyID, "class='form-control chosen'");?></td>
<td><?php echo html::select("testPri[$i]", $lang->task->priList, $task->pri, "class='form-control chosen'");?></td>
<td>
<div class='input-group'>
<?php
@@ -152,8 +153,8 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
?>
</div>
</td>
<td><?php echo html::select("testAssignedTo[]", $members, $i == 0 ? $task->assignedTo : 'ditto', "class='form-control chosen'");?></td>
<td><?php echo html::input("testEstimate[]", '', "class='form-control'");?></td>
<td><?php echo html::select("testAssignedTo[$i]", $members, $i == 0 ? $task->assignedTo : 'ditto', "class='testAssignedTo form-control chosen'");?></td>
<td><?php echo html::input("testEstimate[$i]", '', "class='form-control'");?></td>
<td class='text-center'>
<div class="btn-group">
<button type="button" class="btn btn-sm" tabindex="-1" onclick='addItem(this)'><i class="icon icon-plus"></i></button>