diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-12-14 21:54:40 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-12-14 21:54:40 -0500 |
commit | 3897b1de596475e9556383b03cc41aa1df3b50c1 (patch) | |
tree | b1868795a16d38442824830892e586a7af6aec7e /app/Controller/Analytic.php | |
parent | 268a83ffbdf196139cc07c62e44dc3cf7fbb297d (diff) | |
parent | b2b75a4a6e58ffda180e148fe87f996a24fa6973 (diff) |
Merge pull-request #1528
Diffstat (limited to 'app/Controller/Analytic.php')
-rw-r--r-- | app/Controller/Analytic.php | 31 |
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']), + ))); + } } |