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 | |
parent | 2615a19c0d8d226cb809233a20c8c295f0a355e2 (diff) |
Default for task assignee field is now logged-in user ID - fixes #111
Diffstat (limited to 'plugins/DefaultSelfAssign')
-rw-r--r-- | plugins/DefaultSelfAssign/.gitignore | 1 | ||||
-rw-r--r-- | plugins/DefaultSelfAssign/.travis.yml | 35 | ||||
-rw-r--r-- | plugins/DefaultSelfAssign/LICENSE | 21 | ||||
-rw-r--r-- | plugins/DefaultSelfAssign/Makefile | 5 | ||||
-rw-r--r-- | plugins/DefaultSelfAssign/Plugin.php | 51 | ||||
-rw-r--r-- | plugins/DefaultSelfAssign/README.md | 31 |
6 files changed, 144 insertions, 0 deletions
diff --git a/plugins/DefaultSelfAssign/.gitignore b/plugins/DefaultSelfAssign/.gitignore new file mode 100644 index 00000000..c4c4ffc6 --- /dev/null +++ b/plugins/DefaultSelfAssign/.gitignore @@ -0,0 +1 @@ +*.zip diff --git a/plugins/DefaultSelfAssign/.travis.yml b/plugins/DefaultSelfAssign/.travis.yml new file mode 100644 index 00000000..9753d0b6 --- /dev/null +++ b/plugins/DefaultSelfAssign/.travis.yml @@ -0,0 +1,35 @@ +language: php +sudo: false + +php: + - 7.1 + - 7.0 + - 5.6 + - 5.5 + - 5.4 + - 5.3 + +env: + global: + - PLUGIN=InternalID + - KANBOARD_REPO=https://github.com/kanboard/kanboard.git + matrix: + - DB=sqlite + - DB=mysql + - DB=postgres + +matrix: + fast_finish: true + +install: + - git clone --depth 1 $KANBOARD_REPO + - ln -s $TRAVIS_BUILD_DIR kanboard/plugins/$PLUGIN + +before_script: + - cd kanboard + - phpenv config-add tests/php.ini + - composer install + - ls -la plugins/ + +script: + - phpunit -c tests/units.$DB.xml plugins/$PLUGIN/Test/ diff --git a/plugins/DefaultSelfAssign/LICENSE b/plugins/DefaultSelfAssign/LICENSE new file mode 100644 index 00000000..f26a989e --- /dev/null +++ b/plugins/DefaultSelfAssign/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 mkl + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/DefaultSelfAssign/Makefile b/plugins/DefaultSelfAssign/Makefile new file mode 100644 index 00000000..1f307581 --- /dev/null +++ b/plugins/DefaultSelfAssign/Makefile @@ -0,0 +1,5 @@ +plugin=InternalID + +all: + @ echo "Build archive for plugin ${plugin} version=${version}" + @ git archive HEAD --prefix=${plugin}/ --format=zip -o ${plugin}-${version}.zip 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(); + } +} diff --git a/plugins/DefaultSelfAssign/README.md b/plugins/DefaultSelfAssign/README.md new file mode 100644 index 00000000..44a9b786 --- /dev/null +++ b/plugins/DefaultSelfAssign/README.md @@ -0,0 +1,31 @@ +DefaultSelfAssign +============================== + +Self-assign tasks by default + +Author +------ + +- mkl +- License MIT + +Requirements +------------ + +- Kanboard >= 1.0.35 + +Installation +------------ + +You have the choice between 3 methods: + +1. Install the plugin from the Kanboard plugin manager in one click +2. Download the zip file and decompress everything under the directory `plugins/DefaultSelfAssign` +3. Clone this repository into the folder `plugins/DefaultSelfAssign` + +Note: Plugin folder is case-sensitive. + +Documentation +------------- + +TODO. |