summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-11-13 20:37:37 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-11-13 20:37:37 -0500
commit1487cb27634161ef558c367150213bc7077e4198 (patch)
tree5a5684152412abc3bc336cdb63dfe05b7bbb0c4a /app/Template
parente4efc73a90b0ef62b5d828db53a365184be40137 (diff)
Add graph for user repartition
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/analytic/sidebar.php5
-rw-r--r--app/Template/analytic/tasks.php (renamed from app/Template/analytic/repartition.php)4
-rw-r--r--app/Template/analytic/users.php29
-rw-r--r--app/Template/board/filters.php2
4 files changed, 36 insertions, 4 deletions
diff --git a/app/Template/analytic/sidebar.php b/app/Template/analytic/sidebar.php
index df6835ee..dded245a 100644
--- a/app/Template/analytic/sidebar.php
+++ b/app/Template/analytic/sidebar.php
@@ -2,7 +2,10 @@
<h2><?= t('Reportings') ?></h2>
<ul>
<li>
- <?= Helper\a(t('Task distribution'), 'analytic', 'repartition', array('project_id' => $project['id'])) ?>
+ <?= Helper\a(t('Task distribution'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
+ </li>
+ <li>
+ <?= Helper\a(t('User repartition'), 'analytic', 'users', array('project_id' => $project['id'])) ?>
</li>
</ul>
</div> \ No newline at end of file
diff --git a/app/Template/analytic/repartition.php b/app/Template/analytic/tasks.php
index f20b6a0c..7ae9c254 100644
--- a/app/Template/analytic/repartition.php
+++ b/app/Template/analytic/tasks.php
@@ -1,9 +1,9 @@
<div class="page-header">
<h2><?= t('Task distribution') ?></h2>
</div>
-<section id="analytic-repartition">
+<section id="analytic-task-repartition">
-<div id="chart" data-url="<?= Helper\u('analytic', 'repartition', array('project_id' => $project['id'])) ?>"></div>
+<div id="chart" data-url="<?= Helper\u('analytic', 'tasks', array('project_id' => $project['id'])) ?>"></div>
<table>
<tr>
diff --git a/app/Template/analytic/users.php b/app/Template/analytic/users.php
new file mode 100644
index 00000000..89f00686
--- /dev/null
+++ b/app/Template/analytic/users.php
@@ -0,0 +1,29 @@
+<div class="page-header">
+ <h2><?= t('User repartition') ?></h2>
+</div>
+<section id="analytic-user-repartition">
+
+<div id="chart" data-url="<?= Helper\u('analytic', 'users', array('project_id' => $project['id'])) ?>"></div>
+
+<table>
+ <tr>
+ <th><?= t('User') ?></th>
+ <th><?= t('Number of tasks') ?></th>
+ <th><?= t('Percentage') ?></th>
+ </tr>
+ <?php foreach ($metrics as $metric): ?>
+ <tr>
+ <td>
+ <?= Helper\escape($metric['user']) ?>
+ </td>
+ <td>
+ <?= $metric['nb_tasks'] ?>
+ </td>
+ <td>
+ <?= n($metric['percentage']) ?>%
+ </td>
+ </tr>
+ <?php endforeach ?>
+</table>
+
+</section>
diff --git a/app/Template/board/filters.php b/app/Template/board/filters.php
index 21e51d98..76cbca2d 100644
--- a/app/Template/board/filters.php
+++ b/app/Template/board/filters.php
@@ -25,7 +25,7 @@
</li>
<li>
<i class="fa fa-line-chart fa-fw"></i>
- <?= Helper\a(t('Analytics'), 'analytic', 'repartition', array('project_id' => $project['id'])) ?>
+ <?= Helper\a(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
</li>
<?php if (Helper\is_admin()): ?>
<li><i class="fa fa-cog fa-fw"></i>