Add new analytic component "Estimated vs actual time per column"

This commit is contained in:
Patrick Kuijvenhoven
2021-02-22 05:22:45 +01:00
committed by GitHub
parent 6cadf82a63
commit a267aa368b
9 changed files with 151 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
<?php if (! $is_ajax): ?>
<div class="page-header">
<h2><?= t('Estimated vs actual time per column') ?></h2>
</div>
<?php endif ?>
<?php if (empty($metrics)): ?>
<p class="alert"><?= t('Not enough data to show the graph.') ?></p>
<?php else: ?>
<?= $this->app->component('chart-project-estimated-actual-column', array(
'metrics' => $metrics,
'labelSpent' => t('Hours Spent'),
'labelEstimated' => t('Hours Estimated'),
)) ?>
<table class="table-striped">
<tr>
<th><?= t('Column') ?></th>
<th><?= t('Hours Spent') ?></th>
<th><?= t('Hours Estimated') ?></th>
</tr>
<?php foreach ($metrics as $column): ?>
<tr>
<td><?= $this->text->e($column['title']) ?></td>
<td><?= $this->dt->durationHours($column['hours_spent']) ?></td>
<td><?= $this->dt->durationHours($column['hours_estimated']) ?></td>
</tr>
<?php endforeach ?>
</table>
<?php endif ?>

View File

@@ -21,6 +21,9 @@
<li <?= $this->app->checkMenuSelection('AnalyticController', 'timeComparison') ?>>
<?= $this->modal->replaceLink(t('Estimated vs actual time'), 'AnalyticController', 'timeComparison', array('project_id' => $project['id'])) ?>
</li>
<li <?= $this->app->checkMenuSelection('AnalyticController', 'estimatedVsActualByColumn') ?>>
<?= $this->modal->replaceLink(t('Estimated vs actual time per column'), 'AnalyticController', 'estimatedVsActualByColumn', array('project_id' => $project['id'])) ?>
</li>
<?= $this->hook->render('template:analytic:sidebar', array('project' => $project)) ?>
</ul>