summaryrefslogtreecommitdiff
path: root/app/Controller/Analytic.php
diff options
context:
space:
mode:
author85pando <85pando@googlemail.com>2016-02-05 10:28:40 +0100
committer85pando <85pando@googlemail.com>2016-02-05 10:28:40 +0100
commit791d13c87bf510d913973b77a5f6d152311a1d87 (patch)
tree81412e8dbd3ac4fa0047030a6068afafd975687e /app/Controller/Analytic.php
parent2074aaaa9a75455097e4e77ca09f4fba3e567052 (diff)
parent12aaec03b19a07635f59b00f532c92c37ac1df5f (diff)
Merge remote-tracking branch 'refs/remotes/upstream/master'
Conflicts: app/Locale/de_DE/translations.php
Diffstat (limited to 'app/Controller/Analytic.php')
-rw-r--r--app/Controller/Analytic.php29
1 files changed, 7 insertions, 22 deletions
diff --git a/app/Controller/Analytic.php b/app/Controller/Analytic.php
index d203fb8e..e7ab9ebc 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;
/**
@@ -12,22 +13,6 @@ use Kanboard\Model\Task as TaskModel;
class Analytic extends Base
{
/**
- * Common layout for analytic views
- *
- * @access private
- * @param string $template Template name
- * @param array $params Template parameters
- * @return string
- */
- private function layout($template, array $params)
- {
- $params['board_selector'] = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId());
- $params['content_for_sublayout'] = $this->template->render($template, $params);
-
- return $this->template->layout('analytic/layout', $params);
- }
-
- /**
* Show average Lead and Cycle time
*
* @access public
@@ -37,7 +22,7 @@ class Analytic extends Base
$project = $this->getProject();
list($from, $to) = $this->getDates();
- $this->response->html($this->layout('analytic/lead_cycle_time', array(
+ $this->response->html($this->helper->layout->analytic('analytic/lead_cycle_time', array(
'values' => array(
'from' => $from,
'to' => $to,
@@ -69,7 +54,7 @@ class Analytic extends Base
->setQuery($query)
->calculate();
- $this->response->html($this->layout('analytic/compare_hours', array(
+ $this->response->html($this->helper->layout->analytic('analytic/compare_hours', array(
'project' => $project,
'paginator' => $paginator,
'metrics' => $this->estimatedTimeComparisonAnalytic->build($project['id']),
@@ -86,7 +71,7 @@ class Analytic extends Base
{
$project = $this->getProject();
- $this->response->html($this->layout('analytic/avg_time_columns', array(
+ $this->response->html($this->helper->layout->analytic('analytic/avg_time_columns', array(
'project' => $project,
'metrics' => $this->averageTimeSpentColumnAnalytic->build($project['id']),
'title' => t('Average time spent into each column for "%s"', $project['name']),
@@ -102,7 +87,7 @@ class Analytic extends Base
{
$project = $this->getProject();
- $this->response->html($this->layout('analytic/tasks', array(
+ $this->response->html($this->helper->layout->analytic('analytic/tasks', array(
'project' => $project,
'metrics' => $this->taskDistributionAnalytic->build($project['id']),
'title' => t('Task repartition for "%s"', $project['name']),
@@ -118,7 +103,7 @@ class Analytic extends Base
{
$project = $this->getProject();
- $this->response->html($this->layout('analytic/users', array(
+ $this->response->html($this->helper->layout->analytic('analytic/users', array(
'project' => $project,
'metrics' => $this->userDistributionAnalytic->build($project['id']),
'title' => t('User repartition for "%s"', $project['name']),
@@ -160,7 +145,7 @@ class Analytic extends Base
$display_graph = $this->projectDailyColumnStats->countDays($project['id'], $from, $to) >= 2;
- $this->response->html($this->layout($template, array(
+ $this->response->html($this->helper->layout->analytic($template, array(
'values' => array(
'from' => $from,
'to' => $to,