Split Gantt controller
This commit is contained in:
parent
8d12e2fe73
commit
9e218032c4
|
|
@ -1,165 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
use Kanboard\Filter\ProjectIdsFilter;
|
||||
use Kanboard\Filter\ProjectStatusFilter;
|
||||
use Kanboard\Filter\ProjectTypeFilter;
|
||||
use Kanboard\Filter\TaskProjectFilter;
|
||||
use Kanboard\Formatter\ProjectGanttFormatter;
|
||||
use Kanboard\Formatter\TaskGanttFormatter;
|
||||
use Kanboard\Model\Task as TaskModel;
|
||||
use Kanboard\Model\Project as ProjectModel;
|
||||
|
||||
/**
|
||||
* Gantt controller
|
||||
*
|
||||
* @package controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Gantt extends BaseController
|
||||
{
|
||||
/**
|
||||
* Show Gantt chart for all projects
|
||||
*/
|
||||
public function projects()
|
||||
{
|
||||
$project_ids = $this->projectPermission->getActiveProjectIds($this->userSession->getId());
|
||||
$filter = $this->projectQuery
|
||||
->withFilter(new ProjectTypeFilter(ProjectModel::TYPE_TEAM))
|
||||
->withFilter(new ProjectStatusFilter(ProjectModel::ACTIVE))
|
||||
->withFilter(new ProjectIdsFilter($project_ids));
|
||||
|
||||
$filter->getQuery()->asc(ProjectModel::TABLE.'.start_date');
|
||||
|
||||
$this->response->html($this->helper->layout->app('gantt/projects', array(
|
||||
'projects' => $filter->format(new ProjectGanttFormatter($this->container)),
|
||||
'title' => t('Gantt chart for all projects'),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save new project start date and end date
|
||||
*/
|
||||
public function saveProjectDate()
|
||||
{
|
||||
$values = $this->request->getJson();
|
||||
|
||||
$result = $this->project->update(array(
|
||||
'id' => $values['id'],
|
||||
'start_date' => $this->dateParser->getIsoDate(strtotime($values['start'])),
|
||||
'end_date' => $this->dateParser->getIsoDate(strtotime($values['end'])),
|
||||
));
|
||||
|
||||
if (! $result) {
|
||||
$this->response->json(array('message' => 'Unable to save project'), 400);
|
||||
} else {
|
||||
$this->response->json(array('message' => 'OK'), 201);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show Gantt chart for one project
|
||||
*/
|
||||
public function project()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$search = $this->helper->projectHeader->getSearchQuery($project);
|
||||
$sorting = $this->request->getStringParam('sorting', 'board');
|
||||
$filter = $this->taskLexer->build($search)->withFilter(new TaskProjectFilter($project['id']));
|
||||
|
||||
if ($sorting === 'date') {
|
||||
$filter->getQuery()->asc(TaskModel::TABLE.'.date_started')->asc(TaskModel::TABLE.'.date_creation');
|
||||
} else {
|
||||
$filter->getQuery()->asc('column_position')->asc(TaskModel::TABLE.'.position');
|
||||
}
|
||||
|
||||
$this->response->html($this->helper->layout->app('gantt/project', array(
|
||||
'project' => $project,
|
||||
'title' => $project['name'],
|
||||
'description' => $this->helper->projectHeader->getDescription($project),
|
||||
'sorting' => $sorting,
|
||||
'tasks' => $filter->format(new TaskGanttFormatter($this->container)),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save new task start date and due date
|
||||
*/
|
||||
public function saveTaskDate()
|
||||
{
|
||||
$this->getProject();
|
||||
$values = $this->request->getJson();
|
||||
|
||||
$result = $this->taskModification->update(array(
|
||||
'id' => $values['id'],
|
||||
'date_started' => strtotime($values['start']),
|
||||
'date_due' => strtotime($values['end']),
|
||||
));
|
||||
|
||||
if (! $result) {
|
||||
$this->response->json(array('message' => 'Unable to save task'), 400);
|
||||
} else {
|
||||
$this->response->json(array('message' => 'OK'), 201);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Simplified form to create a new task
|
||||
*
|
||||
* @access public
|
||||
* @param array $values
|
||||
* @param array $errors
|
||||
* @throws \Kanboard\Core\Controller\PageNotFoundException
|
||||
*/
|
||||
public function task(array $values = array(), array $errors = array())
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$values = $values + array(
|
||||
'project_id' => $project['id'],
|
||||
'column_id' => $this->column->getFirstColumnId($project['id']),
|
||||
'position' => 1
|
||||
);
|
||||
|
||||
$values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values));
|
||||
$values = $this->hook->merge('controller:gantt:task:form:default', $values, array('default_values' => $values));
|
||||
|
||||
$this->response->html($this->template->render('gantt/task_creation', array(
|
||||
'project' => $project,
|
||||
'errors' => $errors,
|
||||
'values' => $values,
|
||||
'users_list' => $this->projectUserRole->getAssignableUsersList($project['id'], true, false, true),
|
||||
'colors_list' => $this->color->getList(),
|
||||
'categories_list' => $this->category->getList($project['id']),
|
||||
'swimlanes_list' => $this->swimlane->getList($project['id'], false, true),
|
||||
'title' => $project['name'].' > '.t('New task')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate and save a new task
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function saveTask()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$values = $this->request->getValues();
|
||||
|
||||
list($valid, $errors) = $this->taskValidator->validateCreation($values);
|
||||
|
||||
if ($valid) {
|
||||
$task_id = $this->taskCreation->create($values);
|
||||
|
||||
if ($task_id !== false) {
|
||||
$this->flash->success(t('Task created successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('gantt', 'project', array('project_id' => $project['id'])));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to create your task.'));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->task($values, $errors);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
use Kanboard\Filter\ProjectIdsFilter;
|
||||
use Kanboard\Filter\ProjectStatusFilter;
|
||||
use Kanboard\Filter\ProjectTypeFilter;
|
||||
use Kanboard\Formatter\ProjectGanttFormatter;
|
||||
use Kanboard\Model\Project;
|
||||
|
||||
/**
|
||||
* Projects Gantt Controller
|
||||
*
|
||||
* @package Kanboard\Controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class ProjectGanttController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Show Gantt chart for all projects
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
$project_ids = $this->projectPermission->getActiveProjectIds($this->userSession->getId());
|
||||
$filter = $this->projectQuery
|
||||
->withFilter(new ProjectTypeFilter(Project::TYPE_TEAM))
|
||||
->withFilter(new ProjectStatusFilter(Project::ACTIVE))
|
||||
->withFilter(new ProjectIdsFilter($project_ids));
|
||||
|
||||
$filter->getQuery()->asc(Project::TABLE.'.start_date');
|
||||
|
||||
$this->response->html($this->helper->layout->app('project_gantt/show', array(
|
||||
'projects' => $filter->format(new ProjectGanttFormatter($this->container)),
|
||||
'title' => t('Gantt chart for all projects'),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save new project start date and end date
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$values = $this->request->getJson();
|
||||
|
||||
$result = $this->project->update(array(
|
||||
'id' => $values['id'],
|
||||
'start_date' => $this->dateParser->getIsoDate(strtotime($values['start'])),
|
||||
'end_date' => $this->dateParser->getIsoDate(strtotime($values['end'])),
|
||||
));
|
||||
|
||||
if (! $result) {
|
||||
$this->response->json(array('message' => 'Unable to save project'), 400);
|
||||
} else {
|
||||
$this->response->json(array('message' => 'OK'), 201);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
use Kanboard\Filter\TaskProjectFilter;
|
||||
use Kanboard\Formatter\TaskGanttFormatter;
|
||||
use Kanboard\Model\Task as TaskModel;
|
||||
|
||||
/**
|
||||
* Tasks Gantt Controller
|
||||
*
|
||||
* @package Kanboard\Controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class TaskGanttController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Show Gantt chart for one project
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$search = $this->helper->projectHeader->getSearchQuery($project);
|
||||
$sorting = $this->request->getStringParam('sorting', 'board');
|
||||
$filter = $this->taskLexer->build($search)->withFilter(new TaskProjectFilter($project['id']));
|
||||
|
||||
if ($sorting === 'date') {
|
||||
$filter->getQuery()->asc(TaskModel::TABLE.'.date_started')->asc(TaskModel::TABLE.'.date_creation');
|
||||
} else {
|
||||
$filter->getQuery()->asc('column_position')->asc(TaskModel::TABLE.'.position');
|
||||
}
|
||||
|
||||
$this->response->html($this->helper->layout->app('task_gantt/show', array(
|
||||
'project' => $project,
|
||||
'title' => $project['name'],
|
||||
'description' => $this->helper->projectHeader->getDescription($project),
|
||||
'sorting' => $sorting,
|
||||
'tasks' => $filter->format(new TaskGanttFormatter($this->container)),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Save new task start date and due date
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$this->getProject();
|
||||
$values = $this->request->getJson();
|
||||
|
||||
$result = $this->taskModification->update(array(
|
||||
'id' => $values['id'],
|
||||
'date_started' => strtotime($values['start']),
|
||||
'date_due' => strtotime($values['end']),
|
||||
));
|
||||
|
||||
if (! $result) {
|
||||
$this->response->json(array('message' => 'Unable to save task'), 400);
|
||||
} else {
|
||||
$this->response->json(array('message' => 'OK'), 201);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
/**
|
||||
* Class TaskGanttCreationController
|
||||
*
|
||||
* @package Kanboard\Controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class TaskGanttCreationController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Simplified form to create a new task
|
||||
*
|
||||
* @access public
|
||||
* @param array $values
|
||||
* @param array $errors
|
||||
* @throws \Kanboard\Core\Controller\PageNotFoundException
|
||||
*/
|
||||
public function show(array $values = array(), array $errors = array())
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$values = $values + array(
|
||||
'project_id' => $project['id'],
|
||||
'column_id' => $this->column->getFirstColumnId($project['id']),
|
||||
'position' => 1
|
||||
);
|
||||
|
||||
$values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values));
|
||||
$values = $this->hook->merge('controller:gantt:task:form:default', $values, array('default_values' => $values));
|
||||
|
||||
$this->response->html($this->template->render('task_gantt_creation/show', array(
|
||||
'project' => $project,
|
||||
'errors' => $errors,
|
||||
'values' => $values,
|
||||
'users_list' => $this->projectUserRole->getAssignableUsersList($project['id'], true, false, true),
|
||||
'colors_list' => $this->color->getList(),
|
||||
'categories_list' => $this->category->getList($project['id']),
|
||||
'swimlanes_list' => $this->swimlane->getList($project['id'], false, true),
|
||||
'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) {
|
||||
$task_id = $this->taskCreation->create($values);
|
||||
|
||||
if ($task_id !== false) {
|
||||
$this->flash->success(t('Task created successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('TaskGanttController', 'show', array('project_id' => $project['id'])));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to create your task.'));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->show($values, $errors);
|
||||
}
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ class ProjectGanttFormatter extends BaseFormatter implements FormatterInterface
|
|||
),
|
||||
'link' => $this->helper->url->href('ProjectViewController', '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('TaskGanttController', 'show', array('project_id' => $project['id'])),
|
||||
'color' => $color,
|
||||
'not_defined' => empty($project['start_date']) || empty($project['end_date']),
|
||||
'users' => $this->projectUserRole->getAllUsersGroupedByRole($project['id']),
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ class AuthenticationProvider implements ServiceProviderInterface
|
|||
$acl->add('CustomFilterController', '*', Role::PROJECT_MEMBER);
|
||||
$acl->add('ExportController', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('TaskFileController', array('screenshot', 'create', 'save', 'remove', 'confirm'), Role::PROJECT_MEMBER);
|
||||
$acl->add('Gantt', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('TaskGanttController', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('TaskGanttCreationController', '*', 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('ProjectEditController', '*', Role::PROJECT_MANAGER);
|
||||
|
|
@ -132,7 +133,7 @@ class AuthenticationProvider implements ServiceProviderInterface
|
|||
$acl->add('ConfigController', '*', Role::APP_ADMIN);
|
||||
$acl->add('PluginController', '*', Role::APP_ADMIN);
|
||||
$acl->add('CurrencyController', '*', Role::APP_ADMIN);
|
||||
$acl->add('Gantt', array('projects', 'saveProjectDate'), Role::APP_MANAGER);
|
||||
$acl->add('ProjectGanttController', '*', Role::APP_MANAGER);
|
||||
$acl->add('GroupListController', '*', Role::APP_ADMIN);
|
||||
$acl->add('GroupCreationController', '*', Role::APP_ADMIN);
|
||||
$acl->add('GroupModificationController', '*', Role::APP_ADMIN);
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ class RouteProvider implements ServiceProviderInterface
|
|||
$container['route']->addRoute('l/:project_id', 'TaskListController', 'show');
|
||||
|
||||
// Gantt routes
|
||||
$container['route']->addRoute('gantt/:project_id', 'gantt', 'project');
|
||||
$container['route']->addRoute('gantt/:project_id/sort/:sorting', 'gantt', 'project');
|
||||
$container['route']->addRoute('gantt/:project_id', 'TaskGanttController', 'show');
|
||||
$container['route']->addRoute('gantt/:project_id/sort/:sorting', 'TaskGanttController', 'show');
|
||||
|
||||
// Feed routes
|
||||
$container['route']->addRoute('feed/project/:token', 'FeedController', 'project');
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
<?php endif ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ($this->user->hasProjectAccess('gantt', 'project', $project['id'])): ?>
|
||||
<?= $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')) ?>
|
||||
<?php if ($this->user->hasProjectAccess('TaskGanttController', 'show', $project['id'])): ?>
|
||||
<?= $this->url->link('<i class="fa fa-sliders fa-fw"></i>', 'TaskGanttController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('Gantt chart')) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?= $this->url->link('<i class="fa fa-list"></i>', 'TaskListController', 'show', array('project_id' => $project['id']), false, 'dashboard-table-link', t('List')) ?>
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@
|
|||
<i class="fa fa-list fa-fw"></i>
|
||||
<?= $this->url->link(t('Listing'), 'TaskListController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('Gantt', 'project', $project['id'])): ?>
|
||||
<?php if ($this->user->hasProjectAccess('TaskGanttController', 'show', $project['id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-sliders fa-fw"></i>
|
||||
<?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->url->link(t('Gantt'), 'TaskGanttController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<div
|
||||
id="gantt-chart"
|
||||
data-records='<?= json_encode($projects, JSON_HEX_APOS) ?>'
|
||||
data-save-url="<?= $this->url->href('gantt', 'saveProjectDate') ?>"
|
||||
data-save-url="<?= $this->url->href('ProjectGanttController', 'save') ?>"
|
||||
data-label-project-manager="<?= t('Project managers') ?>"
|
||||
data-label-project-member="<?= t('Project members') ?>"
|
||||
data-label-gantt-link="<?= t('Gantt chart for this project') ?>"
|
||||
|
|
@ -15,10 +15,10 @@
|
|||
<i class="fa fa-list fa-fw"></i>
|
||||
<?= $this->url->link(t('List'), 'TaskListController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-listing', t('Keyboard shortcut: "%s"', 'v l')) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('gantt', 'project', $project['id'])): ?>
|
||||
<li <?= $this->app->checkMenuSelection('Gantt') ?>>
|
||||
<?php if ($this->user->hasProjectAccess('TaskGanttController', 'show', $project['id'])): ?>
|
||||
<li <?= $this->app->checkMenuSelection('TaskGanttController') ?>>
|
||||
<i class="fa fa-sliders fa-fw"></i>
|
||||
<?= $this->url->link(t('Gantt'), 'gantt', 'project', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?>
|
||||
<?= $this->url->link(t('Gantt'), 'TaskGanttController', 'show', array('project_id' => $project['id'], 'search' => $filters['search']), false, 'view-gantt', t('Keyboard shortcut: "%s"', 'v g')) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
<?php if ($this->user->hasAccess('ProjectUserOverviewController', 'managers')): ?>
|
||||
<li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('Users overview'), 'ProjectUserOverviewController', 'managers') ?></li>
|
||||
<?php endif ?>
|
||||
<?php if ($this->user->hasAccess('gantt', 'projects')): ?>
|
||||
<li><i class="fa fa-sliders fa-fw"></i><?= $this->url->link(t('Projects Gantt chart'), 'gantt', 'projects') ?></li>
|
||||
<?php if ($this->user->hasAccess('ProjectGanttController', 'show')): ?>
|
||||
<li><i class="fa fa-sliders fa-fw"></i><?= $this->url->link(t('Projects Gantt chart'), 'ProjectGanttController', 'show') ?></li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
<i class="fa fa-folder fa-fw"></i>
|
||||
<?= $this->url->link(t('Projects list'), 'ProjectListController', 'show') ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasAccess('gantt', 'projects')): ?>
|
||||
<?php if ($this->user->hasAccess('ProjectGanttController', 'show')): ?>
|
||||
<li>
|
||||
<i class="fa fa-sliders fa-fw"></i>
|
||||
<?= $this->url->link(t('Projects Gantt chart'), 'gantt', 'projects') ?>
|
||||
<?= $this->url->link(t('Projects Gantt chart'), 'ProjectGanttController', 'show') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<?= $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>', 'TaskGanttController', 'show', 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->text->e($project['project_name']) ?>
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<section id="main">
|
||||
<?= $this->projectHeader->render($project, 'Gantt', 'project') ?>
|
||||
<?= $this->projectHeader->render($project, 'TaskGanttController', 'show') ?>
|
||||
<div class="menu-inline">
|
||||
<ul>
|
||||
<li <?= $sorting === 'board' ? 'class="active"' : '' ?>>
|
||||
<i class="fa fa-sort-numeric-asc fa-fw"></i>
|
||||
<?= $this->url->link(t('Sort by position'), 'gantt', 'project', array('project_id' => $project['id'], 'sorting' => 'board')) ?>
|
||||
<?= $this->url->link(t('Sort by position'), 'TaskGanttController', 'show', array('project_id' => $project['id'], 'sorting' => 'board')) ?>
|
||||
</li>
|
||||
<li <?= $sorting === 'date' ? 'class="active"' : '' ?>>
|
||||
<i class="fa fa-sort-amount-asc fa-fw"></i>
|
||||
<?= $this->url->link(t('Sort by date'), 'gantt', 'project', array('project_id' => $project['id'], 'sorting' => 'date')) ?>
|
||||
<?= $this->url->link(t('Sort by date'), 'TaskGanttController', 'show', array('project_id' => $project['id'], 'sorting' => 'date')) ?>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-plus fa-fw"></i>
|
||||
<?= $this->url->link(t('Add task'), 'gantt', 'task', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
<?= $this->url->link(t('Add task'), 'TaskGanttCreationController', 'show', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<div
|
||||
id="gantt-chart"
|
||||
data-records='<?= json_encode($tasks, JSON_HEX_APOS) ?>'
|
||||
data-save-url="<?= $this->url->href('gantt', 'saveTaskDate', array('project_id' => $project['id'])) ?>"
|
||||
data-save-url="<?= $this->url->href('TaskGanttController', 'save', array('project_id' => $project['id'])) ?>"
|
||||
data-label-start-date="<?= t('Start date:') ?>"
|
||||
data-label-end-date="<?= t('Due date:') ?>"
|
||||
data-label-assignee="<?= t('Assignee:') ?>"
|
||||
|
|
@ -31,4 +31,4 @@
|
|||
<?php else: ?>
|
||||
<p class="alert"><?= t('There is no task in your project.') ?></p>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
</section>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('New task') ?></h2>
|
||||
</div>
|
||||
<form method="post" action="<?= $this->url->href('gantt', 'saveTask', array('project_id' => $values['project_id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->url->href('TaskGanttCreationController', 'save', array('project_id' => $values['project_id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('project_id', $values) ?>
|
||||
<?= $this->form->hidden('column_id', $values) ?>
|
||||
|
|
@ -30,6 +30,6 @@
|
|||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue" tabindex="15"><?= t('Save') ?></button>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'BoardViewController', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
|
||||
<?= $this->url->link(t('cancel'), 'TaskGanttController', 'show', array('project_id' => $values['project_id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
</form>
|
||||
Loading…
Reference in New Issue