This commit is contained in:
tianshujie
2022-07-12 14:22:37 +08:00
parent 1f0652faa8
commit 1d1441f17f
5 changed files with 54 additions and 14 deletions
+1
View File
@@ -1,3 +1,4 @@
.pl-10px {padding-left: 10px;}
#showAllModuleBox{width:60px;}
#showAllModuleBox .no-margin {padding-left:22px;}
#taskTeamEditor .sortable .input-group .input-group-addon.required:after {top: 10px; right: 2px; z-index: 3;}
+19 -7
View File
@@ -530,8 +530,9 @@ $(document).on('click', '#testStory_chosen', function()
$('#modalTeam .btn').click(function()
{
var team = '';
var time = 0;
var team = '';
var time = 0;
var error = false;
/* Unique team. */
$('select[name^=team]').each(function(i)
@@ -548,9 +549,10 @@ $('#modalTeam .btn').click(function()
$('select[name^=team]').each(function()
{
if($(this).find('option:selected').text() != '')
var account = $(this).find('option:selected').text();
if(account != '')
{
team += ' ' + $(this).find('option:selected').text();
team += ' ' + account;
}
estimate = parseFloat($(this).parents('td').next('td').find('[name^=teamEstimate]').val());
@@ -559,9 +561,16 @@ $('#modalTeam .btn').click(function()
time += estimate;
}
$('#teamMember').val(team);
$('#estimate').val(time);
})
var requiredFieldList = ',' + requiredFields + ',';
if(account && requiredFieldList.indexOf(',estimate,') >= 0 && (estimate == 0 || isNaN(estimate)))
{
alert(estimateNotEmpty);
error = true;
return false;
}
});
if(error) return false;
var teamList = team.split(" ");
if(teamList.length <= 2)
{
@@ -570,6 +579,9 @@ $('#modalTeam .btn').click(function()
}
else
{
$('#teamMember').val(team);
$('#estimate').val(time);
if(config.onlybody == 'yes' && vision == 'lite')
{
$('.close').parent().click();
+19 -4
View File
@@ -176,6 +176,7 @@ $('#confirmButton').click(function()
var totalEstimate = 0;
var totalConsumed = oldConsumed;
var totalLeft = 0;
var error = false;
$('select[name^=team]').each(function()
{
if($(this).find('option:selected').text() == '') return;
@@ -190,22 +191,36 @@ $('#confirmButton').click(function()
left = parseFloat($(this).parents('td').next('td').find('[name^=teamLeft]').val());
if(!isNaN(left)) totalLeft += left;
var requiredFieldList = ',' + requiredFields + ',';
if(requiredFieldList.indexOf(',estimate,') >= 0 && (estimate == 0 || isNaN(estimate)))
{
$(this).val('').trigger("chosen:updated");
alert(estimateNotEmpty);
error = true;
return false;
}
})
$('#estimate').val(totalEstimate);
$('#consumedSpan').html(totalConsumed);
$('#left').val(totalLeft);
updateAssignedTo();
if(error) return false;
if(memberCount < 2)
{
alert(teamMemberError);
return false;
}
if(totalLeft == 0 && (taskStatus == 'doing' || taskStatus == 'pause'))
{
alert(totalLeftError);
return false;
}
$('#estimate').val(totalEstimate);
$('#consumedSpan').html(totalConsumed);
$('#left').val(totalLeft);
updateAssignedTo();
$('.close').click();
});
+4 -1
View File
@@ -18,12 +18,15 @@
<?php js::set('teamMemberError', $lang->task->error->teamMember);?>
<?php js::set('vision', $config->vision);?>
<?php js::set('requiredFields', $config->task->create->requiredFields);?>
<?php js::set('estimateNotEmpty', sprintf($lang->error->notempty, $lang->task->estimate))?>
<?php if(!empty($storyID)):?>
<style> .title-group.required > .required:after {right: 110px;}</style>
<?php endif;?>
<?php
$requiredFields = array();
foreach(explode(',', $config->task->create->requiredFields) as $field)
{
if($field) $requiredFields[$field] = '';
if($field and strpos($showFields, $field) === false) $showFields .= ',' . $field;
}
?>
@@ -283,7 +286,7 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
<tbody class='sortable'>
<tr class='template'>
<td><?php echo html::select("team[]", $members, '', "class='form-control chosen'");?></td>
<td>
<td class="<?php echo zget($requiredFields, 'estimate', '', ' required')?>">
<div class='input-group'>
<?php echo html::input("teamEstimate[]", '', "class='form-control text-center' placeholder='{$lang->task->estimateAB}'") ?>
<span class='input-group-addon'><?php echo $lang->task->hour;?></span>
+11 -2
View File
@@ -27,6 +27,15 @@
<?php js::set('newRowCount', count($task->team) < 6 ? 6 - count($task->team) : 1);?>
<?php js::set('teamMemberError', $lang->task->error->teamMember);?>
<?php js::set('totalLeftError', sprintf($this->lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]));?>
<?php js::set('estimateNotEmpty', sprintf($lang->error->notempty, $lang->task->estimate))?>
<?php js::set('requiredFields', $config->task->edit->requiredFields);?>
<?php
$requiredFields = array();
foreach(explode(',', $config->task->edit->requiredFields) as $field)
{
if($field) $requiredFields[$field] = '';
}
?>
<div class='main-content' id='mainContent'>
<form method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
<div class='main-header'>
@@ -275,7 +284,7 @@
<td class='w-250px'><?php echo html::select("team[]", $members, $member->account, "class='form-control chosen'")?></td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->task->estimate?></span>
<span class="input-group-addon <?php echo zget($requiredFields, 'estimate', '', ' required');?>"><?php echo $lang->task->estimate?></span>
<?php echo html::input("teamEstimate[]", (float)$member->estimate, "class='form-control text-center' placeholder='{$lang->task->hour}'")?>
<span class='input-group-addon fix-border'><?php echo $lang->task->consumed?></span>
<?php echo html::input("teamConsumed[]", (float)$member->consumed, "class='form-control text-center' readonly placeholder='{$lang->task->hour}'")?>
@@ -294,7 +303,7 @@
<td class='w-250px'><?php echo html::select("team[]", $members, '', "class='form-control chosen'")?></td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->task->estimate?></span>
<span class="input-group-addon <?php echo zget($requiredFields, 'estimate', '', ' required');?>"><?php echo $lang->task->estimate?></span>
<?php echo html::input("teamEstimate[]", '', "class='form-control text-center' placeholder='{$lang->task->hour}'")?>
<span class='input-group-addon fix-border'><?php echo $lang->task->consumed?></span>
<?php echo html::input("teamConsumed[]", '', "class='form-control text-center' placeholder='{$lang->task->hour}'")?>