* Fix bug #12727.
This commit is contained in:
@@ -20,11 +20,13 @@ function computeAverage()
|
||||
$('.new-estimate').each(function()
|
||||
{
|
||||
var value = $(this).find('input').val();
|
||||
if(!value) return false;
|
||||
value = parseFloat(value);
|
||||
if(isNaN(value)) value = 0;
|
||||
summary += value;
|
||||
count += 1;
|
||||
if(value)
|
||||
{
|
||||
value = parseFloat(value);
|
||||
if(isNaN(value)) value = 0;
|
||||
summary += value;
|
||||
count += 1;
|
||||
}
|
||||
})
|
||||
|
||||
if(count) average = summary / count;
|
||||
|
||||
@@ -43,35 +43,29 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if(!empty($estimateInfo->estimate)):?>
|
||||
<?php foreach($estimateInfo->estimate as $estimate):?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo zget($users, $estimate->account);?></td>
|
||||
<?php echo html::hidden('account[]', $estimate->account, "class='form-control'");?>
|
||||
<td><?php echo $estimate->estimate;?></td>
|
||||
<td class='new-estimate hide'><?php echo html::input('estimate[]', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo $lang->execution->average;?></td>
|
||||
<td><?php echo $estimateInfo->average;?></td>
|
||||
<td class='new-estimate hide'><p id='showAverage'></p></td>
|
||||
<?php echo html::hidden('average', '', "class='form-control'");?>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<?php foreach($team as $user):?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo zget($users, $user->account);?></td>
|
||||
<?php echo html::hidden('account[]', $user->account, "class='form-control'");?>
|
||||
<?php if(!empty($estimateInfo->estimate)):?>
|
||||
<td><?php echo $estimateInfo->estimate->{$user->account}->estimate;?></td>
|
||||
<td class='new-estimate hide'><?php echo html::input('estimate[]', '', "class='form-control'");?></td>
|
||||
<?php else:?>
|
||||
<td class='new-estimate'><?php echo html::input('estimate[]', '', "class='form-control'");?></td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr class='text-center'>
|
||||
<td><strong><?php echo $lang->execution->average;?></strong></td>
|
||||
<?php if(!empty($estimateInfo->estimate)):?>
|
||||
<td><?php echo $estimateInfo->average;?></td>
|
||||
<td class='new-estimate hide'><p id='showAverage'></p></td>
|
||||
<?php echo html::hidden('average', '', "class='form-control'");?>
|
||||
<?php else:?>
|
||||
<td><p id='showAverage'></p></td>
|
||||
<?php echo html::hidden('average', '', "class='form-control'");?>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
|
||||
@@ -4042,13 +4042,13 @@ class storyModel extends model
|
||||
$estimates = array();
|
||||
foreach($data->account as $key => $account)
|
||||
{
|
||||
$estimates[$key]['account'] = $account;
|
||||
if(!is_numeric($data->estimate[$key]))
|
||||
$estimates[$account]['account'] = $account;
|
||||
if(!empty($data->estimate[$key]) and !is_numeric($data->estimate[$key]))
|
||||
{
|
||||
dao::$errors[] = $this->lang->story->estimateMustBeNumber;
|
||||
return false;
|
||||
}
|
||||
$estimates[$key]['estimate'] = $data->estimate[$key];
|
||||
$estimates[$account]['estimate'] = $data->estimate[$key];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user