summaryrefslogtreecommitdiff
path: root/app/Controller/Analytic.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-12-14 21:54:40 -0500
committerFrederic Guillot <fred@kanboard.net>2015-12-14 21:54:40 -0500
commit3897b1de596475e9556383b03cc41aa1df3b50c1 (patch)
treeb1868795a16d38442824830892e586a7af6aec7e /app/Controller/Analytic.php
parent268a83ffbdf196139cc07c62e44dc3cf7fbb297d (diff)
parentb2b75a4a6e58ffda180e148fe87f996a24fa6973 (diff)
Merge pull-request #1528
Diffstat (limited to 'app/Controller/Analytic.php')
-rw-r--r--app/Controller/Analytic.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/app/Controller/Analytic.php b/app/Controller/Analytic.php
index e03d8cab..80ef3918 100644
--- a/app/Controller/Analytic.php
+++ b/app/Controller/Analytic.php
@@ -1,6 +1,7 @@
<?php
namespace Kanboard\Controller;
+use Kanboard\Model\Task as TaskModel;
/**
* Project Analytic controller
@@ -166,4 +167,34 @@ class Analytic extends Base
'title' => t($title, $project['name']),
)));
}
+
+ /**
+ * Show comparison between actual and estimated hours chart
+ *
+ * @access public
+ */
+
+ public function compareHours()
+ {
+ $project = $this->getProject();
+ $params = $this->getProjectFilters('analytic', 'compareHours');
+ $query = $this->taskFilter->search('status:all')->filterByProject($params['project']['id'])->getQuery();
+
+
+ $paginator = $this->paginator
+ ->setUrl('analytics', 'compare_hours')
+ ->setMax(30)
+ ->setOrder(TaskModel::TABLE.'.id')
+ ->setQuery($query)
+ ->calculate();
+
+ $stats = $this->projectAnalytic->getHoursByStatus($project['id']);
+
+ $this->response->html($this->layout('analytic/compare_hours', array(
+ 'project' => $project,
+ 'paginator' => $paginator,
+ 'metrics' => $stats,
+ 'title' => t('Compare hours for "%s"', $project['name']),
+ )));
+ }
}