diff options
author | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2020-01-15 17:07:50 +0100 |
---|---|---|
committer | Dzial Techniczny WMW Projekt s.c <techniczna@wmwprojekt.pl> | 2020-01-15 17:11:09 +0100 |
commit | c08e22f927313f94f344c807876688cc192190d5 (patch) | |
tree | 89377c49498a67b22090ba7097953102d0f4214a /plugins/DefaultSelfAssign/Plugin.php | |
parent | 2615a19c0d8d226cb809233a20c8c295f0a355e2 (diff) |
Default for task assignee field is now logged-in user ID - fixes #111
Diffstat (limited to 'plugins/DefaultSelfAssign/Plugin.php')
-rw-r--r-- | plugins/DefaultSelfAssign/Plugin.php | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/DefaultSelfAssign/Plugin.php b/plugins/DefaultSelfAssign/Plugin.php new file mode 100644 index 00000000..48a966d3 --- /dev/null +++ b/plugins/DefaultSelfAssign/Plugin.php @@ -0,0 +1,51 @@ +<?php + +namespace Kanboard\Plugin\DefaultSelfAssign; + +use Kanboard\Core\Plugin\Base; +use Kanboard\Core\Translator; + +class Plugin extends Base +{ + public function initialize() + { + $container = $this; + $this->hook->on('controller:task-creation:form:default', function($values) use($container) { + $user = $container->userSession->getId(); + return array('owner_id' => $user); + }); + } + + public function onStartup() + { + } + + public function getPluginName() + { + return 'DefaultSelfAssign'; + } + + public function getPluginDescription() + { + return 'Self-assign tasks by default'; + } + + public function getPluginAuthor() + { + return 'mkl'; + } + + public function getPluginVersion() + { + return '1.0.0'; + } + + public function getPluginHomepage() + { + return 'https://kanban.intranet/'; + } + + public function getClasses() { + return array(); + } +} |