diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-01-30 20:38:20 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-01-30 20:38:20 -0500 |
commit | 5c92f467867b43034b9e66b46b3b465ba9db655c (patch) | |
tree | cb0855ea64d8bba3abe4dfe978c5dbabb745911d /app/ServiceProvider | |
parent | ec66a779c9158830fe4bb0f96a44eadfe697ef00 (diff) |
Add external links for tasks with plugin api
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r-- | app/ServiceProvider/AuthenticationProvider.php | 3 | ||||
-rw-r--r-- | app/ServiceProvider/ClassProvider.php | 2 | ||||
-rw-r--r-- | app/ServiceProvider/ExternalLinkProvider.php | 34 | ||||
-rw-r--r-- | app/ServiceProvider/RouteProvider.php | 7 |
4 files changed, 46 insertions, 0 deletions
diff --git a/app/ServiceProvider/AuthenticationProvider.php b/app/ServiceProvider/AuthenticationProvider.php index ed0962b6..144abb0e 100644 --- a/app/ServiceProvider/AuthenticationProvider.php +++ b/app/ServiceProvider/AuthenticationProvider.php @@ -89,6 +89,9 @@ class AuthenticationProvider implements ServiceProviderInterface $acl->add('Taskduplication', '*', 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); diff --git a/app/ServiceProvider/ClassProvider.php b/app/ServiceProvider/ClassProvider.php index df4e183b..61a4c512 100644 --- a/app/ServiceProvider/ClassProvider.php +++ b/app/ServiceProvider/ClassProvider.php @@ -61,6 +61,7 @@ class ClassProvider implements ServiceProviderInterface 'TaskCreation', 'TaskDuplication', 'TaskExport', + 'TaskExternalLink', 'TaskFinder', 'TaskFilter', 'TaskLink', @@ -97,6 +98,7 @@ class ClassProvider implements ServiceProviderInterface 'CommentValidator', 'CurrencyValidator', 'CustomFilterValidator', + 'ExternalLinkValidator', 'GroupValidator', 'LinkValidator', 'PasswordResetValidator', 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/RouteProvider.php b/app/ServiceProvider/RouteProvider.php index dd9ee23b..ebe087ae 100644 --- a/app/ServiceProvider/RouteProvider.php +++ b/app/ServiceProvider/RouteProvider.php @@ -106,11 +106,18 @@ class RouteProvider implements ServiceProviderInterface $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/links', 'tasklink', 'show'); $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/links/external', 'TaskExternalLink', 'show'); + $container['route']->addRoute('project/:project_id/task/:task_id/link/external/new', 'TaskExternalLink', 'find'); + $container['route']->addRoute('project/:project_id/task/:task_id/link/external/save', 'TaskExternalLink', 'create'); + $container['route']->addRoute('project/:project_id/task/:task_id/link/external/:link_id', 'TaskExternalLink', 'edit'); + $container['route']->addRoute('project/:project_id/task/:task_id/link/external/:link_id/remove', 'TaskExternalLink', 'confirm'); + $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'); |