diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/Analytic.php | 10 | ||||
-rw-r--r-- | app/Model/ProjectAnalytic.php | 14 |
2 files changed, 11 insertions, 13 deletions
diff --git a/app/Controller/Analytic.php b/app/Controller/Analytic.php index 80ef3918..bebb13fa 100644 --- a/app/Controller/Analytic.php +++ b/app/Controller/Analytic.php @@ -173,21 +173,19 @@ class Analytic extends Base * * @access public */ - public function compareHours() { $project = $this->getProject(); - $params = $this->getProjectFilters('analytic', 'compareHours'); + $params = $this->getProjectFilters('analytic', 'compareHours'); $query = $this->taskFilter->search('status:all')->filterByProject($params['project']['id'])->getQuery(); - $paginator = $this->paginator - ->setUrl('analytics', 'compare_hours') + ->setUrl('analytic', 'compareHours', array('project_id' => $project['id'])) ->setMax(30) ->setOrder(TaskModel::TABLE.'.id') ->setQuery($query) ->calculate(); - + $stats = $this->projectAnalytic->getHoursByStatus($project['id']); $this->response->html($this->layout('analytic/compare_hours', array( @@ -195,6 +193,6 @@ class Analytic extends Base 'paginator' => $paginator, 'metrics' => $stats, 'title' => t('Compare hours for "%s"', $project['name']), - ))); + ))); } } diff --git a/app/Model/ProjectAnalytic.php b/app/Model/ProjectAnalytic.php index 79277e79..d23695dc 100644 --- a/app/Model/ProjectAnalytic.php +++ b/app/Model/ProjectAnalytic.php @@ -202,14 +202,14 @@ class ProjectAnalytic extends Base // Init values $stats['closed'] = array( - 'time_spent' => 0, - 'time_estimated' => 0, - ); - $stats['open'] = array( - 'time_spent' => 0, - 'time_estimated' => 0, - ); + 'time_spent' => 0, + 'time_estimated' => 0, + ); + $stats['open'] = array( + 'time_spent' => 0, + 'time_estimated' => 0, + ); // Add times spent and estimated to each status foreach ($tasks as &$task) { |