Split project controller into multiple classes
This commit is contained in:
parent
872dc79dbd
commit
ff892c5d25
|
|
@ -1,240 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
/**
|
||||
* Project controller (Settings + creation/edition)
|
||||
*
|
||||
* @package controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class Project extends BaseController
|
||||
{
|
||||
/**
|
||||
* List of projects
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
if ($this->userSession->isAdmin()) {
|
||||
$project_ids = $this->project->getAllIds();
|
||||
} else {
|
||||
$project_ids = $this->projectPermission->getActiveProjectIds($this->userSession->getId());
|
||||
}
|
||||
|
||||
$nb_projects = count($project_ids);
|
||||
|
||||
$paginator = $this->paginator
|
||||
->setUrl('project', 'index')
|
||||
->setMax(20)
|
||||
->setOrder('name')
|
||||
->setQuery($this->project->getQueryColumnStats($project_ids))
|
||||
->calculate();
|
||||
|
||||
$this->response->html($this->helper->layout->app('project/index', array(
|
||||
'paginator' => $paginator,
|
||||
'nb_projects' => $nb_projects,
|
||||
'title' => t('Projects').' ('.$nb_projects.')'
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the project information page
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->project('project/show', array(
|
||||
'project' => $project,
|
||||
'stats' => $this->project->getTaskStats($project['id']),
|
||||
'title' => $project['name'],
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Public access management
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function share()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$switch = $this->request->getStringParam('switch');
|
||||
|
||||
if ($switch === 'enable' || $switch === 'disable') {
|
||||
$this->checkCSRFParam();
|
||||
|
||||
if ($this->project->{$switch.'PublicAccess'}($project['id'])) {
|
||||
$this->flash->success(t('Project updated successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to update this project.'));
|
||||
}
|
||||
|
||||
$this->response->redirect($this->helper->url->to('project', 'share', array('project_id' => $project['id'])));
|
||||
} else {
|
||||
$this->show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Integrations page
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function integrations()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$this->projectMetadata->save($project['id'], $this->request->getValues());
|
||||
$this->flash->success(t('Project updated successfully.'));
|
||||
$this->response->redirect($this->helper->url->to('project', 'integrations', array('project_id' => $project['id'])));
|
||||
} else {
|
||||
$this->response->html($this->helper->layout->project('project/integrations', array(
|
||||
'project' => $project,
|
||||
'title' => t('Integrations'),
|
||||
'webhook_token' => $this->config->get('webhook_token'),
|
||||
'values' => $this->projectMetadata->getAll($project['id']),
|
||||
'errors' => array(),
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display project notifications
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function notifications()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$values = $this->request->getValues();
|
||||
$this->projectNotification->saveSettings($project['id'], $values);
|
||||
$this->flash->success(t('Project updated successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('project', 'notifications', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
return $this->response->html($this->helper->layout->project('project/notifications', array(
|
||||
'notifications' => $this->projectNotification->readSettings($project['id']),
|
||||
'types' => $this->projectNotificationType->getTypes(),
|
||||
'project' => $project,
|
||||
'title' => t('Notifications'),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a project
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function remove()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->request->getStringParam('remove') === 'yes') {
|
||||
$this->checkCSRFParam();
|
||||
|
||||
if ($this->project->remove($project['id'])) {
|
||||
$this->flash->success(t('Project removed successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to remove this project.'));
|
||||
}
|
||||
|
||||
return $this->response->redirect($this->helper->url->to('project', 'index'));
|
||||
}
|
||||
|
||||
return $this->response->html($this->helper->layout->project('project/remove', array(
|
||||
'project' => $project,
|
||||
'title' => t('Remove project')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicate a project
|
||||
*
|
||||
* @author Antonio Rabelo
|
||||
* @author Michael Lüpkes
|
||||
* @access public
|
||||
*/
|
||||
public function duplicate()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->request->getStringParam('duplicate') === 'yes') {
|
||||
$project_id = $this->projectDuplication->duplicate($project['id'], array_keys($this->request->getValues()), $this->userSession->getId());
|
||||
|
||||
if ($project_id !== false) {
|
||||
$this->flash->success(t('Project cloned successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to clone this project.'));
|
||||
}
|
||||
|
||||
return $this->response->redirect($this->helper->url->to('project', 'show', array('project_id' => $project_id)));
|
||||
}
|
||||
|
||||
return $this->response->html($this->helper->layout->project('project/duplicate', array(
|
||||
'project' => $project,
|
||||
'title' => t('Clone this project')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable a project
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function disable()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->request->getStringParam('disable') === 'yes') {
|
||||
$this->checkCSRFParam();
|
||||
|
||||
if ($this->project->disable($project['id'])) {
|
||||
$this->flash->success(t('Project disabled successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to disable this project.'));
|
||||
}
|
||||
|
||||
return $this->response->redirect($this->helper->url->to('project', 'show', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
return $this->response->html($this->helper->layout->project('project/disable', array(
|
||||
'project' => $project,
|
||||
'title' => t('Project activation')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable a project
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function enable()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
if ($this->request->getStringParam('enable') === 'yes') {
|
||||
$this->checkCSRFParam();
|
||||
|
||||
if ($this->project->enable($project['id'])) {
|
||||
$this->flash->success(t('Project activated successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to activate this project.'));
|
||||
}
|
||||
|
||||
return $this->response->redirect($this->helper->url->to('project', 'show', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
return $this->response->html($this->helper->layout->project('project/enable', array(
|
||||
'project' => $project,
|
||||
'title' => t('Project activation')
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ class ProjectCreation extends BaseController
|
|||
|
||||
if ($project_id > 0) {
|
||||
$this->flash->success(t('Your project have been created successfully.'));
|
||||
return $this->response->redirect($this->helper->url->to('project', 'show', array('project_id' => $project_id)));
|
||||
return $this->response->redirect($this->helper->url->to('ProjectViewController', 'show', array('project_id' => $project_id)));
|
||||
}
|
||||
|
||||
$this->flash->failure(t('Unable to create your project.'));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
/**
|
||||
* Class ProjectListController
|
||||
*
|
||||
* @package Kanboard\Controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class ProjectListController extends BaseController
|
||||
{
|
||||
/**
|
||||
* List of projects
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
if ($this->userSession->isAdmin()) {
|
||||
$project_ids = $this->project->getAllIds();
|
||||
} else {
|
||||
$project_ids = $this->projectPermission->getActiveProjectIds($this->userSession->getId());
|
||||
}
|
||||
|
||||
$nb_projects = count($project_ids);
|
||||
|
||||
$paginator = $this->paginator
|
||||
->setUrl('ProjectListController', 'show')
|
||||
->setMax(20)
|
||||
->setOrder('name')
|
||||
->setQuery($this->project->getQueryColumnStats($project_ids))
|
||||
->calculate();
|
||||
|
||||
$this->response->html($this->helper->layout->app('project_list/show', array(
|
||||
'paginator' => $paginator,
|
||||
'nb_projects' => $nb_projects,
|
||||
'title' => t('Projects').' ('.$nb_projects.')'
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
/**
|
||||
* Class ProjectStatusController
|
||||
*
|
||||
* @package Kanboard\Controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class ProjectStatusController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Enable a project (confirmation dialog box)
|
||||
*/
|
||||
public function confirmEnable()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->template->render('project_status/enable', array(
|
||||
'project' => $project,
|
||||
'title' => t('Project activation')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable the project
|
||||
*/
|
||||
public function enable()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$this->checkCSRFParam();
|
||||
|
||||
if ($this->project->enable($project['id'])) {
|
||||
$this->flash->success(t('Project activated successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to activate this project.'));
|
||||
}
|
||||
|
||||
$this->response->redirect($this->helper->url->to('ProjectViewController', 'show', array('project_id' => $project['id'])), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable a project (confirmation dialog box)
|
||||
*/
|
||||
public function confirmDisable()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->template->render('project_status/disable', array(
|
||||
'project' => $project,
|
||||
'title' => t('Project activation')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable a project
|
||||
*/
|
||||
public function disable()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$this->checkCSRFParam();
|
||||
|
||||
if ($this->project->disable($project['id'])) {
|
||||
$this->flash->success(t('Project disabled successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to disable this project.'));
|
||||
}
|
||||
|
||||
$this->response->redirect($this->helper->url->to('ProjectViewController', 'show', array('project_id' => $project['id'])), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a project (confirmation dialog box)
|
||||
*/
|
||||
public function confirmRemove()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->template->render('project_status/remove', array(
|
||||
'project' => $project,
|
||||
'title' => t('Remove project')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a project
|
||||
*/
|
||||
public function remove()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$this->checkCSRFParam();
|
||||
|
||||
if ($this->project->remove($project['id'])) {
|
||||
$this->flash->success(t('Project removed successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to remove this project.'));
|
||||
}
|
||||
|
||||
$this->response->redirect($this->helper->url->to('ProjectListController', 'show'), true);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
<?php
|
||||
|
||||
namespace Kanboard\Controller;
|
||||
|
||||
/**
|
||||
* Class ProjectViewController
|
||||
*
|
||||
* @package Kanboard\Controller
|
||||
* @author Frederic Guillot
|
||||
*/
|
||||
class ProjectViewController extends BaseController
|
||||
{
|
||||
/**
|
||||
* Show the project information page
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function show()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->project('project_view/show', array(
|
||||
'project' => $project,
|
||||
'stats' => $this->project->getTaskStats($project['id']),
|
||||
'title' => $project['name'],
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Public access management
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function share()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->project('project_view/share', array(
|
||||
'project' => $project,
|
||||
'title' => t('Public access'),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Change project sharing
|
||||
*
|
||||
* @throws \Kanboard\Core\Controller\AccessForbiddenException
|
||||
* @throws \Kanboard\Core\Controller\PageNotFoundException
|
||||
*/
|
||||
public function updateSharing()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$this->checkCSRFParam();
|
||||
$switch = $this->request->getStringParam('switch');
|
||||
|
||||
if ($this->project->{$switch.'PublicAccess'}($project['id'])) {
|
||||
$this->flash->success(t('Project updated successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to update this project.'));
|
||||
}
|
||||
|
||||
$this->response->redirect($this->helper->url->to('ProjectViewController', 'share', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
/**
|
||||
* Integrations page
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function integrations()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->project('project_view/integrations', array(
|
||||
'project' => $project,
|
||||
'title' => t('Integrations'),
|
||||
'webhook_token' => $this->config->get('webhook_token'),
|
||||
'values' => $this->projectMetadata->getAll($project['id']),
|
||||
'errors' => array(),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update integrations
|
||||
*
|
||||
* @throws \Kanboard\Core\Controller\PageNotFoundException
|
||||
*/
|
||||
public function updateIntegrations()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->projectMetadata->save($project['id'], $this->request->getValues());
|
||||
$this->flash->success(t('Project updated successfully.'));
|
||||
$this->response->redirect($this->helper->url->to('ProjectViewController', 'integrations', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display project notifications
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function notifications()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->project('project_view/notifications', array(
|
||||
'notifications' => $this->projectNotification->readSettings($project['id']),
|
||||
'types' => $this->projectNotificationType->getTypes(),
|
||||
'project' => $project,
|
||||
'title' => t('Notifications'),
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update notifications
|
||||
*
|
||||
* @throws \Kanboard\Core\Controller\PageNotFoundException
|
||||
*/
|
||||
public function updateNotifications()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$values = $this->request->getValues();
|
||||
|
||||
$this->projectNotification->saveSettings($project['id'], $values);
|
||||
$this->flash->success(t('Project updated successfully.'));
|
||||
$this->response->redirect($this->helper->url->to('ProjectViewController', 'notifications', array('project_id' => $project['id'])));
|
||||
}
|
||||
|
||||
/**
|
||||
* Duplicate a project
|
||||
*
|
||||
* @author Antonio Rabelo
|
||||
* @author Michael Lüpkes
|
||||
* @access public
|
||||
*/
|
||||
public function duplicate()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
|
||||
$this->response->html($this->helper->layout->project('project_view/duplicate', array(
|
||||
'project' => $project,
|
||||
'title' => t('Clone this project')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Do project duplication
|
||||
*/
|
||||
public function doDuplication()
|
||||
{
|
||||
$project = $this->getProject();
|
||||
$project_id = $this->projectDuplication->duplicate($project['id'], array_keys($this->request->getValues()), $this->userSession->getId());
|
||||
|
||||
if ($project_id !== false) {
|
||||
$this->flash->success(t('Project cloned successfully.'));
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to clone this project.'));
|
||||
}
|
||||
|
||||
$this->response->redirect($this->helper->url->to('ProjectViewController', 'show', array('project_id' => $project_id)));
|
||||
}
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ class ProjectGanttFormatter extends BaseFormatter implements FormatterInterface
|
|||
(int) date('n', $end),
|
||||
(int) date('j', $end),
|
||||
),
|
||||
'link' => $this->helper->url->href('project', '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'])),
|
||||
'gantt_link' => $this->helper->url->href('gantt', 'project', array('project_id' => $project['id'])),
|
||||
'color' => $color,
|
||||
|
|
|
|||
|
|
@ -81,11 +81,12 @@ class AuthenticationProvider implements ServiceProviderInterface
|
|||
$acl->add('Export', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('TaskFile', array('screenshot', 'create', 'save', 'remove', 'confirm'), Role::PROJECT_MEMBER);
|
||||
$acl->add('Gantt', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('Project', array('share', 'integrations', 'notifications', 'duplicate', 'disable', 'enable', 'remove'), Role::PROJECT_MANAGER);
|
||||
$acl->add('ProjectViewController', array('share', 'updateSharing', 'integrations', 'updateIntegrations', 'notifications', 'updateNotifications', 'duplicate', 'doDuplication'), Role::PROJECT_MANAGER);
|
||||
$acl->add('ProjectPermission', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('ProjectEdit', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('ProjectFile', '*', Role::PROJECT_MEMBER);
|
||||
$acl->add('Projectuser', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('ProjectStatusController', '*', Role::PROJECT_MANAGER);
|
||||
$acl->add('SubtaskController', '*', Role::PROJECT_MEMBER);
|
||||
$acl->add('SubtaskRestrictionController', '*', Role::PROJECT_MEMBER);
|
||||
$acl->add('SubtaskStatusController', '*', Role::PROJECT_MEMBER);
|
||||
|
|
|
|||
|
|
@ -49,17 +49,14 @@ class RouteProvider implements ServiceProviderInterface
|
|||
$container['route']->addRoute('project/create/private', 'ProjectCreation', 'createPrivate');
|
||||
|
||||
// Project routes
|
||||
$container['route']->addRoute('projects', 'project', 'index');
|
||||
$container['route']->addRoute('project/:project_id', 'project', 'show');
|
||||
$container['route']->addRoute('p/:project_id', 'project', 'show');
|
||||
$container['route']->addRoute('projects', 'ProjectListController', 'show');
|
||||
$container['route']->addRoute('project/:project_id', 'ProjectViewController', 'show');
|
||||
$container['route']->addRoute('p/:project_id', 'ProjectViewController', 'show');
|
||||
$container['route']->addRoute('project/:project_id/customer-filters', 'customfilter', 'index');
|
||||
$container['route']->addRoute('project/:project_id/share', 'project', 'share');
|
||||
$container['route']->addRoute('project/:project_id/notifications', 'project', 'notifications');
|
||||
$container['route']->addRoute('project/:project_id/integrations', 'project', 'integrations');
|
||||
$container['route']->addRoute('project/:project_id/duplicate', 'project', 'duplicate');
|
||||
$container['route']->addRoute('project/:project_id/remove', 'project', 'remove');
|
||||
$container['route']->addRoute('project/:project_id/disable', 'project', 'disable');
|
||||
$container['route']->addRoute('project/:project_id/enable', 'project', 'enable');
|
||||
$container['route']->addRoute('project/:project_id/share', 'ProjectViewController', 'share');
|
||||
$container['route']->addRoute('project/:project_id/notifications', 'ProjectViewController', 'notifications');
|
||||
$container['route']->addRoute('project/:project_id/integrations', 'ProjectViewController', 'integrations');
|
||||
$container['route']->addRoute('project/:project_id/duplicate', 'ProjectViewController', 'duplicate');
|
||||
$container['route']->addRoute('project/:project_id/permissions', 'ProjectPermission', 'index');
|
||||
$container['route']->addRoute('project/:project_id/import', 'taskImport', 'step1');
|
||||
$container['route']->addRoute('project/:project_id/activity', 'activity', 'project');
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<i class="fa fa-folder fa-fw"></i>
|
||||
<?= $this->url->link(t('Project management'), 'project', 'index') ?>
|
||||
<?= $this->url->link(t('Project management'), 'ProjectListController', 'show') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -29,4 +29,4 @@
|
|||
<?= $content_for_sublayout ?>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="page-header">
|
||||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('Projects list'), 'project', 'index') ?>
|
||||
<i class="fa fa-folder fa-fw"></i><?= $this->url->link(t('Projects list'), 'ProjectListController', 'show') ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasAccess('projectuser', 'managers')): ?>
|
||||
<li><i class="fa fa-user fa-fw"></i><?= $this->url->link(t('Users overview'), 'projectuser', 'managers') ?></li>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<i class="fa fa-folder fa-fw"></i>
|
||||
<?= $this->url->link(t('Projects management'), 'project', 'index') ?>
|
||||
<?= $this->url->link(t('Projects management'), 'ProjectListController', 'show') ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasAccess('UserListController', 'show')): ?>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Project activation') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to disable this project: "%s"?', $project['name']) ?>
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= $this->url->link(t('Yes'), 'project', 'disable', array('project_id' => $project['id'], 'disable' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -37,7 +37,7 @@
|
|||
<?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-cog fa-fw"></i>
|
||||
<?= $this->url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->url->link(t('Settings'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Project activation') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to enable this project: "%s"?', $project['name']) ?>
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= $this->url->link(t('Yes'), 'project', 'enable', array('project_id' => $project['id'], 'enable' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Remove project') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to remove this project: "%s"?', $project['name']) ?>
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= $this->url->link(t('Yes'), 'project', 'remove', array('project_id' => $project['id'], 'remove' => 'yes'), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
<div class="sidebar">
|
||||
<h2><?= t('Actions') ?></h2>
|
||||
<ul>
|
||||
<li <?= $this->app->checkMenuSelection('project', 'show') ?>>
|
||||
<?= $this->url->link(t('Summary'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<li <?= $this->app->checkMenuSelection('ProjectViewController', 'show') ?>>
|
||||
<?= $this->url->link(t('Summary'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('customfilter', 'index', $project['id'])): ?>
|
||||
<li <?= $this->app->checkMenuSelection('customfilter') ?>>
|
||||
|
|
@ -14,14 +14,14 @@
|
|||
<li <?= $this->app->checkMenuSelection('ProjectEdit') ?>>
|
||||
<?= $this->url->link(t('Edit project'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('project', 'share') ?>>
|
||||
<?= $this->url->link(t('Public access'), 'project', 'share', array('project_id' => $project['id'])) ?>
|
||||
<li <?= $this->app->checkMenuSelection('ProjectViewController', 'share') ?>>
|
||||
<?= $this->url->link(t('Public access'), 'ProjectViewController', 'share', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('project', 'notifications') ?>>
|
||||
<?= $this->url->link(t('Notifications'), 'project', 'notifications', array('project_id' => $project['id'])) ?>
|
||||
<li <?= $this->app->checkMenuSelection('ProjectViewController', 'notifications') ?>>
|
||||
<?= $this->url->link(t('Notifications'), 'ProjectViewController', 'notifications', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('project', 'integrations') ?>>
|
||||
<?= $this->url->link(t('Integrations'), 'project', 'integrations', array('project_id' => $project['id'])) ?>
|
||||
<li <?= $this->app->checkMenuSelection('ProjectViewController', 'integrations') ?>>
|
||||
<?= $this->url->link(t('Integrations'), 'ProjectViewController', 'integrations', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('column') ?>>
|
||||
<?= $this->url->link(t('Columns'), 'column', 'index', array('project_id' => $project['id'])) ?>
|
||||
|
|
@ -40,23 +40,23 @@
|
|||
<li <?= $this->app->checkMenuSelection('action') ?>>
|
||||
<?= $this->url->link(t('Automatic actions'), 'action', 'index', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('project', 'duplicate') ?>>
|
||||
<?= $this->url->link(t('Duplicate'), 'project', 'duplicate', array('project_id' => $project['id'])) ?>
|
||||
<li <?= $this->app->checkMenuSelection('ProjectViewController', 'duplicate') ?>>
|
||||
<?= $this->url->link(t('Duplicate'), 'ProjectViewController', 'duplicate', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<?php if ($project['is_active']): ?>
|
||||
<li <?= $this->app->checkMenuSelection('project', 'disable') ?>>
|
||||
<?= $this->url->link(t('Disable'), 'project', 'disable', array('project_id' => $project['id']), true) ?>
|
||||
<li>
|
||||
<?= $this->url->link(t('Disable'), 'ProjectStatusController', 'confirmDisable', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
<?php else: ?>
|
||||
<li <?= $this->app->checkMenuSelection('project', 'enable') ?>>
|
||||
<?= $this->url->link(t('Enable'), 'project', 'enable', array('project_id' => $project['id']), true) ?>
|
||||
<li>
|
||||
<?= $this->url->link(t('Enable'), 'ProjectStatusController', 'confirmEnable', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<li <?= $this->app->checkMenuSelection('taskImport') ?>>
|
||||
<?= $this->url->link(t('Import'), 'taskImport', 'step1', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasProjectAccess('project', 'remove', $project['id'])): ?>
|
||||
<li <?= $this->app->checkMenuSelection('project', 'remove') ?>>
|
||||
<?= $this->url->link(t('Remove'), 'project', 'remove', array('project_id' => $project['id'])) ?>
|
||||
<?php if ($this->user->hasProjectAccess('ProjectStatusController', 'remove', $project['id'])): ?>
|
||||
<li>
|
||||
<?= $this->url->link(t('Remove'), 'ProjectStatusController', 'confirmRemove', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'project', 'index', array(), false, 'close-popover') ?>
|
||||
<?= $this->url->link(t('cancel'), 'ProjectListController', 'show', array(), false, 'close-popover') ?>
|
||||
</div>
|
||||
</form>
|
||||
<?php if ($is_private): ?>
|
||||
|
|
@ -39,4 +39,4 @@
|
|||
<p><?= t('There is no user management for private projects.') ?></p>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -75,13 +75,13 @@
|
|||
<?php if ($this->user->hasProjectAccess('ProjectEdit', 'edit', $project['id'])): ?>
|
||||
<li>
|
||||
<i class="fa fa-cog fa-fw"></i>
|
||||
<?= $this->url->link(t('Settings'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->url->link(t('Settings'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
|
||||
<li>
|
||||
<i class="fa fa-folder fa-fw" aria-hidden="true"></i>
|
||||
<?= $this->url->link(t('Manage projects'), 'project', 'index') ?>
|
||||
<?= $this->url->link(t('Manage projects'), 'ProjectListController', 'show') ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Project activation') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to disable this project: "%s"?', $project['name']) ?>
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= $this->url->link(t('Yes'), 'ProjectStatusController', 'disable', array('project_id' => $project['id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'ProjectViewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Project activation') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to enable this project: "%s"?', $project['name']) ?>
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= $this->url->link(t('Yes'), 'ProjectStatusController', 'enable', array('project_id' => $project['id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'ProjectViewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
<div class="page-header">
|
||||
<h2><?= t('Remove project') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to remove this project: "%s"?', $project['name']) ?>
|
||||
</p>
|
||||
|
||||
<div class="form-actions">
|
||||
<?= $this->url->link(t('Yes'), 'ProjectStatusController', 'remove', array('project_id' => $project['id']), true, 'btn btn-red') ?>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'ProjectViewController', 'show', array('project_id' => $project['id']), false, 'close-popover') ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<ul>
|
||||
<li>
|
||||
<i class="fa fa-folder fa-fw"></i>
|
||||
<?= $this->url->link(t('Projects list'), 'project', 'index') ?>
|
||||
<?= $this->url->link(t('Projects list'), 'ProjectListController', 'show') ?>
|
||||
</li>
|
||||
<?php if ($this->user->hasAccess('gantt', 'projects')): ?>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<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-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>', 'project', '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')) ?>
|
||||
|
||||
<?= $this->text->e($project['project_name']) ?>
|
||||
</td>
|
||||
|
|
@ -30,4 +30,4 @@
|
|||
</table>
|
||||
|
||||
<?= $paginator ?>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<p class="alert alert-info">
|
||||
<?= t('Which parts of the project do you want to duplicate?') ?>
|
||||
</p>
|
||||
<form method="post" action="<?= $this->url->href('project', 'duplicate', array('project_id' => $project['id'], 'duplicate' => 'yes')) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->url->href('ProjectViewController', 'doDuplication', array('project_id' => $project['id'], 'duplicate' => 'yes')) ?>" autocomplete="off">
|
||||
|
||||
<?= $this->form->csrf() ?>
|
||||
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-red"><?= t('Duplicate') ?></button>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= t('or') ?> <?= $this->url->link(t('cancel'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
<h2><?= t('Integration with third-party services') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="<?= $this->url->href('project', 'integrations', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->url->href('ProjectViewController', 'updateIntegrations', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
|
||||
<?php $integrations = $this->hook->render('template:project:integrations', array('project' => $project, 'values' => $values, 'webhook_token' => $webhook_token)) ?>
|
||||
|
|
@ -12,4 +12,4 @@
|
|||
<?php else: ?>
|
||||
<?= $integrations ?>
|
||||
<?php endif ?>
|
||||
</form>
|
||||
</form>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<?php if (empty($types)): ?>
|
||||
<p class="alert"><?= t('No plugin has registered a project notification method. You can still configure individual notifications in your user profile.') ?></p>
|
||||
<?php else: ?>
|
||||
<form method="post" action="<?= $this->url->href('project', 'notifications', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
<form method="post" action="<?= $this->url->href('ProjectViewController', 'updateNotifications', array('project_id' => $project['id'])) ?>" autocomplete="off">
|
||||
|
||||
<?= $this->form->csrf() ?>
|
||||
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-blue"><?= t('Save') ?></button>
|
||||
<?= t('or') ?>
|
||||
<?= $this->url->link(t('cancel'), 'project', 'show', array('project_id' => $project['id'])) ?>
|
||||
<?= $this->url->link(t('cancel'), 'ProjectViewController', 'show', array('project_id' => $project['id'])) ?>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
|
@ -12,8 +12,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<?= $this->url->link(t('Disable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?>
|
||||
|
||||
<?= $this->url->link(t('Disable public access'), 'ProjectViewController', 'updateSharing', array('project_id' => $project['id'], 'switch' => 'disable'), true, 'btn btn-red') ?>
|
||||
<?php else: ?>
|
||||
<?= $this->url->link(t('Enable public access'), 'project', 'share', array('project_id' => $project['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?>
|
||||
<?= $this->url->link(t('Enable public access'), 'ProjectViewController', 'updateSharing', array('project_id' => $project['id'], 'switch' => 'enable'), true, 'btn btn-blue') ?>
|
||||
<?php endif ?>
|
||||
Loading…
Reference in New Issue