summaryrefslogtreecommitdiff
path: root/app/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller')
-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']),
+ )));
+ }
}