From c08e22f927313f94f344c807876688cc192190d5 Mon Sep 17 00:00:00 2001 From: "Dzial Techniczny WMW Projekt s.c" Date: Wed, 15 Jan 2020 17:07:50 +0100 Subject: Default for task assignee field is now logged-in user ID - fixes #111 --- plugins/DefaultSelfAssign/.gitignore | 1 + plugins/DefaultSelfAssign/.travis.yml | 35 ++++++++++++++++++++++++ plugins/DefaultSelfAssign/LICENSE | 21 +++++++++++++++ plugins/DefaultSelfAssign/Makefile | 5 ++++ plugins/DefaultSelfAssign/Plugin.php | 51 +++++++++++++++++++++++++++++++++++ plugins/DefaultSelfAssign/README.md | 31 +++++++++++++++++++++ 6 files changed, 144 insertions(+) create mode 100644 plugins/DefaultSelfAssign/.gitignore create mode 100644 plugins/DefaultSelfAssign/.travis.yml create mode 100644 plugins/DefaultSelfAssign/LICENSE create mode 100644 plugins/DefaultSelfAssign/Makefile create mode 100644 plugins/DefaultSelfAssign/Plugin.php create mode 100644 plugins/DefaultSelfAssign/README.md 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 @@ +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. -- cgit v1.2.3