Merge branch 'master_xieqiyu_25004' into 'master'

* Fix bug#25004.

See merge request easycorp/zentaopms!4676
This commit is contained in:
王怡栋
2022-07-28 00:52:40 +00:00
6 changed files with 58 additions and 9 deletions
+3 -2
View File
@@ -1434,13 +1434,14 @@ class programModel extends model
}
/* Compute totalReal and progress. */
foreach($hours as $hour)
$progressList = $this->loadModel('project')->getWaterfallProgress(array_keys($hours));
foreach($hours as $projectID => $hour)
{
$hour->totalEstimate = round($hour->totalEstimate, 1) ;
$hour->totalConsumed = round($hour->totalConsumed, 1);
$hour->totalLeft = round($hour->totalLeft, 1);
$hour->totalReal = $hour->totalConsumed + $hour->totalLeft;
$hour->progress = $hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 2) * 100 : 0;
$hour->progress = $projects[$projectID]->model == 'waterfall' ? $progressList[$projectID] : ($hour->totalReal ? round($hour->totalConsumed / $hour->totalReal, 2) * 100 : 0);
}
/* Get the number of left tasks. */
+2 -2
View File
@@ -85,8 +85,8 @@
<td><?php echo $program->end == LONG_TIME ? $lang->program->longTime : $program->end;?></td>
<td>
<?php if(isset($progressList[$program->id])):?>
<div class='progress-pie' data-doughnut-size='85' data-color='#00DA88' data-value='<?php echo $progressList[$program->id]?>' data-width='26' data-height='26' data-back-color='#e8edf3'>
<div class='progress-info'><?php echo $progressList[$program->id];?></div>
<div class='progress-pie' data-doughnut-size='85' data-color='#00DA88' data-value='<?php echo round($progressList[$program->id])?>' data-width='26' data-height='26' data-back-color='#e8edf3'>
<div class='progress-info'><?php echo round($progressList[$program->id]);?></div>
</div>
<?php endif;?>
</td>