Split board controller into multiple classes
This commit is contained in:
@@ -97,7 +97,7 @@ abstract class BaseApi extends Base
|
|||||||
{
|
{
|
||||||
if (! empty($project)) {
|
if (! empty($project)) {
|
||||||
$project['url'] = array(
|
$project['url'] = array(
|
||||||
'board' => $this->helper->url->to('board', 'show', array('project_id' => $project['id']), '', true),
|
'board' => $this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id']), '', true),
|
||||||
'calendar' => $this->helper->url->to('CalendarController', 'show', array('project_id' => $project['id']), '', true),
|
'calendar' => $this->helper->url->to('CalendarController', 'show', array('project_id' => $project['id']), '', true),
|
||||||
'list' => $this->helper->url->to('TaskListController', 'show', array('project_id' => $project['id']), '', true),
|
'list' => $this->helper->url->to('TaskListController', 'show', array('project_id' => $project['id']), '', true),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,67 +6,15 @@ use Kanboard\Core\Controller\AccessForbiddenException;
|
|||||||
use Kanboard\Formatter\BoardFormatter;
|
use Kanboard\Formatter\BoardFormatter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Board controller
|
* Class BoardAjaxController
|
||||||
*
|
*
|
||||||
* @package controller
|
* @package Kanboard\Controller
|
||||||
* @author Frederic Guillot
|
* @author Fredric Guillot
|
||||||
*/
|
*/
|
||||||
class Board extends BaseController
|
class BoardAjaxController extends BaseController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Display the public version of a board
|
* Save new task positions (Ajax request made by the drag and drop)
|
||||||
* Access checked by a simple token, no user login, read only, auto-refresh
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public function readonly()
|
|
||||||
{
|
|
||||||
$token = $this->request->getStringParam('token');
|
|
||||||
$project = $this->project->getByToken($token);
|
|
||||||
|
|
||||||
// Token verification
|
|
||||||
if (empty($project)) {
|
|
||||||
throw AccessForbiddenException::getInstance()->withoutLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Display the board with a specific layout
|
|
||||||
$this->response->html($this->helper->layout->app('board/view_public', array(
|
|
||||||
'project' => $project,
|
|
||||||
'swimlanes' => $this->board->getBoard($project['id']),
|
|
||||||
'title' => $project['name'],
|
|
||||||
'description' => $project['description'],
|
|
||||||
'no_layout' => true,
|
|
||||||
'not_editable' => true,
|
|
||||||
'board_public_refresh_interval' => $this->config->get('board_public_refresh_interval'),
|
|
||||||
'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'),
|
|
||||||
'board_highlight_period' => $this->config->get('board_highlight_period'),
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show a board for a given project
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
*/
|
|
||||||
public function show()
|
|
||||||
{
|
|
||||||
$project = $this->getProject();
|
|
||||||
$search = $this->helper->projectHeader->getSearchQuery($project);
|
|
||||||
|
|
||||||
$this->response->html($this->helper->layout->app('board/view_private', array(
|
|
||||||
'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'),
|
|
||||||
'swimlanes' => $this->taskLexer
|
|
||||||
->build($search)
|
|
||||||
->format(BoardFormatter::getInstance($this->container)->setProjectId($project['id']))
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save the board (Ajax request made by the drag and drop)
|
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
@@ -106,7 +54,7 @@ class Board extends BaseController
|
|||||||
$timestamp = $this->request->getIntegerParam('timestamp');
|
$timestamp = $this->request->getIntegerParam('timestamp');
|
||||||
|
|
||||||
if (! $project_id || ! $this->request->isAjax()) {
|
if (! $project_id || ! $this->request->isAjax()) {
|
||||||
$this->response->status(403);
|
throw new AccessForbiddenException();
|
||||||
} elseif (! $this->project->isModifiedSince($project_id, $timestamp)) {
|
} elseif (! $this->project->isModifiedSince($project_id, $timestamp)) {
|
||||||
$this->response->status(304);
|
$this->response->status(304);
|
||||||
} else {
|
} else {
|
||||||
@@ -167,18 +115,18 @@ class Board extends BaseController
|
|||||||
if ($this->request->isAjax()) {
|
if ($this->request->isAjax()) {
|
||||||
$this->response->html($this->renderBoard($project_id));
|
$this->response->html($this->renderBoard($project_id));
|
||||||
} else {
|
} else {
|
||||||
$this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project_id)));
|
$this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project_id)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render board
|
* Render board
|
||||||
*
|
*
|
||||||
* @access private
|
* @access protected
|
||||||
* @param integer $project_id
|
* @param integer $project_id
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function renderBoard($project_id)
|
protected function renderBoard($project_id)
|
||||||
{
|
{
|
||||||
return $this->template->render('board/table_container', array(
|
return $this->template->render('board/table_container', array(
|
||||||
'project' => $this->project->getById($project_id),
|
'project' => $this->project->getById($project_id),
|
||||||
@@ -42,6 +42,6 @@ class BoardPopoverController extends BaseController
|
|||||||
|
|
||||||
$this->taskStatus->closeTasksBySwimlaneAndColumn($values['swimlane_id'], $values['column_id']);
|
$this->taskStatus->closeTasksBySwimlaneAndColumn($values['swimlane_id'], $values['column_id']);
|
||||||
$this->flash->success(t('All tasks of the column "%s" and the swimlane "%s" have been closed successfully.', $this->column->getColumnTitleById($values['column_id']), $this->swimlane->getNameById($values['swimlane_id']) ?: t($project['default_swimlane'])));
|
$this->flash->success(t('All tasks of the column "%s" and the swimlane "%s" have been closed successfully.', $this->column->getColumnTitleById($values['column_id']), $this->swimlane->getNameById($values['swimlane_id']) ?: t($project['default_swimlane'])));
|
||||||
$this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project['id'])));
|
$this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
65
app/Controller/BoardViewController.php
Normal file
65
app/Controller/BoardViewController.php
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Kanboard\Controller;
|
||||||
|
|
||||||
|
use Kanboard\Core\Controller\AccessForbiddenException;
|
||||||
|
use Kanboard\Formatter\BoardFormatter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Board controller
|
||||||
|
*
|
||||||
|
* @package Kanboard\Controller
|
||||||
|
* @author Frederic Guillot
|
||||||
|
*/
|
||||||
|
class BoardViewController extends BaseController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display the public version of a board
|
||||||
|
* Access checked by a simple token, no user login, read only, auto-refresh
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function readonly()
|
||||||
|
{
|
||||||
|
$token = $this->request->getStringParam('token');
|
||||||
|
$project = $this->project->getByToken($token);
|
||||||
|
|
||||||
|
if (empty($project)) {
|
||||||
|
throw AccessForbiddenException::getInstance()->withoutLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->response->html($this->helper->layout->app('board/view_public', array(
|
||||||
|
'project' => $project,
|
||||||
|
'swimlanes' => $this->board->getBoard($project['id']),
|
||||||
|
'title' => $project['name'],
|
||||||
|
'description' => $project['description'],
|
||||||
|
'no_layout' => true,
|
||||||
|
'not_editable' => true,
|
||||||
|
'board_public_refresh_interval' => $this->config->get('board_public_refresh_interval'),
|
||||||
|
'board_private_refresh_interval' => $this->config->get('board_private_refresh_interval'),
|
||||||
|
'board_highlight_period' => $this->config->get('board_highlight_period'),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show a board for a given project
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
*/
|
||||||
|
public function show()
|
||||||
|
{
|
||||||
|
$project = $this->getProject();
|
||||||
|
$search = $this->helper->projectHeader->getSearchQuery($project);
|
||||||
|
|
||||||
|
$this->response->html($this->helper->layout->app('board/view_private', array(
|
||||||
|
'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'),
|
||||||
|
'swimlanes' => $this->taskLexer
|
||||||
|
->build($search)
|
||||||
|
->format(BoardFormatter::getInstance($this->container)->setProjectId($project['id']))
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,7 +50,7 @@ class TaskBulkController extends BaseController
|
|||||||
if ($valid) {
|
if ($valid) {
|
||||||
$this->createTasks($project, $values);
|
$this->createTasks($project, $values);
|
||||||
$this->response->redirect($this->helper->url->to(
|
$this->response->redirect($this->helper->url->to(
|
||||||
'Board',
|
'BoardViewController',
|
||||||
'show',
|
'show',
|
||||||
array('project_id' => $project['id']),
|
array('project_id' => $project['id']),
|
||||||
'swimlane-'. $values['swimlane_id']
|
'swimlane-'. $values['swimlane_id']
|
||||||
|
|||||||
@@ -82,6 +82,6 @@ class TaskCreationController extends BaseController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $project['id'])), true);
|
return $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $project['id'])), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class TaskPopoverController extends BaseController
|
|||||||
$this->flash->failure(t('Unable to update your task.'));
|
$this->flash->failure(t('Unable to update your task.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $values['project_id'])), true);
|
$this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $values['project_id'])), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,7 +81,7 @@ class TaskPopoverController extends BaseController
|
|||||||
$this->flash->failure(t('Unable to update your task.'));
|
$this->flash->failure(t('Unable to update your task.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $values['project_id'])), true);
|
$this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $values['project_id'])), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class TaskViewController extends BaseController
|
|||||||
$this->flash->failure(t('Unable to remove this task.'));
|
$this->flash->failure(t('Unable to remove this task.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->response->redirect($this->helper->url->to('board', 'show', array('project_id' => $task['project_id'])), true);
|
return $this->response->redirect($this->helper->url->to('BoardViewController', 'show', array('project_id' => $task['project_id'])), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->response->html($this->template->render('task/remove', array(
|
return $this->response->html($this->template->render('task/remove', array(
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class ProjectGanttFormatter extends BaseFormatter implements FormatterInterface
|
|||||||
(int) date('j', $end),
|
(int) date('j', $end),
|
||||||
),
|
),
|
||||||
'link' => $this->helper->url->href('ProjectViewController', 'show', array('project_id' => $project['id'])),
|
'link' => $this->helper->url->href('ProjectViewController', 'show', array('project_id' => $project['id'])),
|
||||||
'board_link' => $this->helper->url->href('board', 'show', array('project_id' => $project['id'])),
|
'board_link' => $this->helper->url->href('BoardViewController', 'show', array('project_id' => $project['id'])),
|
||||||
'gantt_link' => $this->helper->url->href('gantt', 'project', array('project_id' => $project['id'])),
|
'gantt_link' => $this->helper->url->href('gantt', 'project', array('project_id' => $project['id'])),
|
||||||
'color' => $color,
|
'color' => $color,
|
||||||
'not_defined' => empty($project['start_date']) || empty($project['end_date']),
|
'not_defined' => empty($project['start_date']) || empty($project['end_date']),
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class AuthenticationProvider implements ServiceProviderInterface
|
|||||||
$acl->add('ProjectActionDuplicationController', '*', Role::PROJECT_MANAGER);
|
$acl->add('ProjectActionDuplicationController', '*', Role::PROJECT_MANAGER);
|
||||||
$acl->add('ActionCreationController', '*', Role::PROJECT_MANAGER);
|
$acl->add('ActionCreationController', '*', Role::PROJECT_MANAGER);
|
||||||
$acl->add('AnalyticController', '*', Role::PROJECT_MANAGER);
|
$acl->add('AnalyticController', '*', Role::PROJECT_MANAGER);
|
||||||
$acl->add('Board', 'save', Role::PROJECT_MEMBER);
|
$acl->add('BoardAjaxController', 'save', Role::PROJECT_MEMBER);
|
||||||
$acl->add('BoardPopoverController', '*', Role::PROJECT_MEMBER);
|
$acl->add('BoardPopoverController', '*', Role::PROJECT_MEMBER);
|
||||||
$acl->add('TaskPopoverController', '*', Role::PROJECT_MEMBER);
|
$acl->add('TaskPopoverController', '*', Role::PROJECT_MEMBER);
|
||||||
$acl->add('CalendarController', 'save', Role::PROJECT_MEMBER);
|
$acl->add('CalendarController', 'save', Role::PROJECT_MEMBER);
|
||||||
@@ -124,7 +124,7 @@ class AuthenticationProvider implements ServiceProviderInterface
|
|||||||
$acl->add('CaptchaController', '*', Role::APP_PUBLIC);
|
$acl->add('CaptchaController', '*', Role::APP_PUBLIC);
|
||||||
$acl->add('PasswordResetController', '*', Role::APP_PUBLIC);
|
$acl->add('PasswordResetController', '*', Role::APP_PUBLIC);
|
||||||
$acl->add('TaskViewController', 'readonly', Role::APP_PUBLIC);
|
$acl->add('TaskViewController', 'readonly', Role::APP_PUBLIC);
|
||||||
$acl->add('Board', 'readonly', Role::APP_PUBLIC);
|
$acl->add('BoardViewController', 'readonly', Role::APP_PUBLIC);
|
||||||
$acl->add('ICalendarController', '*', Role::APP_PUBLIC);
|
$acl->add('ICalendarController', '*', Role::APP_PUBLIC);
|
||||||
$acl->add('FeedController', '*', Role::APP_PUBLIC);
|
$acl->add('FeedController', '*', Role::APP_PUBLIC);
|
||||||
$acl->add('AvatarFileController', 'show', Role::APP_PUBLIC);
|
$acl->add('AvatarFileController', 'show', Role::APP_PUBLIC);
|
||||||
|
|||||||
@@ -115,9 +115,9 @@ class RouteProvider implements ServiceProviderInterface
|
|||||||
$container['route']->addRoute('analytics/estimated-spent-time/:project_id', 'AnalyticController', 'compareHours');
|
$container['route']->addRoute('analytics/estimated-spent-time/:project_id', 'AnalyticController', 'compareHours');
|
||||||
|
|
||||||
// Board routes
|
// Board routes
|
||||||
$container['route']->addRoute('board/:project_id', 'board', 'show');
|
$container['route']->addRoute('board/:project_id', 'BoardViewController', 'show');
|
||||||
$container['route']->addRoute('b/:project_id', 'board', 'show');
|
$container['route']->addRoute('b/:project_id', 'BoardViewController', 'show');
|
||||||
$container['route']->addRoute('public/board/:token', 'board', 'readonly');
|
$container['route']->addRoute('public/board/:token', 'BoardViewController', 'readonly');
|
||||||
|
|
||||||
// Calendar routes
|
// Calendar routes
|
||||||
$container['route']->addRoute('calendar/:project_id', 'CalendarController', 'show');
|
$container['route']->addRoute('calendar/:project_id', 'CalendarController', 'show');
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
class="board-project-<?= $project['id'] ?>"
|
class="board-project-<?= $project['id'] ?>"
|
||||||
data-project-id="<?= $project['id'] ?>"
|
data-project-id="<?= $project['id'] ?>"
|
||||||
data-check-interval="<?= $board_private_refresh_interval ?>"
|
data-check-interval="<?= $board_private_refresh_interval ?>"
|
||||||
data-save-url="<?= $this->url->href('board', 'save', array('project_id' => $project['id'])) ?>"
|
data-save-url="<?= $this->url->href('BoardAjaxController', 'save', array('project_id' => $project['id'])) ?>"
|
||||||
data-reload-url="<?= $this->url->href('board', 'reload', array('project_id' => $project['id'])) ?>"
|
data-reload-url="<?= $this->url->href('BoardAjaxController', 'reload', array('project_id' => $project['id'])) ?>"
|
||||||
data-check-url="<?= $this->url->href('board', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>"
|
data-check-url="<?= $this->url->href('BoardAjaxController', 'check', array('project_id' => $project['id'], 'timestamp' => time())) ?>"
|
||||||
data-task-creation-url="<?= $this->url->href('TaskCreationController', 'show', array('project_id' => $project['id'])) ?>"
|
data-task-creation-url="<?= $this->url->href('TaskCreationController', 'show', array('project_id' => $project['id'])) ?>"
|
||||||
>
|
>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div class="
|
<div class="
|
||||||
task-board
|
task-board
|
||||||
<?= $task['is_active'] == 1 ? ($this->user->hasProjectAccess('board', 'save', $task['project_id']) ? 'draggable-item ' : '').'task-board-status-open '.($task['date_modification'] > (time() - $board_highlight_period) ? 'task-board-recent' : '') : 'task-board-status-closed' ?>
|
<?= $task['is_active'] == 1 ? ($this->user->hasProjectAccess('BoardViewController', 'save', $task['project_id']) ? 'draggable-item ' : '').'task-board-status-open '.($task['date_modification'] > (time() - $board_highlight_period) ? 'task-board-recent' : '') : 'task-board-status-closed' ?>
|
||||||
color-<?= $task['color_id'] ?>"
|
color-<?= $task['color_id'] ?>"
|
||||||
data-task-id="<?= $task['id'] ?>"
|
data-task-id="<?= $task['id'] ?>"
|
||||||
data-column-id="<?= $task['column_id'] ?>"
|
data-column-id="<?= $task['column_id'] ?>"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<section id="main">
|
<section id="main">
|
||||||
|
|
||||||
<?= $this->projectHeader->render($project, 'Board', 'show', true) ?>
|
<?= $this->projectHeader->render($project, 'BoardViewController', 'show', true) ?>
|
||||||
|
|
||||||
<?= $this->render('board/table_container', array(
|
<?= $this->render('board/table_container', array(
|
||||||
'project' => $project,
|
'project' => $project,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" class="btn btn-red"><?= t('Save') ?></button>
|
<button type="submit" class="btn btn-red"><?= t('Save') ?></button>
|
||||||
<?= t('or') ?>
|
<?= t('or') ?>
|
||||||
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
<?= $this->url->link(t('cancel'), 'BoardViewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<?= $this->url->link('<i class="fa fa-list"></i>', 'TaskListController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('List')) ?>
|
<?= $this->url->link('<i class="fa fa-list"></i>', 'TaskListController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('List')) ?>
|
||||||
<?= $this->url->link('<i class="fa fa-calendar"></i>', 'CalendarController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>
|
<?= $this->url->link('<i class="fa fa-calendar"></i>', 'CalendarController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Calendar')) ?>
|
||||||
|
|
||||||
<?= $this->url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
|
<?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||||
<?php if (! empty($project['description'])): ?>
|
<?php if (! empty($project['description'])): ?>
|
||||||
<span class="tooltip" title="<?= $this->text->markdownAttribute($project['description']) ?>">
|
<span class="tooltip" title="<?= $this->text->markdownAttribute($project['description']) ?>">
|
||||||
<i class="fa fa-info-circle"></i>
|
<i class="fa fa-info-circle"></i>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<?= $this->render('task/dropdown', array('task' => array('id' => $subtask['task_id'], 'project_id' => $subtask['project_id']))) ?>
|
<?= $this->render('task/dropdown', array('task' => array('id' => $subtask['task_id'], 'project_id' => $subtask['project_id']))) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->url->link($this->text->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?>
|
<?= $this->url->link($this->text->e($subtask['project_name']), 'BoardViewController', 'show', array('project_id' => $subtask['project_id'])) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->url->link($this->text->e($subtask['task_name']), 'TaskViewController', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?>
|
<?= $this->url->link($this->text->e($subtask['task_name']), 'TaskViewController', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<?= $this->render('task/dropdown', array('task' => $task)) ?>
|
<?= $this->render('task/dropdown', array('task' => $task)) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?>
|
<?= $this->url->link($this->text->e($task['project_name']), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
<?= $this->url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
|
||||||
|
|||||||
@@ -30,6 +30,6 @@
|
|||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" class="btn btn-blue" tabindex="15"><?= t('Save') ?></button>
|
<button type="submit" class="btn btn-blue" tabindex="15"><?= t('Save') ?></button>
|
||||||
<?= t('or') ?>
|
<?= t('or') ?>
|
||||||
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
|
<?= $this->url->link(t('cancel'), 'BoardViewController', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
data-notfound="<?= t('No results match:') ?>"
|
data-notfound="<?= t('No results match:') ?>"
|
||||||
data-placeholder="<?= t('Display another project') ?>"
|
data-placeholder="<?= t('Display another project') ?>"
|
||||||
data-redirect-regex="PROJECT_ID"
|
data-redirect-regex="PROJECT_ID"
|
||||||
data-redirect-url="<?= $this->url->href('board', 'show', array('project_id' => 'PROJECT_ID')) ?>">
|
data-redirect-url="<?= $this->url->href('BoardViewController', 'show', array('project_id' => 'PROJECT_ID')) ?>">
|
||||||
<option value=""></option>
|
<option value=""></option>
|
||||||
<?php foreach ($board_selector as $board_id => $board_name): ?>
|
<?php foreach ($board_selector as $board_id => $board_name): ?>
|
||||||
<option value="<?= $board_id ?>"><?= $this->text->e($board_name) ?></option>
|
<option value="<?= $board_id ?>"><?= $this->text->e($board_name) ?></option>
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ Kanboard
|
|||||||
|
|
||||||
<?php if (isset($application_url) && ! empty($application_url)): ?>
|
<?php if (isset($application_url) && ! empty($application_url)): ?>
|
||||||
- <a href="<?= $this->url->href('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', true) ?>"><?= t('view the task on Kanboard') ?></a>
|
- <a href="<?= $this->url->href('TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', true) ?>"><?= t('view the task on Kanboard') ?></a>
|
||||||
- <a href="<?= $this->url->href('board', 'show', array('project_id' => $task['project_id']), false, '', true) ?>"><?= t('view the board on Kanboard') ?></a>
|
- <a href="<?= $this->url->href('BoardViewController', 'show', array('project_id' => $task['project_id']), false, '', true) ?>"><?= t('view the board on Kanboard') ?></a>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<i class="fa fa-th fa-fw"></i>
|
<i class="fa fa-th fa-fw"></i>
|
||||||
<?= $this->url->link(t('Board'), 'board', 'show', array('project_id' => $project['id'])) ?>
|
<?= $this->url->link(t('Board'), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<i class="fa fa-calendar fa-fw"></i>
|
<i class="fa fa-calendar fa-fw"></i>
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
<li>
|
<li>
|
||||||
<span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>>
|
<span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? '' : 'style="display: none;"' ?>>
|
||||||
<i class="fa fa-expand fa-fw"></i>
|
<i class="fa fa-expand fa-fw"></i>
|
||||||
<?= $this->url->link(t('Expand tasks'), 'board', 'expand', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?>
|
<?= $this->url->link(t('Expand tasks'), 'BoardAjaxController', 'expand', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?>
|
||||||
</span>
|
</span>
|
||||||
<span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? 'style="display: none;"' : '' ?>>
|
<span class="filter-display-mode" <?= $this->board->isCollapsed($project['id']) ? 'style="display: none;"' : '' ?>>
|
||||||
<i class="fa fa-compress fa-fw"></i>
|
<i class="fa fa-compress fa-fw"></i>
|
||||||
<?= $this->url->link(t('Collapse tasks'), 'board', 'collapse', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?>
|
<?= $this->url->link(t('Collapse tasks'), 'BoardAjaxController', 'collapse', array('project_id' => $project['id']), false, 'board-display-mode', t('Keyboard shortcut: "%s"', 's')) ?>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<?php if ($project['is_public']): ?>
|
<?php if ($project['is_public']): ?>
|
||||||
<li>
|
<li>
|
||||||
<i class="fa fa-share-alt fa-fw"></i>
|
<i class="fa fa-share-alt fa-fw"></i>
|
||||||
<?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
|
<?= $this->url->link(t('Public link'), 'BoardViewController', 'readonly', array('token' => $project['token']), false, '', '', true) ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
<i class="fa fa-eye fa-fw"></i>
|
<i class="fa fa-eye fa-fw"></i>
|
||||||
<?= $this->url->link(t('Overview'), 'ProjectOverviewController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?>
|
<?= $this->url->link(t('Overview'), 'ProjectOverviewController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-overview', t('Keyboard shortcut: "%s"', 'v o')) ?>
|
||||||
</li>
|
</li>
|
||||||
<li <?= $this->app->checkMenuSelection('Board') ?>>
|
<li <?= $this->app->checkMenuSelection('BoardViewController') ?>>
|
||||||
<i class="fa fa-th fa-fw"></i>
|
<i class="fa fa-th fa-fw"></i>
|
||||||
<?= $this->url->link(t('Board'), 'board', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?>
|
<?= $this->url->link(t('Board'), 'BoardViewController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-board', t('Keyboard shortcut: "%s"', 'v b')) ?>
|
||||||
</li>
|
</li>
|
||||||
<li <?= $this->app->checkMenuSelection('Calendar') ?>>
|
<li <?= $this->app->checkMenuSelection('Calendar') ?>>
|
||||||
<i class="fa fa-calendar fa-fw"></i>
|
<i class="fa fa-calendar fa-fw"></i>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->url->link($this->text->e($project['name']), 'board', 'show', array('project_id' => $project['id'])) ?>
|
<?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||||
|
|
||||||
<?php if ($project['is_public']): ?>
|
<?php if ($project['is_public']): ?>
|
||||||
<i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>"></i>
|
<i class="fa fa-share-alt fa-fw" title="<?= t('Shared project') ?>"></i>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if ($project['is_public']): ?>
|
<?php if ($project['is_public']): ?>
|
||||||
<li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li>
|
<li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'BoardViewController', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||||
<li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
|
<li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||||
<li><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token'])) ?></li>
|
<li><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token'])) ?></li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<?= $this->text->e($this->user->getFullname($project)) ?>
|
<?= $this->text->e($this->user->getFullname($project)) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->url->link('<i class="fa fa-th"></i>', 'board', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?>
|
<?= $this->url->link('<i class="fa fa-th"></i>', 'BoardViewController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Board')) ?>
|
||||||
<?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'gantt', 'project', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?>
|
<?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'gantt', 'project', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?>
|
||||||
<?= $this->url->link('<i class="fa fa-cog fa-fw"></i>', 'ProjectViewController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Project settings')) ?>
|
<?= $this->url->link('<i class="fa fa-cog fa-fw"></i>', 'ProjectViewController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Project settings')) ?>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<?= $this->url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
|
<?= $this->url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?>
|
<?= $this->url->link($this->text->e($task['project_name']), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->text->e($task['column_name']) ?>
|
<?= $this->text->e($task['column_name']) ?>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<div class="listing">
|
<div class="listing">
|
||||||
<ul class="no-bullet">
|
<ul class="no-bullet">
|
||||||
<li><strong><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></strong></li>
|
<li><strong><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'BoardViewController', 'readonly', array('token' => $project['token']), false, '', '', true) ?></strong></li>
|
||||||
<li><strong><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?></strong></li>
|
<li><strong><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?></strong></li>
|
||||||
<li><strong><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token']), false, '', '', true) ?></strong></li>
|
<li><strong><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token']), false, '', '', true) ?></strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if ($project['is_public']): ?>
|
<?php if ($project['is_public']): ?>
|
||||||
<li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'board', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li>
|
<li><i class="fa fa-share-alt"></i> <?= $this->url->link(t('Public link'), 'BoardViewController', 'readonly', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||||
<li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
|
<li><i class="fa fa-rss-square"></i> <?= $this->url->link(t('RSS feed'), 'FeedController', 'project', array('token' => $project['token']), false, '', '', true) ?></li>
|
||||||
<li><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token'])) ?></li>
|
<li><i class="fa fa-calendar"></i> <?= $this->url->link(t('iCal feed'), 'ICalendarController', 'project', array('token' => $project['token'])) ?></li>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
<?php if ($stats['nb_tasks'] > 0): ?>
|
<?php if ($stats['nb_tasks'] > 0): ?>
|
||||||
|
|
||||||
<?php if ($stats['nb_active_tasks'] > 0): ?>
|
<?php if ($stats['nb_active_tasks'] > 0): ?>
|
||||||
<li><?= $this->url->link(t('%d tasks on the board', $stats['nb_active_tasks']), 'board', 'show', array('project_id' => $project['id'], 'search' => 'status:open')) ?></li>
|
<li><?= $this->url->link(t('%d tasks on the board', $stats['nb_active_tasks']), 'BoardViewController', 'show', array('project_id' => $project['id'], 'search' => 'status:open')) ?></li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if ($stats['nb_inactive_tasks'] > 0): ?>
|
<?php if ($stats['nb_inactive_tasks'] > 0): ?>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<?php foreach ($paginator->getCollection() as $task): ?>
|
<?php foreach ($paginator->getCollection() as $task): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<?= $this->url->link($this->text->e($task['project_name']), 'board', 'show', array('project_id' => $task['project_id'])) ?>
|
<?= $this->url->link($this->text->e($task['project_name']), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="task-table color-<?= $task['color_id'] ?>">
|
<td class="task-table color-<?= $task['color_id'] ?>">
|
||||||
<?= $this->url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
|
<?= $this->url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<?php if ($project['is_public'] && !$editable): ?>
|
<?php if ($project['is_public'] && !$editable): ?>
|
||||||
<li class="smaller">
|
<li class="smaller">
|
||||||
<i class="fa fa-th fa-fw"></i>
|
<i class="fa fa-th fa-fw"></i>
|
||||||
<?= $this->url->link(t('Back to the board'), 'board', 'readonly', array('token' => $project['token'])) ?>
|
<?= $this->url->link(t('Back to the board'), 'BoardViewController', 'readonly', array('token' => $project['token'])) ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<li class="smaller">
|
<li class="smaller">
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'BoardViewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,6 @@
|
|||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" class="btn btn-blue" tabindex="15"><?= t('Save') ?></button>
|
<button type="submit" class="btn btn-blue" tabindex="15"><?= t('Save') ?></button>
|
||||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
|
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'BoardViewController', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||||
<?= t('or') ?>
|
<?= t('or') ?>
|
||||||
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
<?= $this->url->link(t('cancel'), 'BoardViewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||||
<?= t('or') ?>
|
<?= t('or') ?>
|
||||||
<?= $this->url->link(t('cancel'), 'board', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
<?= $this->url->link(t('cancel'), 'BoardViewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class UserHelperTest extends Base
|
|||||||
$this->assertEquals(1, $project->create(array('name' => 'My project')));
|
$this->assertEquals(1, $project->create(array('name' => 'My project')));
|
||||||
|
|
||||||
$this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
$this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('board', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('BoardViewController', 'show', 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testHasProjectAccessForManagers()
|
public function testHasProjectAccessForManagers()
|
||||||
@@ -102,7 +102,7 @@ class UserHelperTest extends Base
|
|||||||
$this->assertEquals(1, $project->create(array('name' => 'My project')));
|
$this->assertEquals(1, $project->create(array('name' => 'My project')));
|
||||||
|
|
||||||
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
||||||
$this->assertFalse($helper->hasProjectAccess('board', 'show', 1));
|
$this->assertFalse($helper->hasProjectAccess('BoardViewController', 'show', 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testHasProjectAccessForUsers()
|
public function testHasProjectAccessForUsers()
|
||||||
@@ -118,7 +118,7 @@ class UserHelperTest extends Base
|
|||||||
$this->assertEquals(1, $project->create(array('name' => 'My project')));
|
$this->assertEquals(1, $project->create(array('name' => 'My project')));
|
||||||
|
|
||||||
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
||||||
$this->assertFalse($helper->hasProjectAccess('board', 'show', 1));
|
$this->assertFalse($helper->hasProjectAccess('BoardViewController', 'show', 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testHasProjectAccessForAppManagerAndProjectManagers()
|
public function testHasProjectAccessForAppManagerAndProjectManagers()
|
||||||
@@ -139,12 +139,12 @@ class UserHelperTest extends Base
|
|||||||
$this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MANAGER));
|
$this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MANAGER));
|
||||||
|
|
||||||
$this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
$this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('board', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('BoardViewController', 'show', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('TaskViewController', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('TaskViewController', 'show', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('taskcreationcontroller', 'save', 1));
|
$this->assertTrue($helper->hasProjectAccess('taskcreationcontroller', 'save', 1));
|
||||||
|
|
||||||
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2));
|
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('board', 'show', 2));
|
$this->assertFalse($helper->hasProjectAccess('BoardViewController', 'show', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskViewController', 'show', 2));
|
$this->assertFalse($helper->hasProjectAccess('TaskViewController', 'show', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2));
|
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2));
|
||||||
}
|
}
|
||||||
@@ -167,12 +167,12 @@ class UserHelperTest extends Base
|
|||||||
$this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MANAGER));
|
$this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MANAGER));
|
||||||
|
|
||||||
$this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
$this->assertTrue($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('board', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('BoardViewController', 'show', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('TaskViewController', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('TaskViewController', 'show', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('TaskCreationController', 'save', 1));
|
$this->assertTrue($helper->hasProjectAccess('TaskCreationController', 'save', 1));
|
||||||
|
|
||||||
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2));
|
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('board', 'show', 2));
|
$this->assertFalse($helper->hasProjectAccess('BoardViewController', 'show', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskViewController', 'show', 2));
|
$this->assertFalse($helper->hasProjectAccess('TaskViewController', 'show', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2));
|
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2));
|
||||||
}
|
}
|
||||||
@@ -195,12 +195,12 @@ class UserHelperTest extends Base
|
|||||||
$this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MEMBER));
|
$this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_MEMBER));
|
||||||
|
|
||||||
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('board', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('BoardViewController', 'show', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('TaskViewController', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('TaskViewController', 'show', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('TaskCreationController', 'save', 1));
|
$this->assertTrue($helper->hasProjectAccess('TaskCreationController', 'save', 1));
|
||||||
|
|
||||||
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2));
|
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('board', 'show', 2));
|
$this->assertFalse($helper->hasProjectAccess('BoardViewController', 'show', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskViewController', 'show', 2));
|
$this->assertFalse($helper->hasProjectAccess('TaskViewController', 'show', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2));
|
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2));
|
||||||
}
|
}
|
||||||
@@ -223,12 +223,12 @@ class UserHelperTest extends Base
|
|||||||
$this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_VIEWER));
|
$this->assertTrue($projectUserRole->addUser(1, 2, Role::PROJECT_VIEWER));
|
||||||
|
|
||||||
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('board', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('BoardViewController', 'show', 1));
|
||||||
$this->assertTrue($helper->hasProjectAccess('TaskViewController', 'show', 1));
|
$this->assertTrue($helper->hasProjectAccess('TaskViewController', 'show', 1));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 1));
|
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 1));
|
||||||
|
|
||||||
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2));
|
$this->assertFalse($helper->hasProjectAccess('ProjectEditController', 'edit', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('board', 'show', 2));
|
$this->assertFalse($helper->hasProjectAccess('BoardViewController', 'show', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskViewController', 'show', 2));
|
$this->assertFalse($helper->hasProjectAccess('TaskViewController', 'show', 2));
|
||||||
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2));
|
$this->assertFalse($helper->hasProjectAccess('TaskCreationController', 'save', 2));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user