diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-05-15 20:09:43 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-05-15 20:09:43 -0400 |
commit | 8a6f02735b628033a3284d06a9f633bd260e19ef (patch) | |
tree | 57d0c2acb22d6afe0412903a088ed77ac0ba3596 /app | |
parent | 67b836164997527b91452b19adbcb8aa3c5decf1 (diff) |
Added task creation menu for all projects views
Diffstat (limited to 'app')
-rw-r--r-- | app/Controller/DashboardController.php | 6 | ||||
-rw-r--r-- | app/Controller/TaskBulkController.php (renamed from app/Controller/TaskBulk.php) | 4 | ||||
-rw-r--r-- | app/Controller/TaskCreationController.php (renamed from app/Controller/Taskcreation.php) | 14 | ||||
-rw-r--r-- | app/Core/Controller/BaseMiddleware.php | 4 | ||||
-rw-r--r-- | app/ServiceProvider/AuthenticationProvider.php | 3 | ||||
-rw-r--r-- | app/Subscriber/BootstrapSubscriber.php | 8 | ||||
-rw-r--r-- | app/Template/board/table_column.php | 8 | ||||
-rw-r--r-- | app/Template/board/table_container.php | 4 | ||||
-rw-r--r-- | app/Template/listing/show.php | 2 | ||||
-rw-r--r-- | app/Template/project_header/dropdown.php | 20 | ||||
-rw-r--r-- | app/Template/task_bulk/show.php | 2 | ||||
-rw-r--r-- | app/Template/task_creation/show.php (renamed from app/Template/task_creation/form.php) | 2 |
12 files changed, 43 insertions, 34 deletions
diff --git a/app/Controller/DashboardController.php b/app/Controller/DashboardController.php index b05cd209..145e0bff 100644 --- a/app/Controller/DashboardController.php +++ b/app/Controller/DashboardController.php @@ -81,9 +81,9 @@ class DashboardController extends BaseController $this->response->html($this->helper->layout->dashboard('dashboard/show', array( 'title' => t('Dashboard'), - 'project_paginator' => $this->getProjectPaginator($user['id'], 'index', 10), - 'task_paginator' => $this->getTaskPaginator($user['id'], 'index', 10), - 'subtask_paginator' => $this->getSubtaskPaginator($user['id'], 'index', 10), + 'project_paginator' => $this->getProjectPaginator($user['id'], 'show', 10), + 'task_paginator' => $this->getTaskPaginator($user['id'], 'show', 10), + 'subtask_paginator' => $this->getSubtaskPaginator($user['id'], 'show', 10), 'user' => $user, ))); } diff --git a/app/Controller/TaskBulk.php b/app/Controller/TaskBulkController.php index d0a1b276..4b4a2594 100644 --- a/app/Controller/TaskBulk.php +++ b/app/Controller/TaskBulkController.php @@ -3,11 +3,11 @@ namespace Kanboard\Controller; /** - * Class TaskBulk + * Class TaskBulkController * * @package Kanboard\Controller */ -class TaskBulk extends BaseController +class TaskBulkController extends BaseController { /** * Show the form diff --git a/app/Controller/Taskcreation.php b/app/Controller/TaskCreationController.php index af7d0c80..2a63ddcc 100644 --- a/app/Controller/Taskcreation.php +++ b/app/Controller/TaskCreationController.php @@ -3,12 +3,12 @@ namespace Kanboard\Controller; /** - * Task Creation controller + * Task Creation Controller * - * @package controller + * @package Kanboard\Controller * @author Frederic Guillot */ -class Taskcreation extends BaseController +class TaskCreationController extends BaseController { /** * Display a form to create a new task @@ -18,7 +18,7 @@ class Taskcreation extends BaseController * @param array $errors * @throws \Kanboard\Core\Controller\PageNotFoundException */ - public function create(array $values = array(), array $errors = array()) + public function show(array $values = array(), array $errors = array()) { $project = $this->getProject(); $swimlanes_list = $this->swimlane->getList($project['id'], false, true); @@ -35,7 +35,7 @@ class Taskcreation extends BaseController $values = $this->hook->merge('controller:task-creation:form:default', $values, array('default_values' => $values)); } - $this->response->html($this->template->render('task_creation/form', array( + $this->response->html($this->template->render('task_creation/show', array( 'project' => $project, 'errors' => $errors, 'values' => $values + array('project_id' => $project['id']), @@ -66,13 +66,13 @@ class Taskcreation extends BaseController } $this->flash->failure(t('Unable to create your task.')); - return $this->create($values, $errors); + return $this->show($values, $errors); } private function afterSave(array $project, array &$values) { if (isset($values['another_task']) && $values['another_task'] == 1) { - return $this->create(array( + return $this->show(array( 'owner_id' => $values['owner_id'], 'color_id' => $values['color_id'], 'category_id' => isset($values['category_id']) ? $values['category_id'] : 0, diff --git a/app/Core/Controller/BaseMiddleware.php b/app/Core/Controller/BaseMiddleware.php index f2862d13..233843c9 100644 --- a/app/Core/Controller/BaseMiddleware.php +++ b/app/Core/Controller/BaseMiddleware.php @@ -25,10 +25,10 @@ abstract class BaseMiddleware extends Base /** * Set next middleware * - * @param BaseMiddleware $nextMiddleware + * @param BaseMiddleware|null $nextMiddleware * @return BaseMiddleware */ - public function setNextMiddleware($nextMiddleware) + public function setNextMiddleware(BaseMiddleware $nextMiddleware) { $this->nextMiddleware = $nextMiddleware; return $this; diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php index f9abaf59..b9082c26 100644 --- a/app/ServiceProvider/AuthenticationProvider.php +++ b/app/ServiceProvider/AuthenticationProvider.php @@ -91,7 +91,8 @@ class AuthenticationProvider implements ServiceProviderInterface $acl->add('SubtaskStatus', '*', Role::PROJECT_MEMBER); $acl->add('Swimlane', '*', Role::PROJECT_MANAGER); $acl->add('Task', 'remove', Role::PROJECT_MEMBER); - $acl->add('Taskcreation', '*', Role::PROJECT_MEMBER); + $acl->add('TaskCreationController', '*', Role::PROJECT_MEMBER); + $acl->add('TaskBulkController', '*', Role::PROJECT_MEMBER); $acl->add('Taskduplication', '*', Role::PROJECT_MEMBER); $acl->add('TaskRecurrence', '*', Role::PROJECT_MEMBER); $acl->add('TaskImport', '*', Role::PROJECT_MANAGER); diff --git a/app/Subscriber/BootstrapSubscriber.php b/app/Subscriber/BootstrapSubscriber.php index b82405f8..e60840f1 100644 --- a/app/Subscriber/BootstrapSubscriber.php +++ b/app/Subscriber/BootstrapSubscriber.php @@ -32,10 +32,10 @@ class BootstrapSubscriber extends BaseSubscriber implements EventSubscriberInter $this->logger->debug('SQL: ' . $message); } - $this->logger->debug('nb_queries={nb}', array('nb' => $this->db->getStatementHandler()->getNbQueries())); - $this->logger->debug('rendering_time={time}', array('time' => microtime(true) - $this->request->getStartTime())); - $this->logger->debug('memory_usage='.$this->helper->text->bytes(memory_get_usage())); - $this->logger->debug('uri='.$this->request->getUri()); + $this->logger->debug('APP: nb_queries={nb}', array('nb' => $this->db->getStatementHandler()->getNbQueries())); + $this->logger->debug('APP: rendering_time={time}', array('time' => microtime(true) - $this->request->getStartTime())); + $this->logger->debug('APP: memory_usage='.$this->helper->text->bytes(memory_get_usage())); + $this->logger->debug('APP: uri='.$this->request->getUri()); $this->logger->debug('###############################################'); } } diff --git a/app/Template/board/table_column.php b/app/Template/board/table_column.php index e2f69036..a356849c 100644 --- a/app/Template/board/table_column.php +++ b/app/Template/board/table_column.php @@ -12,9 +12,9 @@ <!-- column in expanded mode --> <div class="board-column-expanded"> - <?php if (! $not_editable && $this->user->hasProjectAccess('taskcreation', 'create', $column['project_id'])): ?> + <?php if (! $not_editable && $this->user->hasProjectAccess('TaskCreationController', 'show', $column['project_id'])): ?> <div class="board-add-icon"> - <?= $this->url->link('+', 'taskcreation', 'create', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover', t('Add a new task')) ?> + <?= $this->url->link('+', 'TaskCreationController', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover', t('Add a new task')) ?> </div> <?php endif ?> @@ -35,10 +35,10 @@ <i class="fa fa-minus-square fa-fw"></i> <a href="#" class="board-toggle-column-view" data-column-id="<?= $column['id'] ?>"><?= t('Hide this column') ?></a> </li> - <?php if ($this->user->hasProjectAccess('Taskcreation', 'create', $column['project_id'])): ?> + <?php if ($this->user->hasProjectAccess('TaskCreationController', 'show', $column['project_id'])): ?> <li> <i class="fa fa-align-justify" aria-hidden="true"></i> - <?= $this->url->link(t('Create tasks in bulk'), 'TaskBulk', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?> + <?= $this->url->link(t('Create tasks in bulk'), 'TaskBulkController', 'show', array('project_id' => $column['project_id'], 'column_id' => $column['id'], 'swimlane_id' => $swimlane['id']), false, 'popover') ?> </li> <?php if ($column['nb_tasks'] > 0): ?> <li> diff --git a/app/Template/board/table_container.php b/app/Template/board/table_container.php index e30f9ce8..82bbec93 100644 --- a/app/Template/board/table_container.php +++ b/app/Template/board/table_container.php @@ -13,7 +13,7 @@ data-save-url="<?= $this->url->href('board', 'save', array('project_id' => $project['id'])) ?>" data-reload-url="<?= $this->url->href('board', 'reload', array('project_id' => $project['id'])) ?>" data-check-url="<?= $this->url->href('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" - data-task-creation-url="<?= $this->url->href('taskcreation', 'create', array('project_id' => $project['id'])) ?>" + data-task-creation-url="<?= $this->url->href('TaskCreationController', 'show', array('project_id' => $project['id'])) ?>" > <?php endif ?> @@ -55,4 +55,4 @@ </table> <?php endif ?> -</div>
\ No newline at end of file +</div> diff --git a/app/Template/listing/show.php b/app/Template/listing/show.php index 98b9528a..a5cba1c4 100644 --- a/app/Template/listing/show.php +++ b/app/Template/listing/show.php @@ -59,4 +59,4 @@ <?= $paginator ?> <?php endif ?> -</section>
\ No newline at end of file +</section> diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php index fdfcaf26..1aa59a8d 100644 --- a/app/Template/project_header/dropdown.php +++ b/app/Template/project_header/dropdown.php @@ -30,21 +30,29 @@ </li> <?php endif ?> + <?php if ($this->user->hasProjectAccess('TaskCreationController', 'show', $project['id'])): ?> + <li> + <i class="fa fa-plus fa-fw"></i> + <?= $this->url->link(t('Add a new task'), 'TaskCreationController', 'show', array('project_id' => $project['id']), false, 'popover') ?> + </li> + <?php endif ?> + <li> - <i class="fa fa-dashboard fa-fw"></i> + <i class="fa fa-dashboard fa-fw"></i> <?= $this->url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?> </li> <?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?> <li> - <i class="fa fa-filter fa-fw"></i> + <i class="fa fa-filter fa-fw"></i> <?= $this->url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?> </li> <?php endif ?> <?php if ($project['is_public']): ?> <li> - <i class="fa fa-share-alt fa-fw"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?> + <i class="fa fa-share-alt fa-fw"></i> + <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?> </li> <?php endif ?> @@ -52,21 +60,21 @@ <?php if ($this->user->hasProjectAccess('analytic', 'tasks', $project['id'])): ?> <li> - <i class="fa fa-line-chart fa-fw"></i> + <i class="fa fa-line-chart fa-fw"></i> <?= $this->url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?> </li> <?php endif ?> <?php if ($this->user->hasProjectAccess('export', 'tasks', $project['id'])): ?> <li> - <i class="fa fa-download fa-fw"></i> + <i class="fa fa-download fa-fw"></i> <?= $this->url->link(t('Exports'), 'export', 'tasks', array('project_id' => $project['id'])) ?> </li> <?php endif ?> <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> <li> - <i class="fa fa-cog fa-fw"></i> + <i class="fa fa-cog fa-fw"></i> <?= $this->url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?> </li> <?php endif ?> diff --git a/app/Template/task_bulk/show.php b/app/Template/task_bulk/show.php index 628b2c27..5f76f808 100644 --- a/app/Template/task_bulk/show.php +++ b/app/Template/task_bulk/show.php @@ -2,7 +2,7 @@ <h2><?= t('Create tasks in bulk') ?></h2> </div> -<form class="popover-form" method="post" action="<?= $this->url->href('TaskBulk', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('TaskBulkController', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('column_id', $values) ?> <?= $this->form->hidden('swimlane_id', $values) ?> diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/show.php index c963bdcf..d3991177 100644 --- a/app/Template/task_creation/form.php +++ b/app/Template/task_creation/show.php @@ -2,7 +2,7 @@ <h2><?= t('New task') ?></h2> </div> -<form class="popover-form" method="post" action="<?= $this->url->href('taskcreation', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off"> +<form class="popover-form" method="post" action="<?= $this->url->href('TaskCreationController', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> |