summaryrefslogtreecommitdiff
path: root/app/Controller/Analytic.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-01-15 21:03:19 -0500
committerFrederic Guillot <fred@kanboard.net>2016-01-15 21:03:19 -0500
commitc58478c0abfb418048d2ee9c6297a30793f10f80 (patch)
treee4eb461636d87e75c267e3e5f2ff957f3e9e049b /app/Controller/Analytic.php
parent1bbd4faf56969427b550a4d006f2d5018cf97371 (diff)
Move analytic logic to separate classes
Diffstat (limited to 'app/Controller/Analytic.php')
-rw-r--r--app/Controller/Analytic.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/app/Controller/Analytic.php b/app/Controller/Analytic.php
index b2e27c58..f9ea511b 100644
--- a/app/Controller/Analytic.php
+++ b/app/Controller/Analytic.php
@@ -88,7 +88,7 @@ class Analytic extends Base
$this->response->html($this->layout('analytic/tasks', array(
'project' => $project,
- 'metrics' => $this->projectAnalytic->getTaskRepartition($project['id']),
+ 'metrics' => $this->taskDistributionAnalytic->build($project['id']),
'title' => t('Task repartition for "%s"', $project['name']),
)));
}
@@ -104,7 +104,7 @@ class Analytic extends Base
$this->response->html($this->layout('analytic/users', array(
'project' => $project,
- 'metrics' => $this->projectAnalytic->getUserRepartition($project['id']),
+ 'metrics' => $this->userDistributionAnalytic->build($project['id']),
'title' => t('User repartition for "%s"', $project['name']),
)));
}
@@ -177,7 +177,7 @@ class Analytic extends Base
{
$project = $this->getProject();
$params = $this->getProjectFilters('analytic', 'compareHours');
- $query = $this->taskFilter->search('status:all')->filterByProject($params['project']['id'])->getQuery();
+ $query = $this->taskFilter->create()->filterByProject($params['project']['id'])->getQuery();
$paginator = $this->paginator
->setUrl('analytic', 'compareHours', array('project_id' => $project['id']))
@@ -186,12 +186,10 @@ class Analytic extends Base
->setQuery($query)
->calculate();
- $stats = $this->projectAnalytic->getHoursByStatus($project['id']);
-
$this->response->html($this->layout('analytic/compare_hours', array(
'project' => $project,
'paginator' => $paginator,
- 'metrics' => $stats,
+ 'metrics' => $this->estimatedTimeComparisonAnalytic->build($project['id']),
'title' => t('Compare hours for "%s"', $project['name']),
)));
}