diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/ActivityController.php | 3 | ||||
-rw-r--r-- | app/Core/Paginator.php | 12 | ||||
-rw-r--r-- | app/Helper/LayoutHelper.php | 14 | ||||
-rw-r--r-- | app/Helper/ModalHelper.php | 5 | ||||
-rw-r--r-- | app/Template/analytic/avg_time_columns.php | 28 | ||||
-rw-r--r-- | app/Template/analytic/burndown.php | 24 | ||||
-rw-r--r-- | app/Template/analytic/cfd.php | 24 | ||||
-rw-r--r-- | app/Template/analytic/layout.php | 18 | ||||
-rw-r--r-- | app/Template/analytic/lead_cycle_time.php | 24 | ||||
-rw-r--r-- | app/Template/analytic/sidebar.php | 15 | ||||
-rw-r--r-- | app/Template/analytic/task_distribution.php | 8 | ||||
-rw-r--r-- | app/Template/analytic/time_comparison.php | 14 | ||||
-rw-r--r-- | app/Template/analytic/user_distribution.php | 8 | ||||
-rw-r--r-- | app/Template/project/dropdown.php | 2 | ||||
-rw-r--r-- | app/Template/project_header/dropdown.php | 2 |
15 files changed, 103 insertions, 98 deletions
diff --git a/app/Controller/ActivityController.php b/app/Controller/ActivityController.php index edf0fbb4..476e4aac 100644 --- a/app/Controller/ActivityController.php +++ b/app/Controller/ActivityController.php @@ -19,9 +19,10 @@ class ActivityController extends BaseController { $project = $this->getProject(); - $this->response->html($this->template->render('activity/project', array( + $this->response->html($this->helper->layout->app('activity/project', array( 'events' => $this->helper->projectActivity->getProjectEvents($project['id']), 'project' => $project, + 'title' => t('%s\'s activity', $project['name']) ))); } diff --git a/app/Core/Paginator.php b/app/Core/Paginator.php index 046c539c..9075a713 100644 --- a/app/Core/Paginator.php +++ b/app/Core/Paginator.php @@ -374,7 +374,9 @@ class Paginator '← '.t('Previous'), $this->controller, $this->action, - $this->getUrlParams($this->page - 1, $this->order, $this->direction) + $this->getUrlParams($this->page - 1, $this->order, $this->direction), + false, + 'js-modal-replace' ); } else { $html .= '← '.t('Previous'); @@ -400,7 +402,9 @@ class Paginator t('Next').' →', $this->controller, $this->action, - $this->getUrlParams($this->page + 1, $this->order, $this->direction) + $this->getUrlParams($this->page + 1, $this->order, $this->direction), + false, + 'js-modal-replace' ); } else { $html .= t('Next').' →'; @@ -486,7 +490,9 @@ class Paginator $label, $this->controller, $this->action, - $this->getUrlParams($this->page, $column, $direction) + $this->getUrlParams($this->page, $column, $direction), + false, + 'js-modal-replace' ); } } diff --git a/app/Helper/LayoutHelper.php b/app/Helper/LayoutHelper.php index 8d2e7e00..8be71757 100644 --- a/app/Helper/LayoutHelper.php +++ b/app/Helper/LayoutHelper.php @@ -22,7 +22,10 @@ class LayoutHelper extends Base */ public function app($template, array $params = array()) { - if ($this->request->isAjax()) { + $isAjax = $this->request->isAjax(); + $params['is_ajax'] = $isAjax; + + if ($isAjax) { return $this->template->render($template, $params); } @@ -160,7 +163,7 @@ class LayoutHelper extends Base $params['title'] = $params['project']['name'].' > '.$params['title']; } - return $this->subLayout('analytic/layout', 'analytic/sidebar', $template, $params); + return $this->subLayout('analytic/layout', 'analytic/sidebar', $template, $params, true); } /** @@ -188,13 +191,16 @@ class LayoutHelper extends Base * @param string $sidebar * @param string $template * @param array $params + * @param bool $ignoreAjax * @return string */ - public function subLayout($sublayout, $sidebar, $template, array $params = array()) + public function subLayout($sublayout, $sidebar, $template, array $params = array(), $ignoreAjax = false) { + $isAjax = $this->request->isAjax(); + $params['is_ajax'] = $isAjax; $content = $this->template->render($template, $params); - if ($this->request->isAjax()) { + if (!$ignoreAjax && $isAjax) { return $content; } diff --git a/app/Helper/ModalHelper.php b/app/Helper/ModalHelper.php index b3241b9d..efbe2c4d 100644 --- a/app/Helper/ModalHelper.php +++ b/app/Helper/ModalHelper.php @@ -75,4 +75,9 @@ class ModalHelper extends Base { return $this->helper->url->link($label, $controller, $action, $params, false, 'js-modal-confirm'); } + + public function replaceLink($label, $controller, $action, array $params = array()) + { + return $this->helper->url->link($label, $controller, $action, $params, false, 'js-modal-replace'); + } } diff --git a/app/Template/analytic/avg_time_columns.php b/app/Template/analytic/avg_time_columns.php index 929331a9..1af69c8b 100644 --- a/app/Template/analytic/avg_time_columns.php +++ b/app/Template/analytic/avg_time_columns.php @@ -1,6 +1,8 @@ -<div class="page-header"> - <h2><?= t('Average time spent into each column') ?></h2> -</div> +<?php if (! $is_ajax): ?> + <div class="page-header"> + <h2><?= t('Average time spent into each column') ?></h2> + </div> +<?php endif ?> <?php if (empty($metrics)): ?> <p class="alert"><?= t('Not enough data to show the graph.') ?></p> @@ -11,16 +13,16 @@ )) ?> <table class="table-striped"> - <tr> - <th><?= t('Column') ?></th> - <th><?= t('Average time spent') ?></th> - </tr> - <?php foreach ($metrics as $column): ?> - <tr> - <td><?= $this->text->e($column['title']) ?></td> - <td><?= $this->dt->duration($column['average']) ?></td> - </tr> - <?php endforeach ?> + <tr> + <th><?= t('Column') ?></th> + <th><?= t('Average time spent') ?></th> + </tr> + <?php foreach ($metrics as $column): ?> + <tr> + <td><?= $this->text->e($column['title']) ?></td> + <td><?= $this->dt->duration($column['average']) ?></td> + </tr> + <?php endforeach ?> </table> <p class="alert alert-info"> diff --git a/app/Template/analytic/burndown.php b/app/Template/analytic/burndown.php index 674c76dd..d62c9ba0 100644 --- a/app/Template/analytic/burndown.php +++ b/app/Template/analytic/burndown.php @@ -1,6 +1,8 @@ -<div class="page-header"> - <h2><?= t('Burndown chart') ?></h2> -</div> +<?php if (! $is_ajax): ?> + <div class="page-header"> + <h2><?= t('Burndown chart') ?></h2> + </div> +<?php endif ?> <?php if (! $display_graph): ?> <p class="alert"><?= t('You need at least 2 days of data to show the chart.') ?></p> @@ -15,20 +17,10 @@ <hr/> <form method="post" class="form-inline" action="<?= $this->url->href('AnalyticController', 'burndown', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - - <div class="form-inline-group"> - <?= $this->form->date(t('Start date'), 'from', $values) ?> - </div> - - <div class="form-inline-group"> - <?= $this->form->date(t('End date'), 'to', $values) ?> - </div> - - <div class="form-inline-group"> - <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> - </div> + <?= $this->form->date(t('Start date'), 'from', $values) ?> + <?= $this->form->date(t('End date'), 'to', $values) ?> + <?= $this->modal->submitButtons(array('submitLabel' => t('Execute'))) ?> </form> <p class="alert alert-info"><?= t('This chart show the task complexity over the time (Work Remaining).') ?></p> diff --git a/app/Template/analytic/cfd.php b/app/Template/analytic/cfd.php index 5eb42e82..dcd7b58f 100644 --- a/app/Template/analytic/cfd.php +++ b/app/Template/analytic/cfd.php @@ -1,6 +1,8 @@ -<div class="page-header"> - <h2><?= t('Cumulative flow diagram') ?></h2> -</div> +<?php if (! $is_ajax): ?> + <div class="page-header"> + <h2><?= t('Cumulative flow diagram') ?></h2> + </div> +<?php endif ?> <?php if (! $display_graph): ?> <p class="alert"><?= t('You need at least 2 days of data to show the chart.') ?></p> @@ -14,18 +16,8 @@ <hr/> <form method="post" class="form-inline" action="<?= $this->url->href('AnalyticController', 'cfd', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - - <div class="form-inline-group"> - <?= $this->form->date(t('Start date'), 'from', $values) ?> - </div> - - <div class="form-inline-group"> - <?= $this->form->date(t('End date'), 'to', $values) ?> - </div> - - <div class="form-inline-group"> - <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> - </div> + <?= $this->form->date(t('Start date'), 'from', $values) ?> + <?= $this->form->date(t('End date'), 'to', $values) ?> + <?= $this->modal->submitButtons(array('submitLabel' => t('Execute'))) ?> </form> diff --git a/app/Template/analytic/layout.php b/app/Template/analytic/layout.php index e3c6099f..7159094c 100644 --- a/app/Template/analytic/layout.php +++ b/app/Template/analytic/layout.php @@ -1,10 +1,14 @@ -<section id="main"> +<?php if ($is_ajax): ?> + <div class="page-header"> + <h2><?= $title ?></h2> + </div> +<?php else: ?> <?= $this->projectHeader->render($project, 'TaskListController', 'show') ?> - <section class="sidebar-container"> - <?= $this->render($sidebar_template, array('project' => $project)) ?> +<?php endif ?> +<section class="sidebar-container"> + <?= $this->render($sidebar_template, array('project' => $project)) ?> - <div class="sidebar-content"> - <?= $content_for_sublayout ?> - </div> - </section> + <div class="sidebar-content"> + <?= $content_for_sublayout ?> + </div> </section> diff --git a/app/Template/analytic/lead_cycle_time.php b/app/Template/analytic/lead_cycle_time.php index 8884a441..780b47b6 100644 --- a/app/Template/analytic/lead_cycle_time.php +++ b/app/Template/analytic/lead_cycle_time.php @@ -1,6 +1,8 @@ -<div class="page-header"> - <h2><?= t('Average Lead and Cycle time') ?></h2> -</div> +<?php if (! $is_ajax): ?> + <div class="page-header"> + <h2><?= t('Average Lead and Cycle time') ?></h2> + </div> +<?php endif ?> <div class="panel"> <ul> @@ -19,20 +21,10 @@ )) ?> <form method="post" class="form-inline" action="<?= $this->url->href('AnalyticController', 'leadAndCycleTime', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->form->csrf() ?> - - <div class="form-inline-group"> - <?= $this->form->date(t('Start date'), 'from', $values) ?> - </div> - - <div class="form-inline-group"> - <?= $this->form->date(t('End date'), 'to', $values) ?> - </div> - - <div class="form-inline-group"> - <button type="submit" class="btn btn-blue"><?= t('Execute') ?></button> - </div> + <?= $this->form->date(t('Start date'), 'from', $values) ?> + <?= $this->form->date(t('End date'), 'to', $values) ?> + <?= $this->modal->submitButtons(array('submitLabel' => t('Execute'))) ?> </form> <p class="alert alert-info"> diff --git a/app/Template/analytic/sidebar.php b/app/Template/analytic/sidebar.php index f768a11d..d5ce88cb 100644 --- a/app/Template/analytic/sidebar.php +++ b/app/Template/analytic/sidebar.php @@ -1,28 +1,27 @@ <div class="sidebar"> <ul> <li <?= $this->app->checkMenuSelection('AnalyticController', 'taskDistribution') ?>> - <?= $this->url->link(t('Task distribution'), 'AnalyticController', 'taskDistribution', array('project_id' => $project['id'])) ?> + <?= $this->modal->replaceLink(t('Task distribution'), 'AnalyticController', 'taskDistribution', array('project_id' => $project['id'])) ?> </li> <li <?= $this->app->checkMenuSelection('AnalyticController', 'userDistribution') ?>> - <?= $this->url->link(t('User repartition'), 'AnalyticController', 'userDistribution', array('project_id' => $project['id'])) ?> + <?= $this->modal->replaceLink(t('User repartition'), 'AnalyticController', 'userDistribution', array('project_id' => $project['id'])) ?> </li> <li <?= $this->app->checkMenuSelection('AnalyticController', 'cfd') ?>> - <?= $this->url->link(t('Cumulative flow diagram'), 'AnalyticController', 'cfd', array('project_id' => $project['id'])) ?> + <?= $this->modal->replaceLink(t('Cumulative flow diagram'), 'AnalyticController', 'cfd', array('project_id' => $project['id'])) ?> </li> <li <?= $this->app->checkMenuSelection('AnalyticController', 'burndown') ?>> - <?= $this->url->link(t('Burndown chart'), 'AnalyticController', 'burndown', array('project_id' => $project['id'])) ?> + <?= $this->modal->replaceLink(t('Burndown chart'), 'AnalyticController', 'burndown', array('project_id' => $project['id'])) ?> </li> <li <?= $this->app->checkMenuSelection('AnalyticController', 'averageTimeByColumn') ?>> - <?= $this->url->link(t('Average time into each column'), 'AnalyticController', 'averageTimeByColumn', array('project_id' => $project['id'])) ?> + <?= $this->modal->replaceLink(t('Average time into each column'), 'AnalyticController', 'averageTimeByColumn', array('project_id' => $project['id'])) ?> </li> <li <?= $this->app->checkMenuSelection('AnalyticController', 'leadAndCycleTime') ?>> - <?= $this->url->link(t('Lead and cycle time'), 'AnalyticController', 'leadAndCycleTime', array('project_id' => $project['id'])) ?> + <?= $this->modal->replaceLink(t('Lead and cycle time'), 'AnalyticController', 'leadAndCycleTime', array('project_id' => $project['id'])) ?> </li> <li <?= $this->app->checkMenuSelection('AnalyticController', 'timeComparison') ?>> - <?= $this->url->link(t('Estimated vs actual time'), 'AnalyticController', 'timeComparison', array('project_id' => $project['id'])) ?> + <?= $this->modal->replaceLink(t('Estimated vs actual time'), 'AnalyticController', 'timeComparison', array('project_id' => $project['id'])) ?> </li> <?= $this->hook->render('template:analytic:sidebar', array('project' => $project)) ?> - </ul> </div> diff --git a/app/Template/analytic/task_distribution.php b/app/Template/analytic/task_distribution.php index 1231856e..671d462f 100644 --- a/app/Template/analytic/task_distribution.php +++ b/app/Template/analytic/task_distribution.php @@ -1,6 +1,8 @@ -<div class="page-header"> - <h2><?= t('Task distribution') ?></h2> -</div> +<?php if (! $is_ajax): ?> + <div class="page-header"> + <h2><?= t('Task distribution') ?></h2> + </div> +<?php endif ?> <?php if (empty($metrics)): ?> <p class="alert"><?= t('Not enough data to show the graph.') ?></p> diff --git a/app/Template/analytic/time_comparison.php b/app/Template/analytic/time_comparison.php index c949f2c8..754c68f2 100644 --- a/app/Template/analytic/time_comparison.php +++ b/app/Template/analytic/time_comparison.php @@ -1,6 +1,8 @@ -<div class="page-header"> - <h2><?= t('Estimated vs actual time') ?></h2> -</div> +<?php if (! $is_ajax): ?> + <div class="page-header"> + <h2><?= t('Estimated vs actual time') ?></h2> + </div> +<?php endif ?> <div class="panel"> <ul> @@ -27,9 +29,9 @@ <tr> <th class="column-5"><?= $paginator->order(t('Id'), 'tasks.id') ?></th> <th><?= $paginator->order(t('Title'), 'tasks.title') ?></th> - <th class="column-5"><?= $paginator->order(t('Status'), 'tasks.is_active') ?></th> - <th class="column-10"><?= $paginator->order(t('Estimated Time'), 'tasks.time_estimated') ?></th> - <th class="column-10"><?= $paginator->order(t('Actual Time'), 'tasks.time_spent') ?></th> + <th class="column-10"><?= $paginator->order(t('Status'), 'tasks.is_active') ?></th> + <th class="column-12"><?= $paginator->order(t('Estimated Time'), 'tasks.time_estimated') ?></th> + <th class="column-12"><?= $paginator->order(t('Actual Time'), 'tasks.time_spent') ?></th> </tr> <?php foreach ($paginator->getCollection() as $task): ?> <tr> diff --git a/app/Template/analytic/user_distribution.php b/app/Template/analytic/user_distribution.php index 76ac945c..cae6fa57 100644 --- a/app/Template/analytic/user_distribution.php +++ b/app/Template/analytic/user_distribution.php @@ -1,6 +1,8 @@ -<div class="page-header"> - <h2><?= t('User repartition') ?></h2> -</div> +<?php if (! $is_ajax): ?> + <div class="page-header"> + <h2><?= t('User repartition') ?></h2> + </div> +<?php endif ?> <?php if (empty($metrics)): ?> <p class="alert"><?= t('Not enough data to show the graph.') ?></p> diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php index 4ae9318c..447cd0b4 100644 --- a/app/Template/project/dropdown.php +++ b/app/Template/project/dropdown.php @@ -22,7 +22,7 @@ <?php if ($this->user->hasProjectAccess('AnalyticController', 'taskDistribution', $project['id'])): ?> <li> - <?= $this->url->icon('line-chart', t('Analytics'), 'AnalyticController', 'taskDistribution', array('project_id' => $project['id'])) ?> + <?= $this->modal->large('line-chart', t('Analytics'), 'AnalyticController', 'taskDistribution', array('project_id' => $project['id'])) ?> </li> <?php endif ?> diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php index 27a13ac9..96b26890 100644 --- a/app/Template/project_header/dropdown.php +++ b/app/Template/project_header/dropdown.php @@ -46,7 +46,7 @@ <?php if ($this->user->hasProjectAccess('AnalyticController', 'taskDistribution', $project['id'])): ?> <li> - <?= $this->url->icon('line-chart', t('Analytics'), 'AnalyticController', 'taskDistribution', array('project_id' => $project['id'])) ?> + <?= $this->modal->large('line-chart', t('Analytics'), 'AnalyticController', 'taskDistribution', array('project_id' => $project['id'])) ?> </li> <?php endif ?> |