* merge from 12.x.

This commit is contained in:
wangyidong
2021-04-01 13:25:05 +08:00
parent 935689e392
commit 1bad944701
2 changed files with 51 additions and 0 deletions
+30
View File
@@ -35,6 +35,13 @@ function loadExecutionMembers(executionID)
$(this).find('#team').replaceWith(data);
$(this).find('#assignedTo').attr('id', 'team').attr('name', 'team[]').chosen();
});
$('#testStoryBox table tbody tr').each(function(i)
{
$td = $(this).find('#testAssignedTo').closest('td');
$td.html(data);
$td.find('#assignedTo').val('').attr('id', 'testAssignedTo').attr('name', 'testAssignedTo[]').chosen();
});
});
}
@@ -53,6 +60,29 @@ function loadExecutionStories(executionID)
$('#story').next('.picker').remove();
$('#story').replaceWith(data);
$('#story').addClass('filled').chosen();
if($('#testStoryBox table tbody tr').length == 0)
{
var trHtml = $('#testStoryTemplate tr').prop("outerHTML");
$('#testStoryBox table tbody').append(trHtml);
$td = $('#testStoryBox table tbody tr:first').find('#testStory').closest('td');
$td.html(data);
$td.find('#story').val($td.find('#story option').eq(i).val()).attr('id', 'testStory').attr('name', 'testStory[]').addClass('filled').chosen();
$td = $('#testStoryBox table tbody tr:first').find('#testPri_chosen').closest('td');
$td.find('#testPri_chosen').remove();
$td.find('#testPri').chosen();
}
else
{
$('#testStoryBox table tbody tr').each(function(i)
{
$td = $(this).find('#testStory').closest('td');
$td.html(data);
$td.find('#story').val($td.find('#story option').eq(i).val()).attr('id', 'testStory').attr('name', 'testStory[]').addClass('filled').chosen();
});
}
});
}
+21
View File
@@ -293,6 +293,27 @@
</form>
</div>
</div>
<table class='hidden' id='testStoryTemplate'>
<tr>
<td><?php echo html::select("testStory[]", array(0 => ''), 0, "class='form-control chosen'");?></td>
<td><?php echo html::select("testPri[]", $lang->task->priList, '', "class='form-control chosen'");?></td>
<td>
<div class='input-group'>
<?php echo html::input("testEstStarted[]", '', "class='form-control form-date' placeholder='{$lang->task->estStarted}'");?>
<span class='input-group-addon fix-border'>~</span>
<?php echo html::input("testDeadline[]", '', "class='form-control form-date' placeholder='{$lang->task->deadline}'");?>
</div>
</td>
<td><?php echo html::select("testAssignedTo[]", array('' => ''), '', "class='form-control chosen'");?></td>
<td><?php echo html::input("testEstimate[]", '', "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>
<button type="button" class="btn btn-sm" tabindex="-1" onclick='removeItem(this)'><i class="icon icon-close"></i></button>
</div>
</td>
</tr>
</table>
<?php js::set('stories', $stories);?>
<?php js::set('storyPinYin', (empty($config->isINT) and class_exists('common')) ? common::convert2Pinyin($stories) : array());?>
<?php js::set('testStoryIdList', $testStoryIdList);?>