From 8a6f02735b628033a3284d06a9f633bd260e19ef Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 15 May 2016 20:09:43 -0400 Subject: Added task creation menu for all projects views --- ChangeLog | 2 + app/Controller/DashboardController.php | 6 +- app/Controller/TaskBulk.php | 88 -------------------------- app/Controller/TaskBulkController.php | 88 ++++++++++++++++++++++++++ app/Controller/TaskCreationController.php | 87 +++++++++++++++++++++++++ app/Controller/Taskcreation.php | 87 ------------------------- app/Core/Controller/BaseMiddleware.php | 4 +- app/ServiceProvider/AuthenticationProvider.php | 3 +- app/Subscriber/BootstrapSubscriber.php | 8 +-- app/Template/board/table_column.php | 8 +-- app/Template/board/table_container.php | 4 +- app/Template/listing/show.php | 2 +- app/Template/project_header/dropdown.php | 20 ++++-- app/Template/task_bulk/show.php | 2 +- app/Template/task_creation/form.php | 53 ---------------- app/Template/task_creation/show.php | 53 ++++++++++++++++ tests/units/Helper/UserHelperTest.php | 16 ++--- 17 files changed, 271 insertions(+), 260 deletions(-) delete mode 100644 app/Controller/TaskBulk.php create mode 100644 app/Controller/TaskBulkController.php create mode 100644 app/Controller/TaskCreationController.php delete mode 100644 app/Controller/Taskcreation.php delete mode 100644 app/Template/task_creation/form.php create mode 100644 app/Template/task_creation/show.php diff --git a/ChangeLog b/ChangeLog index 3477be94..7c6c1f40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,12 +3,14 @@ Version 1.0.29 (unreleased) New features: +* Added menu entry to add tasks from all project views * Add tasks in bulk from the board * Add dropdown for projects Improvements: * Use Gulp and Bower to manage assets +* Controller and Middleware refactoring Version 1.0.28 -------------- 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/TaskBulk.php deleted file mode 100644 index d0a1b276..00000000 --- a/app/Controller/TaskBulk.php +++ /dev/null @@ -1,88 +0,0 @@ -getProject(); - - if (empty($values)) { - $values = array( - 'swimlane_id' => $this->request->getIntegerParam('swimlane_id'), - 'column_id' => $this->request->getIntegerParam('column_id'), - 'project_id' => $project['id'], - ); - } - - $this->response->html($this->template->render('task_bulk/show', array( - 'project' => $project, - 'values' => $values, - 'errors' => $errors, - 'users_list' => $this->projectUserRole->getAssignableUsersList($project['id'], true, false, true), - 'colors_list' => $this->color->getList(), - 'categories_list' => $this->category->getList($project['id']), - ))); - } - - /** - * Save all tasks in the database - */ - public function save() - { - $project = $this->getProject(); - $values = $this->request->getValues(); - list($valid, $errors) = $this->taskValidator->validateBulkCreation($values); - - if ($valid) { - $this->createTasks($project, $values); - $this->response->redirect($this->helper->url->to( - 'Board', - 'show', - array('project_id' => $project['id']), - 'swimlane-'. $values['swimlane_id'] - ), true); - } else { - $this->show($values, $errors); - } - } - - /** - * Create all tasks - * - * @param array $project - * @param array $values - */ - protected function createTasks(array $project, array $values) - { - $tasks = preg_split('/\r\n|[\r\n]/', $values['tasks']); - - foreach ($tasks as $title) { - $title = trim($title); - - if (! empty($title)) { - $this->taskCreation->create(array( - 'title' => $title, - 'column_id' => $values['column_id'], - 'swimlane_id' => $values['swimlane_id'], - 'category_id' => empty($values['category_id']) ? 0 : $values['category_id'], - 'owner_id' => empty($values['owner_id']) ? 0 : $values['owner_id'], - 'color_id' => $values['color_id'], - 'project_id' => $project['id'], - )); - } - } - } -} diff --git a/app/Controller/TaskBulkController.php b/app/Controller/TaskBulkController.php new file mode 100644 index 00000000..4b4a2594 --- /dev/null +++ b/app/Controller/TaskBulkController.php @@ -0,0 +1,88 @@ +getProject(); + + if (empty($values)) { + $values = array( + 'swimlane_id' => $this->request->getIntegerParam('swimlane_id'), + 'column_id' => $this->request->getIntegerParam('column_id'), + 'project_id' => $project['id'], + ); + } + + $this->response->html($this->template->render('task_bulk/show', array( + 'project' => $project, + 'values' => $values, + 'errors' => $errors, + 'users_list' => $this->projectUserRole->getAssignableUsersList($project['id'], true, false, true), + 'colors_list' => $this->color->getList(), + 'categories_list' => $this->category->getList($project['id']), + ))); + } + + /** + * Save all tasks in the database + */ + public function save() + { + $project = $this->getProject(); + $values = $this->request->getValues(); + list($valid, $errors) = $this->taskValidator->validateBulkCreation($values); + + if ($valid) { + $this->createTasks($project, $values); + $this->response->redirect($this->helper->url->to( + 'Board', + 'show', + array('project_id' => $project['id']), + 'swimlane-'. $values['swimlane_id'] + ), true); + } else { + $this->show($values, $errors); + } + } + + /** + * Create all tasks + * + * @param array $project + * @param array $values + */ + protected function createTasks(array $project, array $values) + { + $tasks = preg_split('/\r\n|[\r\n]/', $values['tasks']); + + foreach ($tasks as $title) { + $title = trim($title); + + if (! empty($title)) { + $this->taskCreation->create(array( + 'title' => $title, + 'column_id' => $values['column_id'], + 'swimlane_id' => $values['swimlane_id'], + 'category_id' => empty($values['category_id']) ? 0 : $values['category_id'], + 'owner_id' => empty($values['owner_id']) ? 0 : $values['owner_id'], + 'color_id' => $values['color_id'], + 'project_id' => $project['id'], + )); + } + } + } +} diff --git a/app/Controller/TaskCreationController.php b/app/Controller/TaskCreationController.php new file mode 100644 index 00000000..2a63ddcc --- /dev/null +++ b/app/Controller/TaskCreationController.php @@ -0,0 +1,87 @@ +getProject(); + $swimlanes_list = $this->swimlane->getList($project['id'], false, true); + + if (empty($values)) { + $values = array( + 'swimlane_id' => $this->request->getIntegerParam('swimlane_id', key($swimlanes_list)), + 'column_id' => $this->request->getIntegerParam('column_id'), + 'color_id' => $this->color->getDefaultColor(), + 'owner_id' => $this->userSession->getId(), + ); + + $values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values)); + $values = $this->hook->merge('controller:task-creation:form:default', $values, array('default_values' => $values)); + } + + $this->response->html($this->template->render('task_creation/show', array( + 'project' => $project, + 'errors' => $errors, + 'values' => $values + array('project_id' => $project['id']), + 'columns_list' => $this->column->getList($project['id']), + 'users_list' => $this->projectUserRole->getAssignableUsersList($project['id'], true, false, true), + 'colors_list' => $this->color->getList(), + 'categories_list' => $this->category->getList($project['id']), + 'swimlanes_list' => $swimlanes_list, + 'title' => $project['name'].' > '.t('New task') + ))); + } + + /** + * Validate and save a new task + * + * @access public + */ + public function save() + { + $project = $this->getProject(); + $values = $this->request->getValues(); + + list($valid, $errors) = $this->taskValidator->validateCreation($values); + + if ($valid && $this->taskCreation->create($values)) { + $this->flash->success(t('Task created successfully.')); + return $this->afterSave($project, $values); + } + + $this->flash->failure(t('Unable to create your task.')); + return $this->show($values, $errors); + } + + private function afterSave(array $project, array &$values) + { + if (isset($values['another_task']) && $values['another_task'] == 1) { + return $this->show(array( + 'owner_id' => $values['owner_id'], + 'color_id' => $values['color_id'], + 'category_id' => isset($values['category_id']) ? $values['category_id'] : 0, + 'column_id' => $values['column_id'], + 'swimlane_id' => isset($values['swimlane_id']) ? $values['swimlane_id'] : 0, + 'another_task' => 1, + )); + } + + return $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project['id'])), true); + } +} diff --git a/app/Controller/Taskcreation.php b/app/Controller/Taskcreation.php deleted file mode 100644 index af7d0c80..00000000 --- a/app/Controller/Taskcreation.php +++ /dev/null @@ -1,87 +0,0 @@ -getProject(); - $swimlanes_list = $this->swimlane->getList($project['id'], false, true); - - if (empty($values)) { - $values = array( - 'swimlane_id' => $this->request->getIntegerParam('swimlane_id', key($swimlanes_list)), - 'column_id' => $this->request->getIntegerParam('column_id'), - 'color_id' => $this->color->getDefaultColor(), - 'owner_id' => $this->userSession->getId(), - ); - - $values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values)); - $values = $this->hook->merge('controller:task-creation:form:default', $values, array('default_values' => $values)); - } - - $this->response->html($this->template->render('task_creation/form', array( - 'project' => $project, - 'errors' => $errors, - 'values' => $values + array('project_id' => $project['id']), - 'columns_list' => $this->column->getList($project['id']), - 'users_list' => $this->projectUserRole->getAssignableUsersList($project['id'], true, false, true), - 'colors_list' => $this->color->getList(), - 'categories_list' => $this->category->getList($project['id']), - 'swimlanes_list' => $swimlanes_list, - 'title' => $project['name'].' > '.t('New task') - ))); - } - - /** - * Validate and save a new task - * - * @access public - */ - public function save() - { - $project = $this->getProject(); - $values = $this->request->getValues(); - - list($valid, $errors) = $this->taskValidator->validateCreation($values); - - if ($valid && $this->taskCreation->create($values)) { - $this->flash->success(t('Task created successfully.')); - return $this->afterSave($project, $values); - } - - $this->flash->failure(t('Unable to create your task.')); - return $this->create($values, $errors); - } - - private function afterSave(array $project, array &$values) - { - if (isset($values['another_task']) && $values['another_task'] == 1) { - return $this->create(array( - 'owner_id' => $values['owner_id'], - 'color_id' => $values['color_id'], - 'category_id' => isset($values['category_id']) ? $values['category_id'] : 0, - 'column_id' => $values['column_id'], - 'swimlane_id' => isset($values['swimlane_id']) ? $values['swimlane_id'] : 0, - 'another_task' => 1, - )); - } - - return $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project['id'])), true); - } -} 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 @@
- user->hasProjectAccess('taskcreation', 'create', $column['project_id'])): ?> + user->hasProjectAccess('TaskCreationController', 'show', $column['project_id'])): ?>
- 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')) ?> + 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')) ?>
@@ -35,10 +35,10 @@ - user->hasProjectAccess('Taskcreation', 'create', $column['project_id'])): ?> + user->hasProjectAccess('TaskCreationController', 'show', $column['project_id'])): ?>
  • - 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') ?> + 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') ?>
  • 0): ?>
  • 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="url->href('board', 'save', array('project_id' => $project['id'])) ?>" data-reload-url="url->href('board', 'reload', array('project_id' => $project['id'])) ?>" data-check-url="url->href('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>" - data-task-creation-url="url->href('taskcreation', 'create', array('project_id' => $project['id'])) ?>" + data-task-creation-url="url->href('TaskCreationController', 'show', array('project_id' => $project['id'])) ?>" > @@ -55,4 +55,4 @@ -
  • \ No newline at end of file + 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 @@ - \ No newline at end of file + 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 @@ + user->hasProjectAccess('TaskCreationController', 'show', $project['id'])): ?> +
  • + + url->link(t('Add a new task'), 'TaskCreationController', 'show', array('project_id' => $project['id']), false, 'popover') ?> +
  • + +
  • -   + url->link(t('Activity'), 'activity', 'project', array('project_id' => $project['id'])) ?>
  • user->hasProjectAccess('customfilter', 'index', $project['id'])): ?>
  • -   + url->link(t('Custom filters'), 'customfilter', 'index', array('project_id' => $project['id'])) ?>
  • -  url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?> + + url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
  • @@ -52,21 +60,21 @@ user->hasProjectAccess('analytic', 'tasks', $project['id'])): ?>
  • -   + url->link(t('Analytics'), 'analytic', 'tasks', array('project_id' => $project['id'])) ?>
  • user->hasProjectAccess('export', 'tasks', $project['id'])): ?>
  • -   + url->link(t('Exports'), 'export', 'tasks', array('project_id' => $project['id'])) ?>
  • user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
  • -   + url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
  • 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 @@

    -
    + form->csrf() ?> form->hidden('column_id', $values) ?> form->hidden('swimlane_id', $values) ?> diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php deleted file mode 100644 index c963bdcf..00000000 --- a/app/Template/task_creation/form.php +++ /dev/null @@ -1,53 +0,0 @@ - - - - - form->csrf() ?> - -
    - form->label(t('Title'), 'title') ?> - form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?> - - form->label(t('Description'), 'description') ?> - form->textarea( - 'description', - $values, - $errors, - array( - 'placeholder="'.t('Leave a description').'"', - 'tabindex="2"', - 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $values['project_id'])).'"' - ), - 'markdown-editor' - ) ?> - - render('task/color_picker', array('colors_list' => $colors_list, 'values' => $values)) ?> - - - form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> - - - hook->render('template:task:form:left-column', array('values' => $values, 'errors' => $errors)) ?> -
    - -
    - form->hidden('project_id', $values) ?> - task->selectAssignee($users_list, $values, $errors) ?> - task->selectCategory($categories_list, $values, $errors) ?> - task->selectSwimlane($swimlanes_list, $values, $errors) ?> - task->selectColumn($columns_list, $values, $errors) ?> - task->selectPriority($project, $values) ?> - task->selectScore($values, $errors) ?> - task->selectTimeEstimated($values, $errors) ?> - task->selectDueDate($values, $errors) ?> - - hook->render('template:task:form:right-column', array('values' => $values, 'errors' => $errors)) ?> -
    - -
    - - url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?> -
    -
    diff --git a/app/Template/task_creation/show.php b/app/Template/task_creation/show.php new file mode 100644 index 00000000..d3991177 --- /dev/null +++ b/app/Template/task_creation/show.php @@ -0,0 +1,53 @@ + + +
    + + form->csrf() ?> + +
    + form->label(t('Title'), 'title') ?> + form->text('title', $values, $errors, array('autofocus', 'required', 'maxlength="200"', 'tabindex="1"'), 'form-input-large') ?> + + form->label(t('Description'), 'description') ?> + form->textarea( + 'description', + $values, + $errors, + array( + 'placeholder="'.t('Leave a description').'"', + 'tabindex="2"', + 'data-mention-search-url="'.$this->url->href('UserHelper', 'mention', array('project_id' => $values['project_id'])).'"' + ), + 'markdown-editor' + ) ?> + + render('task/color_picker', array('colors_list' => $colors_list, 'values' => $values)) ?> + + + form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> + + + hook->render('template:task:form:left-column', array('values' => $values, 'errors' => $errors)) ?> +
    + +
    + form->hidden('project_id', $values) ?> + task->selectAssignee($users_list, $values, $errors) ?> + task->selectCategory($categories_list, $values, $errors) ?> + task->selectSwimlane($swimlanes_list, $values, $errors) ?> + task->selectColumn($columns_list, $values, $errors) ?> + task->selectPriority($project, $values) ?> + task->selectScore($values, $errors) ?> + task->selectTimeEstimated($values, $errors) ?> + task->selectDueDate($values, $errors) ?> + + hook->render('template:task:form:right-column', array('values' => $values, 'errors' => $errors)) ?> +
    + +
    + + url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?> +
    +
    diff --git a/tests/units/Helper/UserHelperTest.php b/tests/units/Helper/UserHelperTest.php index 135f8ca6..c1feafd2 100644 --- a/tests/units/Helper/UserHelperTest.php +++ b/tests/units/Helper/UserHelperTest.php @@ -141,12 +141,12 @@ class UserHelperTest extends Base $this->assertTrue($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('task', 'show', 1)); - $this->assertTrue($helper->hasProjectAccess('taskcreation', 'save', 1)); + $this->assertTrue($helper->hasProjectAccess('taskcreationcontroller', 'save', 1)); $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 2)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('task', 'show', 2)); - $this->assertFalse($helper->hasProjectAccess('taskcreation', 'save', 2)); + $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2)); } public function testHasProjectAccessForProjectManagers() @@ -169,12 +169,12 @@ class UserHelperTest extends Base $this->assertTrue($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('task', 'show', 1)); - $this->assertTrue($helper->hasProjectAccess('taskcreation', 'save', 1)); + $this->assertTrue($helper->hasProjectAccess('TaskCreationController', 'save', 1)); $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 2)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('task', 'show', 2)); - $this->assertFalse($helper->hasProjectAccess('taskcreation', 'save', 2)); + $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2)); } public function testHasProjectAccessForProjectMembers() @@ -197,12 +197,12 @@ class UserHelperTest extends Base $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('task', 'show', 1)); - $this->assertTrue($helper->hasProjectAccess('taskcreation', 'save', 1)); + $this->assertTrue($helper->hasProjectAccess('TaskCreationController', 'save', 1)); $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 2)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('task', 'show', 2)); - $this->assertFalse($helper->hasProjectAccess('taskcreation', 'save', 2)); + $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2)); } public function testHasProjectAccessForProjectViewers() @@ -225,12 +225,12 @@ class UserHelperTest extends Base $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('task', 'show', 1)); - $this->assertFalse($helper->hasProjectAccess('taskcreation', 'save', 1)); + $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 1)); $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 2)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('task', 'show', 2)); - $this->assertFalse($helper->hasProjectAccess('taskcreation', 'save', 2)); + $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2)); } public function testCanRemoveTask() -- cgit v1.2.3