diff options
-rw-r--r-- | app/Controller/ProjectEditController.php (renamed from app/Controller/ProjectEdit.php) | 8 | ||||
-rw-r--r-- | app/ServiceProvider/AuthenticationProvider.php | 2 | ||||
-rw-r--r-- | app/ServiceProvider/RouteProvider.php | 8 | ||||
-rw-r--r-- | app/Template/custom_filter/add.php | 4 | ||||
-rw-r--r-- | app/Template/custom_filter/edit.php | 4 | ||||
-rw-r--r-- | app/Template/project/dropdown.php | 2 | ||||
-rw-r--r-- | app/Template/project/sidebar.php | 8 | ||||
-rw-r--r-- | app/Template/project_edit/dates.php | 10 | ||||
-rw-r--r-- | app/Template/project_edit/description.php | 10 | ||||
-rw-r--r-- | app/Template/project_edit/general.php | 10 | ||||
-rw-r--r-- | app/Template/project_edit/task_priority.php | 10 | ||||
-rw-r--r-- | app/Template/project_header/dropdown.php | 2 | ||||
-rw-r--r-- | app/Template/project_overview/description.php | 4 | ||||
-rw-r--r-- | tests/units/Helper/UserHelperTest.php | 22 |
14 files changed, 52 insertions, 52 deletions
diff --git a/app/Controller/ProjectEdit.php b/app/Controller/ProjectEditController.php index e3ba74c3..774c6909 100644 --- a/app/Controller/ProjectEdit.php +++ b/app/Controller/ProjectEditController.php @@ -5,10 +5,10 @@ namespace Kanboard\Controller; /** * Project Edit Controller * - * @package controller + * @package Kanboard\Controller * @author Frederic Guillot */ -class ProjectEdit extends BaseController +class ProjectEditController extends BaseController { /** * General edition (most common operations) @@ -75,7 +75,7 @@ class ProjectEdit extends BaseController if ($valid) { if ($this->project->update($values)) { $this->flash->success(t('Project updated successfully.')); - return $this->response->redirect($this->helper->url->to('ProjectEdit', $redirect, array('project_id' => $project['id'])), true); + return $this->response->redirect($this->helper->url->to('ProjectEditController', $redirect, array('project_id' => $project['id'])), true); } else { $this->flash->failure(t('Unable to update this project.')); } @@ -111,7 +111,7 @@ class ProjectEdit extends BaseController } /** - * Common metthod to render different views + * Common method to render different views * * @access private * @param string $template diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php index fe9cee3c..051dcc30 100644 --- a/app/ServiceProvider/AuthenticationProvider.php +++ b/app/ServiceProvider/AuthenticationProvider.php @@ -83,7 +83,7 @@ class AuthenticationProvider implements ServiceProviderInterface $acl->add('Gantt', '*', Role::PROJECT_MANAGER); $acl->add('ProjectViewController', array('share', 'updateSharing', 'integrations', 'updateIntegrations', 'notifications', 'updateNotifications', 'duplicate', 'doDuplication'), Role::PROJECT_MANAGER); $acl->add('ProjectPermissionController', '*', Role::PROJECT_MANAGER); - $acl->add('ProjectEdit', '*', Role::PROJECT_MANAGER); + $acl->add('ProjectEditController', '*', Role::PROJECT_MANAGER); $acl->add('ProjectFile', '*', Role::PROJECT_MEMBER); $acl->add('Projectuser', '*', Role::PROJECT_MANAGER); $acl->add('ProjectStatusController', '*', Role::PROJECT_MANAGER); diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php index e52b0762..2d705217 100644 --- a/app/ServiceProvider/RouteProvider.php +++ b/app/ServiceProvider/RouteProvider.php @@ -65,10 +65,10 @@ class RouteProvider implements ServiceProviderInterface $container['route']->addRoute('project/:project_id/overview', 'ProjectOverview', 'show'); // ProjectEdit routes - $container['route']->addRoute('project/:project_id/edit', 'ProjectEdit', 'edit'); - $container['route']->addRoute('project/:project_id/edit/dates', 'ProjectEdit', 'dates'); - $container['route']->addRoute('project/:project_id/edit/description', 'ProjectEdit', 'description'); - $container['route']->addRoute('project/:project_id/edit/priority', 'ProjectEdit', 'priority'); + $container['route']->addRoute('project/:project_id/edit', 'ProjectEditController', 'edit'); + $container['route']->addRoute('project/:project_id/edit/dates', 'ProjectEditController', 'dates'); + $container['route']->addRoute('project/:project_id/edit/description', 'ProjectEditController', 'description'); + $container['route']->addRoute('project/:project_id/edit/priority', 'ProjectEditController', 'priority'); // ProjectUser routes $container['route']->addRoute('projects/managers/:user_id', 'projectuser', 'managers'); diff --git a/app/Template/custom_filter/add.php b/app/Template/custom_filter/add.php index e3e144ae..56f7921c 100644 --- a/app/Template/custom_filter/add.php +++ b/app/Template/custom_filter/add.php @@ -12,7 +12,7 @@ <?= $this->form->label(t('Filter'), 'filter') ?> <?= $this->form->text('filter', $values, $errors, array('required', 'maxlength="100"')) ?> - <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEditController', 'edit', $project['id'])): ?> <?= $this->form->checkbox('is_shared', t('Share with all project members'), 1) ?> <?php endif ?> @@ -21,4 +21,4 @@ <div class="form-actions"> <button type="submit" class="btn btn-blue"><?= t('Save') ?></button> </div> -</form>
\ No newline at end of file +</form> diff --git a/app/Template/custom_filter/edit.php b/app/Template/custom_filter/edit.php index 5d07e8c2..051a5062 100644 --- a/app/Template/custom_filter/edit.php +++ b/app/Template/custom_filter/edit.php @@ -16,7 +16,7 @@ <?= $this->form->label(t('Filter'), 'filter') ?> <?= $this->form->text('filter', $values, $errors, array('required', 'maxlength="100"')) ?> - <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEditController', 'edit', $project['id'])): ?> <?= $this->form->checkbox('is_shared', t('Share with all project members'), 1, $values['is_shared'] == 1) ?> <?php else: ?> <?= $this->form->hidden('is_shared', $values) ?> @@ -29,4 +29,4 @@ <?= t('or') ?> <?= $this->url->link(t('cancel'), 'customfilter', 'index', array('project_id' => $project['id']), false, 'close-popover') ?> </div> -</form>
\ No newline at end of file +</form> diff --git a/app/Template/project/dropdown.php b/app/Template/project/dropdown.php index 02bc4c02..edebdd65 100644 --- a/app/Template/project/dropdown.php +++ b/app/Template/project/dropdown.php @@ -34,7 +34,7 @@ <?= $this->hook->render('template:project:dropdown', array('project' => $project)) ?> - <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEditController', 'edit', $project['id'])): ?> <li> <i class="fa fa-cog fa-fw"></i> <?= $this->url->link(t('Settings'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?> diff --git a/app/Template/project/sidebar.php b/app/Template/project/sidebar.php index 2d49ca58..1071e78b 100644 --- a/app/Template/project/sidebar.php +++ b/app/Template/project/sidebar.php @@ -10,9 +10,9 @@ </li> <?php endif ?> - <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> - <li <?= $this->app->checkMenuSelection('ProjectEdit') ?>> - <?= $this->url->link(t('Edit project'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?> + <?php if ($this->user->hasProjectAccess('ProjectEditController', 'edit', $project['id'])): ?> + <li <?= $this->app->checkMenuSelection('ProjectEditController') ?>> + <?= $this->url->link(t('Edit project'), 'ProjectEditController', 'edit', array('project_id' => $project['id'])) ?> </li> <li <?= $this->app->checkMenuSelection('ProjectViewController', 'share') ?>> <?= $this->url->link(t('Public access'), 'ProjectViewController', 'share', array('project_id' => $project['id'])) ?> @@ -33,7 +33,7 @@ <?= $this->url->link(t('Categories'), 'category', 'index', array('project_id' => $project['id'])) ?> </li> <?php if ($project['is_private'] == 0): ?> - <li <?= $this->app->checkMenuSelection('ProjectPermission') ?>> + <li <?= $this->app->checkMenuSelection('ProjectPermissionController') ?>> <?= $this->url->link(t('Permissions'), 'ProjectPermissionController', 'index', array('project_id' => $project['id'])) ?> </li> <?php endif ?> diff --git a/app/Template/project_edit/dates.php b/app/Template/project_edit/dates.php index f77b7260..48135ddc 100644 --- a/app/Template/project_edit/dates.php +++ b/app/Template/project_edit/dates.php @@ -1,13 +1,13 @@ <div class="page-header"> <h2><?= t('Edit project') ?></h2> <ul> - <li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li class="active"><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li ><?= $this->url->link(t('General'), 'ProjectEditController', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li class="active"><?= $this->url->link(t('Dates'), 'ProjectEditController', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Task priority'), 'ProjectEditController', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li> </ul> </div> -<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off"> +<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('name', $values) ?> diff --git a/app/Template/project_edit/description.php b/app/Template/project_edit/description.php index e6c42caf..f7e7be46 100644 --- a/app/Template/project_edit/description.php +++ b/app/Template/project_edit/description.php @@ -1,13 +1,13 @@ <div class="page-header"> <h2><?= t('Edit project') ?></h2> <ul> - <li><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li class="active"><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('General'), 'ProjectEditController', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Dates'), 'ProjectEditController', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li class="active"><?= $this->url->link(t('Description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Task priority'), 'ProjectEditController', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li> </ul> </div> -<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off"> +<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('name', $values) ?> diff --git a/app/Template/project_edit/general.php b/app/Template/project_edit/general.php index 6c3fa68d..b817bcd4 100644 --- a/app/Template/project_edit/general.php +++ b/app/Template/project_edit/general.php @@ -1,13 +1,13 @@ <div class="page-header"> <h2><?= t('Edit project') ?></h2> <ul> - <li class="active"><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li class="active"><?= $this->url->link(t('General'), 'ProjectEditController', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Dates'), 'ProjectEditController', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Task priority'), 'ProjectEditController', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li> </ul> </div> -<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off"> +<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> diff --git a/app/Template/project_edit/task_priority.php b/app/Template/project_edit/task_priority.php index 56c25753..3ef4b3cb 100644 --- a/app/Template/project_edit/task_priority.php +++ b/app/Template/project_edit/task_priority.php @@ -1,13 +1,13 @@ <div class="page-header"> <h2><?= t('Edit project') ?></h2> <ul> - <li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li> - <li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li ><?= $this->url->link(t('General'), 'ProjectEditController', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Dates'), 'ProjectEditController', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li><?= $this->url->link(t('Description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li> + <li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEditController', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li> </ul> </div> -<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off"> +<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEditController', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off"> <?= $this->form->csrf() ?> <?= $this->form->hidden('id', $values) ?> <?= $this->form->hidden('name', $values) ?> diff --git a/app/Template/project_header/dropdown.php b/app/Template/project_header/dropdown.php index 7dffcb85..5a27e981 100644 --- a/app/Template/project_header/dropdown.php +++ b/app/Template/project_header/dropdown.php @@ -72,7 +72,7 @@ </li> <?php endif ?> - <?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEditController', 'edit', $project['id'])): ?> <li> <i class="fa fa-cog fa-fw"></i> <?= $this->url->link(t('Settings'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?> diff --git a/app/Template/project_overview/description.php b/app/Template/project_overview/description.php index 72ccf06a..0c2027ed 100644 --- a/app/Template/project_overview/description.php +++ b/app/Template/project_overview/description.php @@ -3,9 +3,9 @@ <h3><a href="#" class="fa accordion-toggle"></a> <?= t('Description') ?></h3> </div> <div class="accordion-content"> - <?php if ($this->user->hasProjectAccess('ProjectEdit', 'description', $project['id'])): ?> + <?php if ($this->user->hasProjectAccess('ProjectEditController', 'description', $project['id'])): ?> <div class="buttons-header"> - <?= $this->url->button('fa-edit', t('Edit description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), 'popover') ?> + <?= $this->url->button('fa-edit', t('Edit description'), 'ProjectEditController', 'description', array('project_id' => $project['id']), 'popover') ?> </div> <?php endif ?> <article class="markdown"> diff --git a/tests/units/Helper/UserHelperTest.php b/tests/units/Helper/UserHelperTest.php index c5e5903f..0b339422 100644 --- a/tests/units/Helper/UserHelperTest.php +++ b/tests/units/Helper/UserHelperTest.php @@ -85,7 +85,7 @@ class UserHelperTest extends Base $this->assertEquals(1, $project->create(array('name' => 'My project'))); - $this->assertTrue($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); + $this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); } @@ -101,7 +101,7 @@ class UserHelperTest extends Base $this->assertEquals(1, $project->create(array('name' => 'My project'))); - $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 1)); } @@ -117,7 +117,7 @@ class UserHelperTest extends Base $this->assertEquals(1, $project->create(array('name' => 'My project'))); - $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 1)); } @@ -138,12 +138,12 @@ class UserHelperTest extends Base $this->assertEquals(2, $user->create(array('username' => 'user'))); $this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MANAGER)); - $this->assertTrue($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); + $this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('task', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('taskcreationcontroller', 'save', 1)); - $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 2)); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('task', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2)); @@ -166,12 +166,12 @@ class UserHelperTest extends Base $this->assertEquals(2, $user->create(array('username' => 'user'))); $this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MANAGER)); - $this->assertTrue($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); + $this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('task', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('TaskCreationController', 'save', 1)); - $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 2)); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('task', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2)); @@ -194,12 +194,12 @@ class UserHelperTest extends Base $this->assertEquals(2, $user->create(array('username' => 'user'))); $this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MEMBER)); - $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('task', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('TaskCreationController', 'save', 1)); - $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 2)); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('task', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2)); @@ -222,12 +222,12 @@ class UserHelperTest extends Base $this->assertEquals(2, $user->create(array('username' => 'user'))); $this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_VIEWER)); - $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 1)); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1)); $this->assertTrue($helper->hasProjectAccess('board', 'show', 1)); $this->assertTrue($helper->hasProjectAccess('task', 'show', 1)); $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 1)); - $this->assertFalse($helper->hasProjectAccess('ProjectEdit', 'edit', 2)); + $this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2)); $this->assertFalse($helper->hasProjectAccess('board', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('task', 'show', 2)); $this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2)); |