summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-05 21:22:31 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-05 21:22:31 -0400
commit663a1c20e6ba0fbf65afcb43f0f48d34f21dcb53 (patch)
tree86b86c9c83770456242fb65779aac68dc497fb54 /app/Template
parentbb8b4c0e36afc05ff5b0cb3ac6465351a696b001 (diff)
Add new analytic page: Average time spent into each column
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/analytic/avg_time_columns.php29
-rw-r--r--app/Template/analytic/sidebar.php3
-rw-r--r--app/Template/task/analytics.php18
3 files changed, 43 insertions, 7 deletions
diff --git a/app/Template/analytic/avg_time_columns.php b/app/Template/analytic/avg_time_columns.php
new file mode 100644
index 00000000..e74e7950
--- /dev/null
+++ b/app/Template/analytic/avg_time_columns.php
@@ -0,0 +1,29 @@
+<div class="page-header">
+ <h2><?= t('Average time spent into each column') ?></h2>
+</div>
+
+<?php if (empty($metrics)): ?>
+ <p class="alert"><?= t('Not enough data to show the graph.') ?></p>
+<?php else: ?>
+ <section id="analytic-avg-time-column">
+
+ <div id="chart" data-metrics='<?= json_encode($metrics) ?>' data-label="<?= t('Average time spent') ?>"></div>
+
+ <table class="table-stripped">
+ <tr>
+ <th><?= t('Column') ?></th>
+ <th><?= t('Average time spent') ?></th>
+ </tr>
+ <?php foreach ($metrics as $column): ?>
+ <tr>
+ <td><?= $this->e($column['title']) ?></td>
+ <td><?= $this->dt->duration($column['average']) ?></td>
+ </tr>
+ <?php endforeach ?>
+ </table>
+
+ <p class="alert alert-info">
+ <?= t('This chart show the average time spent into each column for the last %d tasks.', 1000) ?>
+ </p>
+ </section>
+<?php endif ?>
diff --git a/app/Template/analytic/sidebar.php b/app/Template/analytic/sidebar.php
index 2d1a7c96..1ffce710 100644
--- a/app/Template/analytic/sidebar.php
+++ b/app/Template/analytic/sidebar.php
@@ -13,5 +13,8 @@
<li>
<?= $this->url->link(t('Burndown chart'), 'analytic', 'burndown', array('project_id' => $project['id'])) ?>
</li>
+ <li>
+ <?= $this->url->link(t('Average time into each column'), 'analytic', 'averageTimeByColumn', array('project_id' => $project['id'])) ?>
+ </li>
</ul>
</div> \ No newline at end of file
diff --git a/app/Template/task/analytics.php b/app/Template/task/analytics.php
index dbee0e9c..3b1d2855 100644
--- a/app/Template/task/analytics.php
+++ b/app/Template/task/analytics.php
@@ -9,13 +9,14 @@
</ul>
</div>
-<h3><?= t('Average time spent for each column') ?></h3>
+<h3 id="analytic-task-time-column"><?= t('Time spent into each column') ?></h3>
+<div id="chart" data-metrics='<?= json_encode($time_spent_columns) ?>' data-label="<?= t('Time spent') ?>"></div>
<table class="table-stripped">
<tr>
<th><?= t('Column') ?></th>
- <th><?= t('Average time spent') ?></th>
+ <th><?= t('Time spent') ?></th>
</tr>
- <?php foreach ($column_averages as $column): ?>
+ <?php foreach ($time_spent_columns as $column): ?>
<tr>
<td><?= $this->e($column['title']) ?></td>
<td><?= $this->dt->duration($column['time_spent']) ?></td>
@@ -25,8 +26,11 @@
<div class="alert alert-info">
<ul>
- <li><?= t('The lead time is the time between the task creation and the completion.') ?></li>
- <li><?= t('The cycle time is the time between the start date and the completion.') ?></li>
- <li><?= t('If the task is not closed the current time is used.') ?></li>
+ <li><?= t('The lead time is the duration between the task creation and the completion.') ?></li>
+ <li><?= t('The cycle time is the duration between the start date and the completion.') ?></li>
+ <li><?= t('If the task is not closed the current time is used instead of the completion date.') ?></li>
</ul>
-</div> \ No newline at end of file
+</div>
+
+<?= $this->asset->js('assets/js/vendor/d3.v3.min.js') ?>
+<?= $this->asset->js('assets/js/vendor/c3.min.js') ?> \ No newline at end of file