summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-25 17:41:41 -0400
committerFrederic Guillot <fred@kanboard.net>2016-03-25 17:41:41 -0400
commit354e37971d43d3b62d8f4e2a23eff09e88525627 (patch)
treeab7ded1870bbdec219909cf5f5c9d50549d2c9a1 /app
parent13d5bd8e48bd6c0109d1272da58a8879bf9a6737 (diff)
Unification of project header
Diffstat (limited to 'app')
-rw-r--r--app/Controller/Activity.php1
-rw-r--r--app/Controller/Analytic.php3
-rw-r--r--app/Controller/Base.php56
-rw-r--r--app/Controller/Board.php13
-rw-r--r--app/Controller/Calendar.php7
-rw-r--r--app/Controller/Gantt.php11
-rw-r--r--app/Controller/Listing.php15
-rw-r--r--app/Controller/ProjectOverview.php21
-rw-r--r--app/Controller/Task.php8
-rw-r--r--app/Core/Helper.php25
-rw-r--r--app/Helper/ProjectHeaderHelper.php80
-rw-r--r--app/ServiceProvider/HelperProvider.php1
-rw-r--r--app/Template/activity/project.php40
-rw-r--r--app/Template/analytic/layout.php33
-rw-r--r--app/Template/app/layout.php2
-rw-r--r--app/Template/board/view_private.php17
-rw-r--r--app/Template/calendar/show.php6
-rw-r--r--app/Template/gantt/project.php7
-rw-r--r--app/Template/listing/show.php8
-rw-r--r--app/Template/project/layout.php27
-rw-r--r--app/Template/project_header/dropdown.php4
-rw-r--r--app/Template/project_header/header.php2
-rw-r--r--app/Template/project_header/views.php2
-rw-r--r--app/Template/project_overview/show.php6
-rw-r--r--app/Template/task/details.php7
-rw-r--r--app/Template/task/layout.php22
-rw-r--r--app/Template/task/menu.php78
-rw-r--r--app/Template/task/show.php1
28 files changed, 172 insertions, 331 deletions
diff --git a/app/Controller/Activity.php b/app/Controller/Activity.php
index db520ebe..e455b1da 100644
--- a/app/Controller/Activity.php
+++ b/app/Controller/Activity.php
@@ -38,6 +38,7 @@ class Activity extends Base
$this->response->html($this->helper->layout->task('activity/task', array(
'title' => $task['title'],
'task' => $task,
+ 'project' => $this->project->getById($task['project_id']),
'events' => $this->projectActivity->getTask($task['id']),
)));
}
diff --git a/app/Controller/Analytic.php b/app/Controller/Analytic.php
index 6ce062c4..6b0730b0 100644
--- a/app/Controller/Analytic.php
+++ b/app/Controller/Analytic.php
@@ -44,8 +44,7 @@ class Analytic extends Base
public function compareHours()
{
$project = $this->getProject();
- $params = $this->getProjectFilters('analytic', 'compareHours');
- $query = $this->taskFilter->create()->filterByProject($params['project']['id'])->getQuery();
+ $query = $this->taskFilter->create()->filterByProject($project['id'])->getQuery();
$paginator = $this->paginator
->setUrl('analytic', 'compareHours', array('project_id' => $project['id']))
diff --git a/app/Controller/Base.php b/app/Controller/Base.php
index 2453be18..beb56909 100644
--- a/app/Controller/Base.php
+++ b/app/Controller/Base.php
@@ -287,60 +287,4 @@ abstract class Base extends \Kanboard\Core\Base
return $subtask;
}
-
- /**
- * Common method to get project filters
- *
- * @access protected
- * @param string $controller
- * @param string $action
- * @return array
- */
- protected function getProjectFilters($controller, $action)
- {
- $project = $this->getProject();
- $search = $this->request->getStringParam('search', $this->userSession->getFilters($project['id']));
- $board_selector = $this->projectUserRole->getActiveProjectsByUser($this->userSession->getId());
- unset($board_selector[$project['id']]);
-
- $filters = array(
- 'controller' => $controller,
- 'action' => $action,
- 'project_id' => $project['id'],
- 'search' => urldecode($search),
- );
-
- $this->userSession->setFilters($project['id'], $filters['search']);
-
- return array(
- 'project' => $project,
- 'board_selector' => $board_selector,
- 'filters' => $filters,
- 'title' => $project['name'],
- 'description' => $this->getProjectDescription($project),
- );
- }
-
- /**
- * Get project description
- *
- * @access protected
- * @param array &$project
- * @return string
- */
- protected function getProjectDescription(array &$project)
- {
- if ($project['owner_id'] > 0) {
- $description = t('Project owner: ').'**'.$this->helper->text->e($project['owner_name'] ?: $project['owner_username']).'**'.PHP_EOL.PHP_EOL;
-
- if (! empty($project['description'])) {
- $description .= '***'.PHP_EOL.PHP_EOL;
- $description .= $project['description'];
- }
- } else {
- $description = $project['description'];
- }
-
- return $description;
- }
}
diff --git a/app/Controller/Board.php b/app/Controller/Board.php
index 199f1703..51344bd3 100644
--- a/app/Controller/Board.php
+++ b/app/Controller/Board.php
@@ -47,16 +47,17 @@ class Board extends Base
*/
public function show()
{
- $params = $this->getProjectFilters('board', 'show');
+ $project = $this->getProject();
+ $search = $this->helper->projectHeader->getSearchQuery($project);
$this->response->html($this->helper->layout->app('board/view_private', array(
- 'categories_list' => $this->category->getList($params['project']['id'], false),
- 'users_list' => $this->projectUserRole->getAssignableUsersList($params['project']['id'], false),
- 'custom_filters_list' => $this->customFilter->getAll($params['project']['id'], $this->userSession->getId()),
- 'swimlanes' => $this->taskFilter->search($params['filters']['search'])->getBoard($params['project']['id']),
+ 'swimlanes' => $this->taskFilter->search($search)->getBoard($project['id']),
+ 'project' => $project,
+ 'title' => $project['name'],
+ 'description' => $this->helper->projectHeader->getDescription($project),
'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'),
'board_highlight_period' => $this->config->get('board_highlight_period'),
- ) + $params));
+ )));
}
/**
diff --git a/app/Controller/Calendar.php b/app/Controller/Calendar.php
index a0a25e41..af31ae47 100644
--- a/app/Controller/Calendar.php
+++ b/app/Controller/Calendar.php
@@ -20,9 +20,14 @@ class Calendar extends Base
*/
public function show()
{
+ $project = $this->getProject();
+
$this->response->html($this->helper->layout->app('calendar/show', array(
+ 'project' => $project,
+ 'title' => $project['name'],
+ 'description' => $this->helper->projectHeader->getDescription($project),
'check_interval' => $this->config->get('board_private_refresh_interval'),
- ) + $this->getProjectFilters('calendar', 'show')));
+ )));
}
/**
diff --git a/app/Controller/Gantt.php b/app/Controller/Gantt.php
index 9ffa277f..02ee946c 100644
--- a/app/Controller/Gantt.php
+++ b/app/Controller/Gantt.php
@@ -54,8 +54,9 @@ class Gantt extends Base
*/
public function project()
{
- $params = $this->getProjectFilters('gantt', 'project');
- $filter = $this->taskFilterGanttFormatter->search($params['filters']['search'])->filterByProject($params['project']['id']);
+ $project = $this->getProject();
+ $search = $this->helper->projectHeader->getSearchQuery($project);
+ $filter = $this->taskFilterGanttFormatter->search($search)->filterByProject($project['id']);
$sorting = $this->request->getStringParam('sorting', 'board');
if ($sorting === 'date') {
@@ -64,8 +65,10 @@ class Gantt extends Base
$filter->getQuery()->asc('column_position')->asc(TaskModel::TABLE.'.position');
}
- $this->response->html($this->helper->layout->app('gantt/project', $params + array(
- 'users_list' => $this->projectUserRole->getAssignableUsersList($params['project']['id'], false),
+ $this->response->html($this->helper->layout->app('gantt/project', array(
+ 'project' => $project,
+ 'title' => $project['name'],
+ 'description' => $this->helper->projectHeader->getDescription($project),
'sorting' => $sorting,
'tasks' => $filter->format(),
)));
diff --git a/app/Controller/Listing.php b/app/Controller/Listing.php
index c784dd50..9931c346 100644
--- a/app/Controller/Listing.php
+++ b/app/Controller/Listing.php
@@ -19,22 +19,23 @@ class Listing extends Base
*/
public function show()
{
- $params = $this->getProjectFilters('listing', 'show');
- $query = $this->taskFilter->search($params['filters']['search'])->filterByProject($params['project']['id'])->getQuery();
+ $project = $this->getProject();
+ $search = $this->helper->projectHeader->getSearchQuery($project);
+ $query = $this->taskFilter->search($search)->filterByProject($project['id'])->getQuery();
$paginator = $this->paginator
- ->setUrl('listing', 'show', array('project_id' => $params['project']['id']))
+ ->setUrl('listing', 'show', array('project_id' => $project['id']))
->setMax(30)
->setOrder(TaskModel::TABLE.'.id')
->setDirection('DESC')
->setQuery($query)
->calculate();
- $this->response->html($this->helper->layout->app('listing/show', $params + array(
+ $this->response->html($this->helper->layout->app('listing/show', array(
+ 'project' => $project,
+ 'title' => $project['name'],
+ 'description' => $this->helper->projectHeader->getDescription($project),
'paginator' => $paginator,
- 'categories_list' => $this->category->getList($params['project']['id'], false),
- 'users_list' => $this->projectUserRole->getAssignableUsersList($params['project']['id'], false),
- 'custom_filters_list' => $this->customFilter->getAll($params['project']['id'], $this->userSession->getId()),
)));
}
}
diff --git a/app/Controller/ProjectOverview.php b/app/Controller/ProjectOverview.php
index b0687ed3..04645804 100644
--- a/app/Controller/ProjectOverview.php
+++ b/app/Controller/ProjectOverview.php
@@ -15,15 +15,18 @@ class ProjectOverview extends Base
*/
public function show()
{
- $params = $this->getProjectFilters('ProjectOverview', 'show');
- $params['users'] = $this->projectUserRole->getAllUsersGroupedByRole($params['project']['id']);
- $params['roles'] = $this->role->getProjectRoles();
- $params['events'] = $this->projectActivity->getProject($params['project']['id'], 10);
- $params['images'] = $this->projectFile->getAllImages($params['project']['id']);
- $params['files'] = $this->projectFile->getAllDocuments($params['project']['id']);
+ $project = $this->getProject();
+ $this->project->getColumnStats($project);
- $this->project->getColumnStats($params['project']);
-
- $this->response->html($this->helper->layout->app('project_overview/show', $params));
+ $this->response->html($this->helper->layout->app('project_overview/show', array(
+ 'project' => $project,
+ 'title' => $project['name'],
+ 'description' => $this->helper->projectHeader->getDescription($project),
+ 'users' => $this->projectUserRole->getAllUsersGroupedByRole($project['id']),
+ 'roles' => $this->role->getProjectRoles(),
+ 'events' => $this->projectActivity->getProject($project['id'], 10),
+ 'images' => $this->projectFile->getAllImages($project['id']),
+ 'files' => $this->projectFile->getAllDocuments($project['id']),
+ )));
}
}
diff --git a/app/Controller/Task.php b/app/Controller/Task.php
index dc10604e..902a32d6 100644
--- a/app/Controller/Task.php
+++ b/app/Controller/Task.php
@@ -71,17 +71,16 @@ class Task extends Base
$values = $this->dateParser->format($values, array('date_started'), $this->config->get('application_datetime_format', DateParser::DATE_TIME_FORMAT));
$this->response->html($this->helper->layout->task('task/show', array(
+ 'task' => $task,
'project' => $this->project->getById($task['project_id']),
+ 'values' => $values,
'files' => $this->taskFile->getAllDocuments($task['id']),
'images' => $this->taskFile->getAllImages($task['id']),
'comments' => $this->comment->getAll($task['id'], $this->userSession->getCommentSorting()),
'subtasks' => $subtasks,
'internal_links' => $this->taskLink->getAllGroupedByLabel($task['id']),
'external_links' => $this->taskExternalLink->getAll($task['id']),
- 'task' => $task,
- 'values' => $values,
'link_label_list' => $this->link->getList(0, false),
- 'users_list' => $this->projectUserRole->getAssignableUsersList($task['project_id'], true, false, false),
)));
}
@@ -96,6 +95,7 @@ class Task extends Base
$this->response->html($this->helper->layout->task('task/analytics', array(
'task' => $task,
+ 'project' => $this->project->getById($task['project_id']),
'lead_time' => $this->taskAnalytic->getLeadTime($task),
'cycle_time' => $this->taskAnalytic->getCycleTime($task),
'time_spent_columns' => $this->taskAnalytic->getTimeSpentByColumn($task),
@@ -121,6 +121,7 @@ class Task extends Base
$this->response->html($this->helper->layout->task('task/time_tracking_details', array(
'task' => $task,
+ 'project' => $this->project->getById($task['project_id']),
'subtask_paginator' => $subtask_paginator,
)));
}
@@ -136,6 +137,7 @@ class Task extends Base
$this->response->html($this->helper->layout->task('task/transitions', array(
'task' => $task,
+ 'project' => $this->project->getById($task['project_id']),
'transitions' => $this->transition->getAllByTask($task['id']),
)));
}
diff --git a/app/Core/Helper.php b/app/Core/Helper.php
index 3764a67c..e6152127 100644
--- a/app/Core/Helper.php
+++ b/app/Core/Helper.php
@@ -10,18 +10,19 @@ use Pimple\Container;
* @package core
* @author Frederic Guillot
*
- * @property \Kanboard\Helper\AppHelper $app
- * @property \Kanboard\Helper\AssetHelper $asset
- * @property \Kanboard\Helper\DateHelper $dt
- * @property \Kanboard\Helper\FileHelper $file
- * @property \Kanboard\Helper\FormHelper $form
- * @property \Kanboard\Helper\ModelHelper $model
- * @property \Kanboard\Helper\SubtaskHelper $subtask
- * @property \Kanboard\Helper\TaskHelper $task
- * @property \Kanboard\Helper\TextHelper $text
- * @property \Kanboard\Helper\UrlHelper $url
- * @property \Kanboard\Helper\UserHelper $user
- * @property \Kanboard\Helper\LayoutHelper $layout
+ * @property \Kanboard\Helper\AppHelper $app
+ * @property \Kanboard\Helper\AssetHelper $asset
+ * @property \Kanboard\Helper\DateHelper $dt
+ * @property \Kanboard\Helper\FileHelper $file
+ * @property \Kanboard\Helper\FormHelper $form
+ * @property \Kanboard\Helper\ModelHelper $model
+ * @property \Kanboard\Helper\SubtaskHelper $subtask
+ * @property \Kanboard\Helper\TaskHelper $task
+ * @property \Kanboard\Helper\TextHelper $text
+ * @property \Kanboard\Helper\UrlHelper $url
+ * @property \Kanboard\Helper\UserHelper $user
+ * @property \Kanboard\Helper\LayoutHelper $layout
+ * @property \Kanboard\Helper\ProjectHeaderHelper $projectHeader
*/
class Helper
{
diff --git a/app/Helper/ProjectHeaderHelper.php b/app/Helper/ProjectHeaderHelper.php
new file mode 100644
index 00000000..19570059
--- /dev/null
+++ b/app/Helper/ProjectHeaderHelper.php
@@ -0,0 +1,80 @@
+<?php
+
+namespace Kanboard\Helper;
+
+use Kanboard\Core\Base;
+
+/**
+ * Project Header Helper
+ *
+ * @package helper
+ * @author Frederic Guillot
+ */
+class ProjectHeaderHelper extends Base
+{
+ /**
+ * Get current search query
+ *
+ * @access public
+ * @param array $project
+ * @return string
+ */
+ public function getSearchQuery(array $project)
+ {
+ $search = $this->request->getStringParam('search', $this->userSession->getFilters($project['id']));
+ $this->userSession->setFilters($project['id'], $search);
+ return urldecode($search);
+ }
+
+ /**
+ * Render project header (views switcher and search box)
+ *
+ * @access public
+ * @param array $project
+ * @param string $controller
+ * @param string $action
+ * @param bool $boardView
+ * @return string
+ */
+ public function render(array $project, $controller, $action, $boardView = false)
+ {
+ $filters = array(
+ 'controller' => $controller,
+ 'action' => $action,
+ 'project_id' => $project['id'],
+ 'search' => $this->getSearchQuery($project),
+ );
+
+ return $this->template->render('project_header/header', array(
+ 'project' => $project,
+ 'filters' => $filters,
+ 'categories_list' => $this->category->getList($project['id'], false),
+ 'users_list' => $this->projectUserRole->getAssignableUsersList($project['id'], false),
+ 'custom_filters_list' => $this->customFilter->getAll($project['id'], $this->userSession->getId()),
+ 'board_view' => $boardView,
+ ));
+ }
+
+ /**
+ * Get project description
+ *
+ * @access public
+ * @param array &$project
+ * @return string
+ */
+ public function getDescription(array &$project)
+ {
+ if ($project['owner_id'] > 0) {
+ $description = t('Project owner: ').'**'.$this->helper->text->e($project['owner_name'] ?: $project['owner_username']).'**'.PHP_EOL.PHP_EOL;
+
+ if (! empty($project['description'])) {
+ $description .= '***'.PHP_EOL.PHP_EOL;
+ $description .= $project['description'];
+ }
+ } else {
+ $description = $project['description'];
+ }
+
+ return $description;
+ }
+}
diff --git a/app/ServiceProvider/HelperProvider.php b/app/ServiceProvider/HelperProvider.php
index 37be5a05..43a78e32 100644
--- a/app/ServiceProvider/HelperProvider.php
+++ b/app/ServiceProvider/HelperProvider.php
@@ -27,6 +27,7 @@ class HelperProvider implements ServiceProviderInterface
$container['helper']->register('url', '\Kanboard\Helper\UrlHelper');
$container['helper']->register('user', '\Kanboard\Helper\UserHelper');
$container['helper']->register('avatar', '\Kanboard\Helper\AvatarHelper');
+ $container['helper']->register('projectHeader', '\Kanboard\Helper\ProjectHeaderHelper');
$container['template'] = new Template($container['helper']);
diff --git a/app/Template/activity/project.php b/app/Template/activity/project.php
index ba6d6629..176d9b99 100644
--- a/app/Template/activity/project.php
+++ b/app/Template/activity/project.php
@@ -1,40 +1,14 @@
<section id="main">
- <div class="page-header">
+ <?= $this->projectHeader->render($project, 'Analytic', $this->app->getRouterAction()) ?>
+
+ <?php if ($project['is_public']): ?>
+ <div class="menu-inline pull-right">
<ul>
- <li>
- <span class="dropdown">
- <span>
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
- </ul>
- </span>
- </span>
- </li>
- <li>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <li>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
- <li>
- <i class="fa fa-cog fa-fw"></i>
- <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <?php endif ?>
- <li>
- <i class="fa fa-folder fa-fw"></i>
- <?= $this->url->link(t('All projects'), 'project', 'index') ?>
- </li>
- <?php if ($project['is_public']): ?>
- <li><i class="fa fa-rss-square fa-fw"></i><?= $this->url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
- <li><i class="fa fa-calendar fa-fw"></i><?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?></li>
- <?php endif ?>
+ <li><i class="fa fa-rss-square fa-fw"></i><?= $this->url->link(t('RSS feed'), 'feed', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
+ <li><i class="fa fa-calendar fa-fw"></i><?= $this->url->link(t('iCal feed'), 'ical', 'project', array('token' => $project['token'])) ?></li>
</ul>
</div>
+ <?php endif ?>
<?= $this->render('event/events', array('events' => $events)) ?>
</section> \ No newline at end of file
diff --git a/app/Template/analytic/layout.php b/app/Template/analytic/layout.php
index f1dba552..35793cbb 100644
--- a/app/Template/analytic/layout.php
+++ b/app/Template/analytic/layout.php
@@ -1,36 +1,5 @@
<section id="main">
- <div class="page-header">
- <ul>
- <li>
- <span class="dropdown">
- <span>
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
- </ul>
- </span>
- </span>
- </li>
- <li>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <li>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
- <li>
- <i class="fa fa-cog fa-fw"></i>
- <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <?php endif ?>
- <li>
- <i class="fa fa-folder fa-fw"></i>
- <?= $this->url->link(t('All projects'), 'project', 'index') ?>
- </li>
- </ul>
- </div>
+ <?= $this->projectHeader->render($project, 'Listing', 'show') ?>
<section class="sidebar-container">
<?= $this->render($sidebar_template, array('project' => $project)) ?>
diff --git a/app/Template/app/layout.php b/app/Template/app/layout.php
index 200cb0d7..2a32ac02 100644
--- a/app/Template/app/layout.php
+++ b/app/Template/app/layout.php
@@ -1,5 +1,5 @@
<section id="main">
- <div class="page-header page-header-mobile">
+ <div class="page-header">
<ul>
<?php if ($this->user->hasAccess('ProjectCreation', 'create')): ?>
<li>
diff --git a/app/Template/board/view_private.php b/app/Template/board/view_private.php
index b5e38c66..13702273 100644
--- a/app/Template/board/view_private.php
+++ b/app/Template/board/view_private.php
@@ -1,19 +1,12 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- 'categories_list' => $categories_list,
- 'users_list' => $users_list,
- 'custom_filters_list' => $custom_filters_list,
- 'is_board' => true,
- )) ?>
+ <?= $this->projectHeader->render($project, 'Board', 'show', true) ?>
<?= $this->render('board/table_container', array(
- 'project' => $project,
- 'swimlanes' => $swimlanes,
- 'board_private_refresh_interval' => $board_private_refresh_interval,
- 'board_highlight_period' => $board_highlight_period,
+ 'project' => $project,
+ 'swimlanes' => $swimlanes,
+ 'board_private_refresh_interval' => $board_private_refresh_interval,
+ 'board_highlight_period' => $board_highlight_period,
)) ?>
</section>
diff --git a/app/Template/calendar/show.php b/app/Template/calendar/show.php
index 7085b51e..f00e810b 100644
--- a/app/Template/calendar/show.php
+++ b/app/Template/calendar/show.php
@@ -1,9 +1,5 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- )) ?>
-
+ <?= $this->projectHeader->render($project, 'Calendar', 'show') ?>
<div id="calendar"
data-save-url="<?= $this->url->href('calendar', 'save', array('project_id' => $project['id'])) ?>"
data-check-url="<?= $this->url->href('calendar', 'project', array('project_id' => $project['id'])) ?>"
diff --git a/app/Template/gantt/project.php b/app/Template/gantt/project.php
index fe193c2b..e6c8592f 100644
--- a/app/Template/gantt/project.php
+++ b/app/Template/gantt/project.php
@@ -1,10 +1,5 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- 'users_list' => $users_list,
- )) ?>
-
+ <?= $this->projectHeader->render($project, 'Gantt', 'project') ?>
<div class="menu-inline">
<ul>
<li <?= $sorting === 'board' ? 'class="active"' : '' ?>>
diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php
index 10dcedcc..c7887ebd 100644
--- a/app/Template/listing/show.php
+++ b/app/Template/listing/show.php
@@ -1,11 +1,5 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- 'custom_filters_list' => $custom_filters_list,
- 'users_list' => $users_list,
- 'categories_list' => $categories_list,
- )) ?>
+ <?= $this->projectHeader->render($project, 'Listing', 'show') ?>
<?php if ($paginator->isEmpty()): ?>
<p class="alert"><?= t('No tasks found.') ?></p>
diff --git a/app/Template/project/layout.php b/app/Template/project/layout.php
index eb391ae5..fcb3e5f3 100644
--- a/app/Template/project/layout.php
+++ b/app/Template/project/layout.php
@@ -1,30 +1,5 @@
<section id="main">
- <div class="page-header">
- <ul>
- <li>
- <span class="dropdown">
- <span>
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?= $this->render('project/dropdown', array('project' => $project)) ?>
- </ul>
- </span>
- </span>
- </li>
- <li>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <li>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $project['id'])) ?>
- </li>
- <li>
- <i class="fa fa-folder fa-fw"></i>
- <?= $this->url->link(t('All projects'), 'project', 'index') ?>
- </li>
- </ul>
- </div>
+ <?= $this->projectHeader->render($project, 'Listing', 'show') ?>
<section class="sidebar-container">
<?= $this->render($sidebar_template, array('project' => $project)) ?>
diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php
index bbc033bf..759a5135 100644
--- a/app/Template/project_header/dropdown.php
+++ b/app/Template/project_header/dropdown.php
@@ -1,7 +1,7 @@
<div class="dropdown">
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
+ <a href="#" class="dropdown-menu action-menu"><?= t('Menu') ?> <i class="fa fa-caret-down"></i></a>
<ul>
- <?php if ($is_board): ?>
+ <?php if ($board_view): ?>
<li>
<span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>>
<i class="fa fa-expand fa-fw"></i>
diff --git a/app/Template/project_header/header.php b/app/Template/project_header/header.php
index f6e5af9e..aaa8137b 100644
--- a/app/Template/project_header/header.php
+++ b/app/Template/project_header/header.php
@@ -1,7 +1,7 @@
<div class="project-header">
<?= $this->hook->render('template:project:header:before', array('project' => $project)) ?>
- <?= $this->render('project_header/dropdown', array('project' => $project, 'is_board' => isset($is_board))) ?>
+ <?= $this->render('project_header/dropdown', array('project' => $project, 'board_view' => $board_view)) ?>
<?= $this->render('project_header/views', array('project' => $project, 'filters' => $filters)) ?>
<?= $this->render('project_header/search', array(
'project' => $project,
diff --git a/app/Template/project_header/views.php b/app/Template/project_header/views.php
index f8fdbb02..353e4b62 100644
--- a/app/Template/project_header/views.php
+++ b/app/Template/project_header/views.php
@@ -1,7 +1,7 @@
<ul class="views">
<li <?= $this->app->getRouterController() === 'ProjectOverview' ? 'class="active"' : '' ?>>
<i class="fa fa-eye fa-fw"></i>
- <?= $this->url->link(t('Overview'), 'ProjectOverview', 'show', array('project_id' => $project['id']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?>
+ <?= $this->url->link(t('Overview'), 'ProjectOverview', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?>
</li>
<li <?= $this->app->getRouterController() === 'Board' ? 'class="active"' : '' ?>>
<i class="fa fa-th fa-fw"></i>
diff --git a/app/Template/project_overview/show.php b/app/Template/project_overview/show.php
index 9a9786e8..6fe815b3 100644
--- a/app/Template/project_overview/show.php
+++ b/app/Template/project_overview/show.php
@@ -1,9 +1,5 @@
<section id="main">
- <?= $this->render('project_header/header', array(
- 'project' => $project,
- 'filters' => $filters,
- )) ?>
-
+ <?= $this->projectHeader->render($project, 'ProjectOverview', 'show') ?>
<?= $this->render('project_overview/columns', array('project' => $project)) ?>
<?= $this->render('project_overview/description', array('project' => $project)) ?>
<?= $this->render('project_overview/attachments', array('project' => $project, 'images' => $images, 'files' => $files)) ?>
diff --git a/app/Template/task/details.php b/app/Template/task/details.php
index a7c4ad01..6093c157 100644
--- a/app/Template/task/details.php
+++ b/app/Template/task/details.php
@@ -1,5 +1,6 @@
<section id="task-summary">
<h2><?= $this->text->e($task['title']) ?></h2>
+
<div class="task-summary-container color-<?= $task['color_id'] ?>">
<div class="task-summary-column">
<ul class="no-bullet">
@@ -134,4 +135,10 @@
</ul>
</div>
</div>
+
+ <?php if ($editable && empty($task['date_started'])): ?>
+ <div class="task-summary-buttons">
+ <?= $this->url->button('fa-play', t('Set start date'), 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
+ </div>
+ <?php endif ?>
</section>
diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php
index ca27fd4f..52db5d1b 100644
--- a/app/Template/task/layout.php
+++ b/app/Template/task/layout.php
@@ -1,25 +1,5 @@
<section id="main">
- <div class="page-header">
- <ul>
- <li>
- <?= $this->render('task/menu', array('task' => $task)) ?>
- </li>
- <li>
- <i class="fa fa-th fa-fw"></i>
- <?= $this->url->link(t('Back to the board'), 'board', 'show', array('project_id' => $task['project_id']), false, '', '', false, $task['swimlane_id'] != 0 ? 'swimlane-'.$task['swimlane_id'] : '') ?>
- </li>
- <li>
- <i class="fa fa-calendar fa-fw"></i>
- <?= $this->url->link(t('Back to the calendar'), 'calendar', 'show', array('project_id' => $task['project_id'])) ?>
- </li>
- <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $task['project_id'])): ?>
- <li>
- <i class="fa fa-cog fa-fw"></i>
- <?= $this->url->link(t('Project settings'), 'project', 'show', array('project_id' => $task['project_id'])) ?>
- </li>
- <?php endif ?>
- </ul>
- </div>
+ <?= $this->projectHeader->render($project, 'Listing', 'show') ?>
<section
class="sidebar-container" id="task-view"
data-edit-url="<?= $this->url->href('taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>"
diff --git a/app/Template/task/menu.php b/app/Template/task/menu.php
deleted file mode 100644
index fe30d06e..00000000
--- a/app/Template/task/menu.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php if ($this->user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?>
-<div class="dropdown">
- <i class="fa fa-caret-down"></i> <a href="#" class="dropdown-menu"><?= t('Actions') ?></a>
- <ul>
- <?php if (empty($task['date_started'])): ?>
- <li>
- <i class="fa fa-play fa-fw"></i>
- <?= $this->url->link(t('Set automatically the start date'), 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- </li>
- <?php endif ?>
- <li>
- <i class="fa fa-pencil-square-o fa-fw"></i>
- <?= $this->url->link(t('Edit the task'), 'taskmodification', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-align-left fa-fw"></i>
- <?= $this->url->link(t('Edit the description'), 'taskmodification', 'description', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-refresh fa-rotate-90 fa-fw"></i>
- <?= $this->url->link(t('Edit recurrence'), 'TaskRecurrence', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-plus fa-fw"></i>
- <?= $this->url->link(t('Add a sub-task'), 'subtask', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-code-fork fa-fw"></i>
- <?= $this->url->link(t('Add internal link'), 'TaskInternalLink', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-external-link fa-fw"></i>
- <?= $this->url->link(t('Add external link'), 'TaskExternalLink', 'find', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-comment-o fa-fw"></i>
- <?= $this->url->link(t('Add a comment'), 'comment', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-file fa-fw"></i>
- <?= $this->url->link(t('Attach a document'), 'TaskFile', 'create', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-camera fa-fw"></i>
- <?= $this->url->link(t('Add a screenshot'), 'TaskFile', 'screenshot', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-files-o fa-fw"></i>
- <?= $this->url->link(t('Duplicate'), 'taskduplication', 'duplicate', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-clipboard fa-fw"></i>
- <?= $this->url->link(t('Duplicate to another project'), 'taskduplication', 'copy', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <i class="fa fa-clone fa-fw"></i>
- <?= $this->url->link(t('Move to another project'), 'taskduplication', 'move', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <li>
- <?php if ($task['is_active'] == 1): ?>
- <i class="fa fa-times fa-fw"></i>
- <?= $this->url->link(t('Close this task'), 'taskstatus', 'close', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- <?php else: ?>
- <i class="fa fa-check-square-o fa-fw"></i>
- <?= $this->url->link(t('Open this task'), 'taskstatus', 'open', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- <?php endif ?>
- </li>
- <?php if ($this->task->canRemove($task)): ?>
- <li>
- <i class="fa fa-trash-o fa-fw"></i>
- <?= $this->url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?>
- </li>
- <?php endif ?>
-
- <?= $this->hook->render('template:task:menu') ?>
- </ul>
-</div>
-<?php endif ?>
diff --git a/app/Template/task/show.php b/app/Template/task/show.php
index d68f6c48..86422941 100644
--- a/app/Template/task/show.php
+++ b/app/Template/task/show.php
@@ -14,7 +14,6 @@
'task' => $task,
'subtasks' => $subtasks,
'project' => $project,
- 'users_list' => isset($users_list) ? $users_list : array(),
'editable' => true,
)) ?>