diff options
Diffstat (limited to 'app/Controller/Analytic.php')
-rw-r--r-- | app/Controller/Analytic.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/Controller/Analytic.php b/app/Controller/Analytic.php index e03d8cab..603ace01 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,27 @@ class Analytic extends Base 'title' => t($title, $project['name']), ))); } + + 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, + ))); + } } |