summaryrefslogtreecommitdiff
path: root/app/ServiceProvider
diff options
context:
space:
mode:
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r--app/ServiceProvider/ActionProvider.php4
-rw-r--r--app/ServiceProvider/AuthenticationProvider.php34
-rw-r--r--app/ServiceProvider/ClassProvider.php22
-rw-r--r--app/ServiceProvider/ExternalLinkProvider.php34
-rw-r--r--app/ServiceProvider/GroupProvider.php5
-rw-r--r--app/ServiceProvider/HelperProvider.php34
-rw-r--r--app/ServiceProvider/RouteProvider.php64
7 files changed, 125 insertions, 72 deletions
diff --git a/app/ServiceProvider/ActionProvider.php b/app/ServiceProvider/ActionProvider.php
index 0aba29f1..3692f190 100644
--- a/app/ServiceProvider/ActionProvider.php
+++ b/app/ServiceProvider/ActionProvider.php
@@ -23,12 +23,14 @@ use Kanboard\Action\TaskCloseColumn;
use Kanboard\Action\TaskCreation;
use Kanboard\Action\TaskDuplicateAnotherProject;
use Kanboard\Action\TaskEmail;
+use Kanboard\Action\TaskEmailNoActivity;
use Kanboard\Action\TaskMoveAnotherProject;
use Kanboard\Action\TaskMoveColumnAssigned;
use Kanboard\Action\TaskMoveColumnCategoryChange;
use Kanboard\Action\TaskMoveColumnUnAssigned;
use Kanboard\Action\TaskOpen;
use Kanboard\Action\TaskUpdateStartDate;
+use Kanboard\Action\TaskCloseNoActivity;
/**
* Action Provider
@@ -63,9 +65,11 @@ class ActionProvider implements ServiceProviderInterface
$container['actionManager']->register(new TaskAssignUser($container));
$container['actionManager']->register(new TaskClose($container));
$container['actionManager']->register(new TaskCloseColumn($container));
+ $container['actionManager']->register(new TaskCloseNoActivity($container));
$container['actionManager']->register(new TaskCreation($container));
$container['actionManager']->register(new TaskDuplicateAnotherProject($container));
$container['actionManager']->register(new TaskEmail($container));
+ $container['actionManager']->register(new TaskEmailNoActivity($container));
$container['actionManager']->register(new TaskMoveAnotherProject($container));
$container['actionManager']->register(new TaskMoveColumnAssigned($container));
$container['actionManager']->register(new TaskMoveColumnCategoryChange($container));
diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php
index a516cffe..5ed28fe1 100644
--- a/app/ServiceProvider/AuthenticationProvider.php
+++ b/app/ServiceProvider/AuthenticationProvider.php
@@ -11,9 +11,6 @@ use Kanboard\Core\Security\Role;
use Kanboard\Auth\RememberMeAuth;
use Kanboard\Auth\DatabaseAuth;
use Kanboard\Auth\LdapAuth;
-use Kanboard\Auth\GitlabAuth;
-use Kanboard\Auth\GithubAuth;
-use Kanboard\Auth\GoogleAuth;
use Kanboard\Auth\TotpAuth;
use Kanboard\Auth\ReverseProxyAuth;
@@ -47,18 +44,6 @@ class AuthenticationProvider implements ServiceProviderInterface
$container['authenticationManager']->register(new LdapAuth($container));
}
- if (GITLAB_AUTH) {
- $container['authenticationManager']->register(new GitlabAuth($container));
- }
-
- if (GITHUB_AUTH) {
- $container['authenticationManager']->register(new GithubAuth($container));
- }
-
- if (GOOGLE_AUTH) {
- $container['authenticationManager']->register(new GoogleAuth($container));
- }
-
$container['projectAccessMap'] = $this->getProjectAccessMap();
$container['applicationAccessMap'] = $this->getApplicationAccessMap();
@@ -82,6 +67,8 @@ class AuthenticationProvider implements ServiceProviderInterface
$acl->setRoleHierarchy(Role::PROJECT_MEMBER, array(Role::PROJECT_VIEWER));
$acl->add('Action', '*', Role::PROJECT_MANAGER);
+ $acl->add('ActionProject', '*', Role::PROJECT_MANAGER);
+ $acl->add('ActionCreation', '*', Role::PROJECT_MANAGER);
$acl->add('Analytic', '*', Role::PROJECT_MANAGER);
$acl->add('Board', 'save', Role::PROJECT_MEMBER);
$acl->add('BoardPopover', '*', Role::PROJECT_MEMBER);
@@ -91,22 +78,28 @@ class AuthenticationProvider implements ServiceProviderInterface
$acl->add('Comment', '*', Role::PROJECT_MEMBER);
$acl->add('Customfilter', '*', Role::PROJECT_MEMBER);
$acl->add('Export', '*', Role::PROJECT_MANAGER);
- $acl->add('File', array('screenshot', 'create', 'save', 'remove', 'confirm'), Role::PROJECT_MEMBER);
+ $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('ProjectPermission', '*', Role::PROJECT_MANAGER);
$acl->add('ProjectEdit', '*', Role::PROJECT_MANAGER);
+ $acl->add('ProjectFile', '*', Role::PROJECT_MEMBER);
$acl->add('Projectuser', '*', Role::PROJECT_MANAGER);
$acl->add('Subtask', '*', Role::PROJECT_MEMBER);
+ $acl->add('SubtaskRestriction', '*', Role::PROJECT_MEMBER);
+ $acl->add('SubtaskStatus', '*', Role::PROJECT_MEMBER);
$acl->add('Swimlane', '*', Role::PROJECT_MANAGER);
$acl->add('Task', 'remove', Role::PROJECT_MEMBER);
$acl->add('Taskcreation', '*', Role::PROJECT_MEMBER);
$acl->add('Taskduplication', '*', Role::PROJECT_MEMBER);
+ $acl->add('TaskRecurrence', '*', Role::PROJECT_MEMBER);
$acl->add('TaskImport', '*', Role::PROJECT_MANAGER);
$acl->add('Tasklink', '*', Role::PROJECT_MEMBER);
+ $acl->add('Tasklink', array('show'), Role::PROJECT_VIEWER);
+ $acl->add('TaskExternalLink', '*', Role::PROJECT_MEMBER);
+ $acl->add('TaskExternalLink', array('show'), Role::PROJECT_VIEWER);
$acl->add('Taskmodification', '*', Role::PROJECT_MEMBER);
$acl->add('Taskstatus', '*', Role::PROJECT_MEMBER);
- $acl->add('Timer', '*', Role::PROJECT_MEMBER);
$acl->add('UserHelper', array('mention'), Role::PROJECT_MEMBER);
return $acl;
@@ -126,7 +119,6 @@ class AuthenticationProvider implements ServiceProviderInterface
$acl->setRoleHierarchy(Role::APP_MANAGER, array(Role::APP_USER, Role::APP_PUBLIC));
$acl->setRoleHierarchy(Role::APP_USER, array(Role::APP_PUBLIC));
- $acl->add('Oauth', array('google', 'github', 'gitlab'), Role::APP_PUBLIC);
$acl->add('Auth', array('login', 'check'), Role::APP_PUBLIC);
$acl->add('Captcha', '*', Role::APP_PUBLIC);
$acl->add('PasswordReset', '*', Role::APP_PUBLIC);
@@ -141,12 +133,12 @@ class AuthenticationProvider implements ServiceProviderInterface
$acl->add('Gantt', array('projects', 'saveProjectDate'), Role::APP_MANAGER);
$acl->add('Group', '*', Role::APP_ADMIN);
$acl->add('Link', '*', Role::APP_ADMIN);
- $acl->add('Project', array('users', 'allowEverybody', 'allow', 'role', 'revoke', 'create'), Role::APP_MANAGER);
- $acl->add('ProjectPermission', '*', Role::APP_USER);
+ $acl->add('ProjectCreation', 'create', Role::APP_MANAGER);
$acl->add('Projectuser', '*', Role::APP_MANAGER);
$acl->add('Twofactor', 'disable', Role::APP_ADMIN);
$acl->add('UserImport', '*', Role::APP_ADMIN);
- $acl->add('User', array('index', 'create', 'save', 'authentication', 'remove'), Role::APP_ADMIN);
+ $acl->add('User', array('index', 'create', 'save', 'authentication'), Role::APP_ADMIN);
+ $acl->add('UserStatus', '*', Role::APP_ADMIN);
return $acl;
}
diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php
index df4e183b..b883c905 100644
--- a/app/ServiceProvider/ClassProvider.php
+++ b/app/ServiceProvider/ClassProvider.php
@@ -27,19 +27,19 @@ class ClassProvider implements ServiceProviderInterface
'Board',
'Category',
'Color',
+ 'Column',
'Comment',
'Config',
'Currency',
'CustomFilter',
- 'File',
'Group',
'GroupMember',
'LastLogin',
'Link',
'Notification',
- 'OverdueNotification',
'PasswordReset',
'Project',
+ 'ProjectFile',
'ProjectActivity',
'ProjectDuplication',
'ProjectDailyColumnStats',
@@ -53,26 +53,24 @@ class ClassProvider implements ServiceProviderInterface
'ProjectUserRoleFilter',
'RememberMeSession',
'Subtask',
- 'SubtaskExport',
'SubtaskTimeTracking',
'Swimlane',
'Task',
'TaskAnalytic',
'TaskCreation',
'TaskDuplication',
- 'TaskExport',
+ 'TaskExternalLink',
'TaskFinder',
+ 'TaskFile',
'TaskFilter',
'TaskLink',
'TaskModification',
'TaskPermission',
'TaskPosition',
'TaskStatus',
- 'TaskImport',
'TaskMetadata',
'Transition',
'User',
- 'UserImport',
'UserLocking',
'UserMention',
'UserNotification',
@@ -97,6 +95,7 @@ class ClassProvider implements ServiceProviderInterface
'CommentValidator',
'CurrencyValidator',
'CustomFilterValidator',
+ 'ExternalLinkValidator',
'GroupValidator',
'LinkValidator',
'PasswordResetValidator',
@@ -107,11 +106,18 @@ class ClassProvider implements ServiceProviderInterface
'TaskLinkValidator',
'UserValidator',
),
+ 'Import' => array(
+ 'TaskImport',
+ 'UserImport',
+ ),
+ 'Export' => array(
+ 'SubtaskExport',
+ 'TaskExport',
+ 'TransitionExport',
+ ),
'Core' => array(
'DateParser',
- 'Helper',
'Lexer',
- 'Template',
),
'Core\Event' => array(
'EventManager',
diff --git a/app/ServiceProvider/ExternalLinkProvider.php b/app/ServiceProvider/ExternalLinkProvider.php
new file mode 100644
index 00000000..c4bbc4cf
--- /dev/null
+++ b/app/ServiceProvider/ExternalLinkProvider.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Kanboard\ServiceProvider;
+
+use Pimple\Container;
+use Pimple\ServiceProviderInterface;
+use Kanboard\Core\ExternalLink\ExternalLinkManager;
+use Kanboard\ExternalLink\WebLinkProvider;
+use Kanboard\ExternalLink\AttachmentLinkProvider;
+
+/**
+ * External Link Provider
+ *
+ * @package serviceProvider
+ * @author Frederic Guillot
+ */
+class ExternalLinkProvider implements ServiceProviderInterface
+{
+ /**
+ * Register providers
+ *
+ * @access public
+ * @param \Pimple\Container $container
+ * @return \Pimple\Container
+ */
+ public function register(Container $container)
+ {
+ $container['externalLinkManager'] = new ExternalLinkManager($container);
+ $container['externalLinkManager']->register(new WebLinkProvider($container));
+ $container['externalLinkManager']->register(new AttachmentLinkProvider($container));
+
+ return $container;
+ }
+}
diff --git a/app/ServiceProvider/GroupProvider.php b/app/ServiceProvider/GroupProvider.php
index dff4b23a..b222b218 100644
--- a/app/ServiceProvider/GroupProvider.php
+++ b/app/ServiceProvider/GroupProvider.php
@@ -26,7 +26,10 @@ class GroupProvider implements ServiceProviderInterface
public function register(Container $container)
{
$container['groupManager'] = new GroupManager;
- $container['groupManager']->register(new DatabaseBackendGroupProvider($container));
+
+ if (DB_GROUP_PROVIDER) {
+ $container['groupManager']->register(new DatabaseBackendGroupProvider($container));
+ }
if (LDAP_AUTH && LDAP_GROUP_PROVIDER) {
$container['groupManager']->register(new LdapBackendGroupProvider($container));
diff --git a/app/ServiceProvider/HelperProvider.php b/app/ServiceProvider/HelperProvider.php
new file mode 100644
index 00000000..42a0c85e
--- /dev/null
+++ b/app/ServiceProvider/HelperProvider.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Kanboard\ServiceProvider;
+
+use Kanboard\Core\Helper;
+use Kanboard\Core\Template;
+use Pimple\Container;
+use Pimple\ServiceProviderInterface;
+
+class HelperProvider implements ServiceProviderInterface
+{
+ public function register(Container $container)
+ {
+ $container['helper'] = new Helper($container);
+ $container['helper']->register('app', '\Kanboard\Helper\AppHelper');
+ $container['helper']->register('asset', '\Kanboard\Helper\AssetHelper');
+ $container['helper']->register('board', '\Kanboard\Helper\BoardHelper');
+ $container['helper']->register('dt', '\Kanboard\Helper\DateHelper');
+ $container['helper']->register('file', '\Kanboard\Helper\FileHelper');
+ $container['helper']->register('form', '\Kanboard\Helper\FormHelper');
+ $container['helper']->register('hook', '\Kanboard\Helper\HookHelper');
+ $container['helper']->register('layout', '\Kanboard\Helper\LayoutHelper');
+ $container['helper']->register('model', '\Kanboard\Helper\ModelHelper');
+ $container['helper']->register('subtask', '\Kanboard\Helper\SubtaskHelper');
+ $container['helper']->register('task', '\Kanboard\Helper\TaskHelper');
+ $container['helper']->register('text', '\Kanboard\Helper\TextHelper');
+ $container['helper']->register('url', '\Kanboard\Helper\UrlHelper');
+ $container['helper']->register('user', '\Kanboard\Helper\UserHelper');
+
+ $container['template'] = new Template($container['helper']);
+
+ return $container;
+ }
+}
diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php
index 057a1b3c..d551f25d 100644
--- a/app/ServiceProvider/RouteProvider.php
+++ b/app/ServiceProvider/RouteProvider.php
@@ -38,18 +38,21 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('dashboard/:user_id/subtasks', 'app', 'subtasks');
$container['route']->addRoute('dashboard/:user_id/calendar', 'app', 'calendar');
$container['route']->addRoute('dashboard/:user_id/activity', 'app', 'activity');
+ $container['route']->addRoute('dashboard/:user_id/notifications', 'app', 'notifications');
// Search routes
$container['route']->addRoute('search', 'search', 'index');
$container['route']->addRoute('search/:search', 'search', 'index');
+ // ProjectCreation routes
+ $container['route']->addRoute('project/create', 'ProjectCreation', 'create');
+ $container['route']->addRoute('project/create/private', 'ProjectCreation', 'createPrivate');
+
// Project routes
$container['route']->addRoute('projects', 'project', 'index');
- $container['route']->addRoute('project/create', 'project', 'create');
- $container['route']->addRoute('project/create/private', 'project', 'createPrivate');
$container['route']->addRoute('project/:project_id', 'project', 'show');
$container['route']->addRoute('p/:project_id', 'project', 'show');
- $container['route']->addRoute('project/:project_id/customer-filter', 'customfilter', 'index');
+ $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');
@@ -60,6 +63,9 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('project/:project_id/permissions', 'ProjectPermission', 'index');
$container['route']->addRoute('project/:project_id/import', 'taskImport', 'step1');
+ // Project Overview
+ $container['route']->addRoute('project/:project_id/overview', 'ProjectOverview', 'show');
+
// ProjectEdit routes
$container['route']->addRoute('project/:project_id/edit', 'ProjectEdit', 'edit');
$container['route']->addRoute('project/:project_id/edit/dates', 'ProjectEdit', 'dates');
@@ -75,27 +81,15 @@ class RouteProvider implements ServiceProviderInterface
// Action routes
$container['route']->addRoute('project/:project_id/actions', 'action', 'index');
- $container['route']->addRoute('project/:project_id/action/:action_id/confirm', 'action', 'confirm');
// Column routes
$container['route']->addRoute('project/:project_id/columns', 'column', 'index');
- $container['route']->addRoute('project/:project_id/column/:column_id/edit', 'column', 'edit');
- $container['route']->addRoute('project/:project_id/column/:column_id/confirm', 'column', 'confirm');
- $container['route']->addRoute('project/:project_id/column/:column_id/move/:direction', 'column', 'move');
// Swimlane routes
$container['route']->addRoute('project/:project_id/swimlanes', 'swimlane', 'index');
- $container['route']->addRoute('project/:project_id/swimlane/:swimlane_id/edit', 'swimlane', 'edit');
- $container['route']->addRoute('project/:project_id/swimlane/:swimlane_id/confirm', 'swimlane', 'confirm');
- $container['route']->addRoute('project/:project_id/swimlane/:swimlane_id/disable', 'swimlane', 'disable');
- $container['route']->addRoute('project/:project_id/swimlane/:swimlane_id/enable', 'swimlane', 'enable');
- $container['route']->addRoute('project/:project_id/swimlane/:swimlane_id/up', 'swimlane', 'moveup');
- $container['route']->addRoute('project/:project_id/swimlane/:swimlane_id/down', 'swimlane', 'movedown');
// Category routes
$container['route']->addRoute('project/:project_id/categories', 'category', 'index');
- $container['route']->addRoute('project/:project_id/category/:category_id/edit', 'category', 'edit');
- $container['route']->addRoute('project/:project_id/category/:category_id/confirm', 'category', 'confirm');
// Task routes
$container['route']->addRoute('project/:project_id/task/:task_id', 'task', 'show');
@@ -103,26 +97,12 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('public/task/:task_id/:token', 'task', 'readonly');
$container['route']->addRoute('project/:project_id/task/:task_id/activity', 'activity', 'task');
- $container['route']->addRoute('project/:project_id/task/:task_id/screenshot', 'file', 'screenshot');
- $container['route']->addRoute('project/:project_id/task/:task_id/upload', 'file', 'create');
- $container['route']->addRoute('project/:project_id/task/:task_id/comment', 'comment', 'create');
- $container['route']->addRoute('project/:project_id/task/:task_id/link', 'tasklink', 'create');
$container['route']->addRoute('project/:project_id/task/:task_id/transitions', 'task', 'transitions');
$container['route']->addRoute('project/:project_id/task/:task_id/analytics', 'task', 'analytics');
- $container['route']->addRoute('project/:project_id/task/:task_id/remove', 'task', 'remove');
-
- $container['route']->addRoute('project/:project_id/task/:task_id/edit', 'taskmodification', 'edit');
- $container['route']->addRoute('project/:project_id/task/:task_id/description', 'taskmodification', 'description');
- $container['route']->addRoute('project/:project_id/task/:task_id/recurrence', 'taskmodification', 'recurrence');
-
- $container['route']->addRoute('project/:project_id/task/:task_id/close', 'taskstatus', 'close');
- $container['route']->addRoute('project/:project_id/task/:task_id/open', 'taskstatus', 'open');
-
- $container['route']->addRoute('project/:project_id/task/:task_id/duplicate', 'taskduplication', 'duplicate');
- $container['route']->addRoute('project/:project_id/task/:task_id/copy', 'taskduplication', 'copy');
- $container['route']->addRoute('project/:project_id/task/:task_id/copy/:dst_project_id', 'taskduplication', 'copy');
- $container['route']->addRoute('project/:project_id/task/:task_id/move', 'taskduplication', 'move');
- $container['route']->addRoute('project/:project_id/task/:task_id/move/:dst_project_id', 'taskduplication', 'move');
+ $container['route']->addRoute('project/:project_id/task/:task_id/subtasks', 'subtask', 'show');
+ $container['route']->addRoute('project/:project_id/task/:task_id/time-tracking', 'task', 'timetracking');
+ $container['route']->addRoute('project/:project_id/task/:task_id/internal/links', 'tasklink', 'show');
+ $container['route']->addRoute('project/:project_id/task/:task_id/external/links', 'TaskExternalLink', 'show');
// Exports
$container['route']->addRoute('export/tasks/:project_id', 'export', 'tasks');
@@ -130,6 +110,15 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('export/transitions/:project_id', 'export', 'transitions');
$container['route']->addRoute('export/summary/:project_id', 'export', 'summary');
+ // Analytics routes
+ $container['route']->addRoute('analytics/tasks/:project_id', 'analytic', 'tasks');
+ $container['route']->addRoute('analytics/users/:project_id', 'analytic', 'users');
+ $container['route']->addRoute('analytics/cfd/:project_id', 'analytic', 'cfd');
+ $container['route']->addRoute('analytics/burndown/:project_id', 'analytic', 'burndown');
+ $container['route']->addRoute('analytics/average-time-column/:project_id', 'analytic', 'averageTimeByColumn');
+ $container['route']->addRoute('analytics/lead-cycle-time/:project_id', 'analytic', 'leadAndCycleTime');
+ $container['route']->addRoute('analytics/estimated-spent-time/:project_id', 'analytic', 'compareHours');
+
// Board routes
$container['route']->addRoute('board/:project_id', 'board', 'show');
$container['route']->addRoute('b/:project_id', 'board', 'show');
@@ -147,11 +136,6 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('gantt/:project_id', 'gantt', 'project');
$container['route']->addRoute('gantt/:project_id/sort/:sorting', 'gantt', 'project');
- // Subtask routes
- $container['route']->addRoute('project/:project_id/task/:task_id/subtask/create', 'subtask', 'create');
- $container['route']->addRoute('project/:project_id/task/:task_id/subtask/:subtask_id/remove', 'subtask', 'confirm');
- $container['route']->addRoute('project/:project_id/task/:task_id/subtask/:subtask_id/edit', 'subtask', 'edit');
-
// Feed routes
$container['route']->addRoute('feed/project/:token', 'feed', 'project');
$container['route']->addRoute('feed/user/:token', 'feed', 'user');
@@ -174,7 +158,6 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('user/:user_id/accounts', 'user', 'external');
$container['route']->addRoute('user/:user_id/integrations', 'user', 'integrations');
$container['route']->addRoute('user/:user_id/authentication', 'user', 'authentication');
- $container['route']->addRoute('user/:user_id/remove', 'user', 'remove');
$container['route']->addRoute('user/:user_id/2fa', 'twofactor', 'index');
// Groups
@@ -205,9 +188,6 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('documentation', 'doc', 'show');
// Auth routes
- $container['route']->addRoute('oauth/google', 'oauth', 'google');
- $container['route']->addRoute('oauth/github', 'oauth', 'github');
- $container['route']->addRoute('oauth/gitlab', 'oauth', 'gitlab');
$container['route']->addRoute('login', 'auth', 'login');
$container['route']->addRoute('logout', 'auth', 'logout');