From 14fcf0c8726b5ede34005296e02df7fe3cf9e2b0 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 14 Apr 2016 22:19:27 -0400 Subject: Added some documentation to install Kanboard outside of the docroot --- doc/installation.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'doc') diff --git a/doc/installation.markdown b/doc/installation.markdown index c796ac65..ec1eb650 100644 --- a/doc/installation.markdown +++ b/doc/installation.markdown @@ -34,6 +34,21 @@ You must install [composer](https://getcomposer.org/) to use this method. Note: This method will install the **current development version**, use at your own risk. +Installation outside of the document root +----------------------------------------- + +If you would like to install Kanboard outside of the web server document root, you need to create at least these symlinks: + +```bash +. +├── .htaccess -> ../kanboard/.htaccess +├── assets -> ../kanboard/assets +├── index.php -> ../kanboard/index.php +└── jsonrpc.php -> ../kanboard/jsonrpc.php +``` + +The `.htaccess` is optional because its content can be included directly in the Apache configuration. + Security -------- -- cgit v1.2.3 From ecd27fafa9df61eeb97b379894b66e10cb18972f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 14 Apr 2016 22:29:15 -0400 Subject: Update install documentation --- doc/installation.markdown | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc') diff --git a/doc/installation.markdown b/doc/installation.markdown index ec1eb650..794b8763 100644 --- a/doc/installation.markdown +++ b/doc/installation.markdown @@ -43,12 +43,15 @@ If you would like to install Kanboard outside of the web server document root, y . ├── .htaccess -> ../kanboard/.htaccess ├── assets -> ../kanboard/assets +├── favicon.ico -> ../kanboard/favicon.ico ├── index.php -> ../kanboard/index.php └── jsonrpc.php -> ../kanboard/jsonrpc.php ``` The `.htaccess` is optional because its content can be included directly in the Apache configuration. +You can also define a custom location for the plugins and files folders by changing the [config file](config.markdown). + Security -------- -- cgit v1.2.3 From bc9b5e15aac18eaeb06ee0adfd4969d3492b3b23 Mon Sep 17 00:00:00 2001 From: Olivier Maridat Date: Fri, 15 Apr 2016 13:54:15 +0200 Subject: Add sqlite2mysql script to FAQ --- doc/faq.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/faq.markdown b/doc/faq.markdown index 0a9129f2..fd31158a 100644 --- a/doc/faq.markdown +++ b/doc/faq.markdown @@ -109,6 +109,7 @@ Where can I find a list of related projects? - [Trello import script by @matueranet](https://github.com/matueranet/kanboard-import-trello) - [Chrome extension by Timo](https://chrome.google.com/webstore/detail/kanboard-quickmenu/akjbeplnnihghabpgcfmfhfmifjljneh?utm_source=chrome-ntp-icon), [Source code](https://github.com/BlueTeck/kanboard_chrome_extension) - [Python client script by @dzudek](https://gist.github.com/fguillot/84c70d4928eb1e0cb374) +- [Shell script for SQLite to MySQL/MariaDB migration by @oliviermaridat](https://github.com/oliviermaridat/kanboard-sqlite2mysql) Are there some tutorials about Kanboard in other languages? -- cgit v1.2.3 From bd64a2081ad1a5c953e38c746a9b5d4eecba088b Mon Sep 17 00:00:00 2001 From: Imbasaur Date: Sat, 16 Apr 2016 03:27:06 +0200 Subject: Task summary columns hooks (PR #2126) --- app/Template/task/details.php | 8 ++++++++ doc/plugin-hooks.markdown | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'doc') diff --git a/app/Template/task/details.php b/app/Template/task/details.php index 6093c157..141c4a0b 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -40,6 +40,8 @@
  • + + hook->render('template:task:details:first-column', array('task' => $task)) ?>
    @@ -64,6 +66,8 @@
  • + + hook->render('template:task:details:second-column', array('task' => $task)) ?>
    @@ -102,6 +106,8 @@ + + hook->render('template:task:details:third-column', array('task' => $task)) ?>
    @@ -132,6 +138,8 @@ dt->datetime($task['date_moved']) ?> + + hook->render('template:task:details:fourth-column', array('task' => $task)) ?>
    diff --git a/doc/plugin-hooks.markdown b/doc/plugin-hooks.markdown index a00aba16..15e98043 100644 --- a/doc/plugin-hooks.markdown +++ b/doc/plugin-hooks.markdown @@ -169,6 +169,10 @@ List of template hooks: | `template:project:integrations` | Integration page in projects settings | | `template:project:sidebar` | Sidebar in project settings | | `template:project-user:sidebar` | Sidebar on project user overview page | +| `template:task:details:first-column` | Task summary first column | +| `template:task:details:second-column` | Task summary second column | +| `template:task:details:third-column` | Task summary third column | +| `template:task:details:fourth-column` | Task summary fourth column | | `template:task:dropdown` | Task dropdown menu in listing pages | | `template:task:sidebar` | Sidebar on task page | | `template:task:form:left-column` | Left column in task form | -- cgit v1.2.3 From 53c992d6801918527da90d203697e2f6ea09fe9b Mon Sep 17 00:00:00 2001 From: Olivier Maridat Date: Mon, 18 Apr 2016 19:31:17 +0200 Subject: Add hooks in task sidebar as in user sidebar (#2138) --- app/Template/task/sidebar.php | 6 ++++-- doc/plugin-hooks.markdown | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/app/Template/task/sidebar.php b/app/Template/task/sidebar.php index 773b28dc..a2d73b8c 100644 --- a/app/Template/task/sidebar.php +++ b/app/Template/task/sidebar.php @@ -23,6 +23,8 @@ url->link(t('Time tracking'), 'task', 'timetracking', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> + + hook->render('template:task:sidebar:information', array('task' => $task)) ?> user->hasProjectAccess('taskmodification', 'edit', $task['project_id'])): ?> @@ -91,8 +93,8 @@ url->link(t('Remove'), 'task', 'remove', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'popover') ?> + + hook->render('template:task:sidebar:actions', array('task' => $task)) ?> - - hook->render('template:task:sidebar', array('task' => $task)) ?> diff --git a/doc/plugin-hooks.markdown b/doc/plugin-hooks.markdown index 15e98043..2237e354 100644 --- a/doc/plugin-hooks.markdown +++ b/doc/plugin-hooks.markdown @@ -174,7 +174,8 @@ List of template hooks: | `template:task:details:third-column` | Task summary third column | | `template:task:details:fourth-column` | Task summary fourth column | | `template:task:dropdown` | Task dropdown menu in listing pages | -| `template:task:sidebar` | Sidebar on task page | +| `template:task:sidebar:actions` | Sidebar on task page (section actions) | +| `template:task:sidebar:information` | Sidebar on task page (section information) | | `template:task:form:left-column` | Left column in task form | | `template:task:form:right-column` | Right column in task form | | `template:task:show:top ` | Show task page: top | -- cgit v1.2.3 From 78ffcf9496612dc44b7e6505fa5a16f2089c86ed Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 18 Apr 2016 21:57:23 -0400 Subject: Update doc for CLI --- ChangeLog | 1 + app/Console/BaseCommand.php | 1 + app/Console/TaskOverdueNotificationCommand.php | 7 +++---- doc/cli.markdown | 6 ++++++ 4 files changed, 11 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/ChangeLog b/ChangeLog index 69a9f03e..0daa4b58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ New features: Improvements: +* Added parameters for overdue tasks notifications: group by projects and send only to managers * Allow people to install Kanboard outside of the DocumentRoot * Allow plugins to be loaded from another folder * Filter/Lexer/QueryBuilder refactoring diff --git a/app/Console/BaseCommand.php b/app/Console/BaseCommand.php index 23cdcc9c..4444ceba 100644 --- a/app/Console/BaseCommand.php +++ b/app/Console/BaseCommand.php @@ -25,6 +25,7 @@ use Symfony\Component\Console\Command\Command; * @property \Kanboard\Model\User $user * @property \Kanboard\Model\UserNotification $userNotification * @property \Kanboard\Model\UserNotificationFilter $userNotificationFilter + * @property \Kanboard\Model\ProjectUserRole $projectUserRole * @property \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher */ abstract class BaseCommand extends Command diff --git a/app/Console/TaskOverdueNotificationCommand.php b/app/Console/TaskOverdueNotificationCommand.php index 894e4402..7e8484c8 100644 --- a/app/Console/TaskOverdueNotificationCommand.php +++ b/app/Console/TaskOverdueNotificationCommand.php @@ -4,7 +4,6 @@ namespace Kanboard\Console; use Kanboard\Model\Task; use Kanboard\Core\Security\Role; -use Kanboard\Model\ProjectUserRole; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -24,7 +23,7 @@ class TaskOverdueNotificationCommand extends BaseCommand protected function execute(InputInterface $input, OutputInterface $output) { - if($input->getOption('group')) { + if ($input->getOption('group')) { $tasks = $this->sendGroupOverdueTaskNotifications(); } elseif ($input->getOption('manager')) { $tasks = $this->sendOverdueTaskNotificationsToManagers(); @@ -90,8 +89,8 @@ class TaskOverdueNotificationCommand extends BaseCommand foreach ($this->groupByColumn($tasks, 'project_id') as $project_id => $project_tasks) { $users = $this->userNotification->getUsersWithNotificationEnabled($project_id); - $managers = array(); + foreach ($users as $user) { $role = $this->projectUserRole->getUserRole($project_id, $user['id']); if($role == Role::PROJECT_MANAGER) { @@ -159,7 +158,7 @@ class TaskOverdueNotificationCommand extends BaseCommand * Send overdue tasks for a project manager(s) * * @access public - * @param array $user + * @param array $manager * @param array $tasks */ public function sendUserOverdueTaskNotificationsToManagers(array $manager, array $tasks) diff --git a/doc/cli.markdown b/doc/cli.markdown index d38d8b53..20e3566a 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -119,6 +119,12 @@ Emails will be sent to all users with notifications enabled. ./kanboard notification:overdue-tasks ``` +Optional parameters: + +- `--show`: Display notifications sent +- `--group`: Group all overdue tasks for one user (from all projects) in one email +- `--manager`: Send all overdue tasks to project manager(s) in one email + You can also display the overdue tasks with the flag `--show`: ```bash -- cgit v1.2.3 From 0052a41a24a9d23e6bc2501b43e8f10188f0fef2 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 18 Apr 2016 22:01:09 -0400 Subject: Update installation documentation --- doc/installation.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/installation.markdown b/doc/installation.markdown index 794b8763..d2484f0b 100644 --- a/doc/installation.markdown +++ b/doc/installation.markdown @@ -41,11 +41,12 @@ If you would like to install Kanboard outside of the web server document root, y ```bash . -├── .htaccess -> ../kanboard/.htaccess ├── assets -> ../kanboard/assets +├── doc -> ../kanboard/doc ├── favicon.ico -> ../kanboard/favicon.ico ├── index.php -> ../kanboard/index.php -└── jsonrpc.php -> ../kanboard/jsonrpc.php +├── jsonrpc.php -> ../kanboard/jsonrpc.php +└── robots.txt -> ../kanboard/robots.txt ``` The `.htaccess` is optional because its content can be included directly in the Apache configuration. -- cgit v1.2.3 From aea8784ab5f60a39551e03d04619a043b60205b2 Mon Sep 17 00:00:00 2001 From: yeouchien Date: Tue, 19 Apr 2016 21:20:37 +0800 Subject: Added Nitrous.io quickstart configs and update doc (#2136) --- doc/index.markdown | 1 + doc/nitrous.markdown | 10 ++++++++++ nitrous-post-create.sh | 14 ++++++++++++++ nitrous.json | 6 ++++++ 4 files changed, 31 insertions(+) create mode 100644 doc/nitrous.markdown create mode 100755 nitrous-post-create.sh create mode 100644 nitrous.json (limited to 'doc') diff --git a/doc/index.markdown b/doc/index.markdown index 727f116d..30083fa9 100644 --- a/doc/index.markdown +++ b/doc/index.markdown @@ -101,6 +101,7 @@ Technical details - [Run Kanboard with Docker](docker.markdown) - [Run Kanboard with Vagrant](vagrant.markdown) - [Run Kanboard on Cloudron](cloudron.markdown) +- [Run Kanboard on Nitrous](nitrous.markdown) ### Configuration diff --git a/doc/nitrous.markdown b/doc/nitrous.markdown new file mode 100644 index 00000000..daaedcef --- /dev/null +++ b/doc/nitrous.markdown @@ -0,0 +1,10 @@ +Nitrous Quickstart +================== + +Create a free development environment for this Kanboard project in the cloud on [Nitrous.io](https://www.nitrous.io) by clicking the button below. + + + Nitrous Quickstart + + +Simply access your site via the `Preview > 3000` link in the IDE. diff --git a/nitrous-post-create.sh b/nitrous-post-create.sh new file mode 100755 index 00000000..558cc753 --- /dev/null +++ b/nitrous-post-create.sh @@ -0,0 +1,14 @@ +#!/bin/bash +rm -rf ~/code/public_html + +sudo apt-get update +sudo apt-get install -y php5-sqlite +sudo apt-get clean + +cd ~/code +mv kanboard public_html +cd public_html +composer install +cd ~/code +sudo chown -R nitrous:www-data public_html +sudo service apache2 reload diff --git a/nitrous.json b/nitrous.json new file mode 100644 index 00000000..1cf4ab67 --- /dev/null +++ b/nitrous.json @@ -0,0 +1,6 @@ +{ + "template": "php-apache", + "ports": [3000], + "name": "Kanboard", + "description": "Kanban project management software" +} -- cgit v1.2.3 From 60e0753b90838120510861ebc674f826140b31de Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 21 Apr 2016 21:10:04 -0400 Subject: Added API procedure "getMemberGroups" --- ChangeLog | 1 + app/Api/GroupMember.php | 5 +++++ app/Model/GroupMember.php | 17 +++++++++++++++ doc/api-group-member-procedures.markdown | 36 ++++++++++++++++++++++++++++++++ tests/integration/GroupMemberTest.php | 8 +++++++ tests/units/Model/GroupMemberTest.php | 30 ++++++++++++++++++++++++++ 6 files changed, 97 insertions(+) (limited to 'doc') diff --git a/ChangeLog b/ChangeLog index 0daa4b58..15d35b85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ New features: Improvements: +* Added API procedure "getMemberGroups" * Added parameters for overdue tasks notifications: group by projects and send only to managers * Allow people to install Kanboard outside of the DocumentRoot * Allow plugins to be loaded from another folder diff --git a/app/Api/GroupMember.php b/app/Api/GroupMember.php index de62f0c6..9d2a4796 100644 --- a/app/Api/GroupMember.php +++ b/app/Api/GroupMember.php @@ -10,6 +10,11 @@ namespace Kanboard\Api; */ class GroupMember extends \Kanboard\Core\Base { + public function getMemberGroups($user_id) + { + return $this->groupMember->getGroups($user_id); + } + public function getGroupMembers($group_id) { return $this->groupMember->getMembers($group_id); diff --git a/app/Model/GroupMember.php b/app/Model/GroupMember.php index 7ed5f733..14041704 100644 --- a/app/Model/GroupMember.php +++ b/app/Model/GroupMember.php @@ -108,4 +108,21 @@ class GroupMember extends Base ->eq('user_id', $user_id) ->exists(); } + + /** + * Get all groups for a given user + * + * @access public + * @param integer $user_id + * @return array + */ + public function getGroups($user_id) + { + return $this->db->table(self::TABLE) + ->columns(Group::TABLE.'.id', Group::TABLE.'.name') + ->join(Group::TABLE, 'id', 'group_id') + ->eq(self::TABLE.'.user_id', $user_id) + ->asc(Group::TABLE.'.name') + ->findAll(); + } } diff --git a/doc/api-group-member-procedures.markdown b/doc/api-group-member-procedures.markdown index c4889265..1065ba11 100644 --- a/doc/api-group-member-procedures.markdown +++ b/doc/api-group-member-procedures.markdown @@ -1,6 +1,42 @@ Group Member API Procedures =========================== +## getMemberGroups + +- Purpose: **Get all groups for a given user** +- Parameters: + - **user_id** (integer, required) +- Result on success: **List of groups** +- Result on failure: **false** + +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "getMemberGroups", + "id": 1987176726, + "params": [ + "1" + ] +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 1987176726, + "result": [ + { + "id": "1", + "name": "My Group A" + } + ] +} +``` + ## getGroupMembers - Purpose: **Get all members of a group** diff --git a/tests/integration/GroupMemberTest.php b/tests/integration/GroupMemberTest.php index e84c0734..d49945b5 100644 --- a/tests/integration/GroupMemberTest.php +++ b/tests/integration/GroupMemberTest.php @@ -30,6 +30,14 @@ class GroupMemberTest extends Base $this->assertFalse($this->app->isGroupMember($groupId, 2)); } + public function testGetGroups() + { + $groups = $this->app->getMemberGroups(1); + $this->assertCount(1, $groups); + $this->assertEquals(1, $groups[0]['id']); + $this->assertEquals('My Group A', $groups[0]['name']); + } + public function testRemove() { $groupId = $this->getGroupId(); diff --git a/tests/units/Model/GroupMemberTest.php b/tests/units/Model/GroupMemberTest.php index 16f769e8..0ff9fdf6 100644 --- a/tests/units/Model/GroupMemberTest.php +++ b/tests/units/Model/GroupMemberTest.php @@ -72,5 +72,35 @@ class GroupMemberTest extends Base $this->assertCount(2, $users); $this->assertEquals('admin', $users[0]['username']); $this->assertEquals('user1', $users[1]['username']); + + $groups = $groupMemberModel->getGroups(1); + $this->assertCount(1, $groups); + $this->assertEquals(1, $groups[0]['id']); + $this->assertEquals('Group A', $groups[0]['name']); + + $groups = $groupMemberModel->getGroups(2); + $this->assertCount(1, $groups); + $this->assertEquals(1, $groups[0]['id']); + $this->assertEquals('Group A', $groups[0]['name']); + + $groups = $groupMemberModel->getGroups(3); + $this->assertCount(1, $groups); + $this->assertEquals(2, $groups[0]['id']); + $this->assertEquals('Group B', $groups[0]['name']); + + $groups = $groupMemberModel->getGroups(4); + $this->assertCount(1, $groups); + $this->assertEquals(2, $groups[0]['id']); + $this->assertEquals('Group B', $groups[0]['name']); + + $groups = $groupMemberModel->getGroups(5); + $this->assertCount(2, $groups); + $this->assertEquals(1, $groups[0]['id']); + $this->assertEquals('Group A', $groups[0]['name']); + $this->assertEquals(2, $groups[1]['id']); + $this->assertEquals('Group B', $groups[1]['name']); + + $groups = $groupMemberModel->getGroups(6); + $this->assertCount(0, $groups); } } -- cgit v1.2.3 From 756716766cb33da2c25544918574368b51cca26e Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Thu, 21 Apr 2016 21:21:34 -0400 Subject: Added priority field to API procedures --- ChangeLog | 1 + app/Api/Task.php | 6 ++++-- doc/api-task-procedures.markdown | 2 ++ tests/integration/TaskTest.php | 16 ++++++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/ChangeLog b/ChangeLog index 15d35b85..99ddca45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ New features: Improvements: +* Added priority field to API procedures * Added API procedure "getMemberGroups" * Added parameters for overdue tasks notifications: group by projects and send only to managers * Allow people to install Kanboard outside of the DocumentRoot diff --git a/app/Api/Task.php b/app/Api/Task.php index 177a09c6..202e9bb5 100644 --- a/app/Api/Task.php +++ b/app/Api/Task.php @@ -75,7 +75,7 @@ class Task extends Base } public function createTask($title, $project_id, $color_id = '', $column_id = 0, $owner_id = 0, $creator_id = 0, - $date_due = '', $description = '', $category_id = 0, $score = 0, $swimlane_id = 0, + $date_due = '', $description = '', $category_id = 0, $score = 0, $swimlane_id = 0, $priority = 0, $recurrence_status = 0, $recurrence_trigger = 0, $recurrence_factor = 0, $recurrence_timeframe = 0, $recurrence_basedate = 0, $reference = '') { @@ -107,6 +107,7 @@ class Task extends Base 'recurrence_timeframe' => $recurrence_timeframe, 'recurrence_basedate' => $recurrence_basedate, 'reference' => $reference, + 'priority' => $priority, ); list($valid, ) = $this->taskValidator->validateCreation($values); @@ -115,7 +116,7 @@ class Task extends Base } public function updateTask($id, $title = null, $color_id = null, $owner_id = null, - $date_due = null, $description = null, $category_id = null, $score = null, + $date_due = null, $description = null, $category_id = null, $score = null, $priority = null, $recurrence_status = null, $recurrence_trigger = null, $recurrence_factor = null, $recurrence_timeframe = null, $recurrence_basedate = null, $reference = null) { @@ -146,6 +147,7 @@ class Task extends Base 'recurrence_timeframe' => $recurrence_timeframe, 'recurrence_basedate' => $recurrence_basedate, 'reference' => $reference, + 'priority' => $priority, ); foreach ($values as $key => $value) { diff --git a/doc/api-task-procedures.markdown b/doc/api-task-procedures.markdown index 486c0a09..d994d662 100644 --- a/doc/api-task-procedures.markdown +++ b/doc/api-task-procedures.markdown @@ -16,6 +16,7 @@ API Task Procedures - **category_id** (integer, optional) - **score** (integer, optional) - **swimlane_id** (integer, optional) + - **priority** (integer, optional) - **recurrence_status** (integer, optional) - **recurrence_trigger** (integer, optional) - **recurrence_factor** (integer, optional) @@ -398,6 +399,7 @@ Response example: - **description** Markdown content (string, optional) - **category_id** (integer, optional) - **score** (integer, optional) + - **priority** (integer, optional) - **recurrence_status** (integer, optional) - **recurrence_trigger** (integer, optional) - **recurrence_factor** (integer, optional) diff --git a/tests/integration/TaskTest.php b/tests/integration/TaskTest.php index 6d500da4..39fe41bf 100644 --- a/tests/integration/TaskTest.php +++ b/tests/integration/TaskTest.php @@ -4,6 +4,22 @@ require_once __DIR__.'/Base.php'; class TaskTest extends Base { + public function testPriorityAttribute() + { + $project_id = $this->app->createProject('My project'); + $this->assertNotFalse($project_id); + + $task_id = $this->app->createTask(array('project_id' => $project_id, 'title' => 'My task', 'priority' => 2)); + + $task = $this->app->getTask($task_id); + $this->assertEquals(2, $task['priority']); + + $this->assertTrue($this->app->updateTask(array('id' => $task_id, 'project_id' => $project_id, 'priority' => 3))); + + $task = $this->app->getTask($task_id); + $this->assertEquals(3, $task['priority']); + } + public function testChangeAssigneeToAssignableUser() { $project_id = $this->app->createProject('My project'); -- cgit v1.2.3 From da1725c225c94bcdffe4dba4c068db8e1e11cbe7 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Fri, 22 Apr 2016 18:49:19 -0400 Subject: Added searchTasks API procedure --- ChangeLog | 1 + app/Api/Base.php | 1 + app/Api/Task.php | 7 +++++ doc/api-task-procedures.markdown | 59 ++++++++++++++++++++++++++++++++++++++++ tests/integration/TaskTest.php | 20 ++++++++++++++ 5 files changed, 88 insertions(+) (limited to 'doc') diff --git a/ChangeLog b/ChangeLog index 99ddca45..898d2b00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ New features: Improvements: +* Added tasks search with the API * Added priority field to API procedures * Added API procedure "getMemberGroups" * Added parameters for overdue tasks notifications: group by projects and send only to managers diff --git a/app/Api/Base.php b/app/Api/Base.php index 0959817e..2cc62da8 100644 --- a/app/Api/Base.php +++ b/app/Api/Base.php @@ -40,6 +40,7 @@ abstract class Base extends \Kanboard\Core\Base 'getBoard', 'getProjectActivity', 'getOverdueTasksByProject', + 'searchTasks', ); public function checkProcedurePermission($is_user, $procedure) diff --git a/app/Api/Task.php b/app/Api/Task.php index 202e9bb5..1d1211f2 100644 --- a/app/Api/Task.php +++ b/app/Api/Task.php @@ -2,6 +2,7 @@ namespace Kanboard\Api; +use Kanboard\Filter\TaskProjectFilter; use Kanboard\Model\Task as TaskModel; /** @@ -12,6 +13,12 @@ use Kanboard\Model\Task as TaskModel; */ class Task extends Base { + public function searchTasks($project_id, $query) + { + $this->checkProjectPermission($project_id); + return $this->taskLexer->build($query)->withFilter(new TaskProjectFilter($project_id))->toArray(); + } + public function getTask($task_id) { $this->checkTaskPermission($task_id); diff --git a/doc/api-task-procedures.markdown b/doc/api-task-procedures.markdown index d994d662..934b1e09 100644 --- a/doc/api-task-procedures.markdown +++ b/doc/api-task-procedures.markdown @@ -636,3 +636,62 @@ Response example: "result": 6 } ``` + +## searchTasks + +- Purpose: **Find tasks by using the search engine** +- Parameters: + - **project_id** (integer, required) + - **query** (string, required) +- Result on success: **list of tasks** +- Result on failure: **false** + +Request example: + +```json +{ + "jsonrpc": "2.0", + "method": "searchTasks", + "id": 1468511716, + "params": { + "project_id": 2, + "query": "assignee:nobody" + } +} +``` + +Response example: + +```json +{ + "jsonrpc": "2.0", + "id": 1468511716, + "result": [ + { + "nb_comments": "0", + "nb_files": "0", + "nb_subtasks": "0", + "nb_completed_subtasks": "0", + "nb_links": "0", + "nb_external_links": "0", + "is_milestone": null, + "id": "3", + "reference": "", + "title": "T3", + "description": "", + "date_creation": "1461365164", + "date_modification": "1461365164", + "date_completed": null, + "date_started": null, + "date_due": "0", + "color_id": "yellow", + "project_id": "2", + "column_id": "5", + "swimlane_id": "0", + "owner_id": "0", + "creator_id": "0" + // ... + } + ] +} +``` diff --git a/tests/integration/TaskTest.php b/tests/integration/TaskTest.php index 39fe41bf..0c398761 100644 --- a/tests/integration/TaskTest.php +++ b/tests/integration/TaskTest.php @@ -4,6 +4,26 @@ require_once __DIR__.'/Base.php'; class TaskTest extends Base { + public function testSearchTasks() + { + $project_id1 = $this->app->createProject('My project'); + $project_id2 = $this->app->createProject('My project'); + $this->assertNotFalse($project_id1); + $this->assertNotFalse($project_id2); + + $this->assertNotFalse($this->app->createTask(array('project_id' => $project_id1, 'title' => 'T1'))); + $this->assertNotFalse($this->app->createTask(array('project_id' => $project_id1, 'title' => 'T2'))); + $this->assertNotFalse($this->app->createTask(array('project_id' => $project_id2, 'title' => 'T3'))); + + $tasks = $this->app->searchTasks($project_id1, 't2'); + $this->assertCount(1, $tasks); + $this->assertEquals('T2', $tasks[0]['title']); + + $tasks = $this->app->searchTasks(array('project_id' => $project_id2, 'query' => 'assignee:nobody')); + $this->assertCount(1, $tasks); + $this->assertEquals('T3', $tasks[0]['title']); + } + public function testPriorityAttribute() { $project_id = $this->app->createProject('My project'); -- cgit v1.2.3 From 51ec4b4cf86c7f4a7552f8e01cee704cc6b4b57b Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 24 Apr 2016 16:47:06 -0400 Subject: Added external project link to the list (Git hooks) --- doc/faq.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/faq.markdown b/doc/faq.markdown index fd31158a..8e8dab63 100644 --- a/doc/faq.markdown +++ b/doc/faq.markdown @@ -110,6 +110,7 @@ Where can I find a list of related projects? - [Chrome extension by Timo](https://chrome.google.com/webstore/detail/kanboard-quickmenu/akjbeplnnihghabpgcfmfhfmifjljneh?utm_source=chrome-ntp-icon), [Source code](https://github.com/BlueTeck/kanboard_chrome_extension) - [Python client script by @dzudek](https://gist.github.com/fguillot/84c70d4928eb1e0cb374) - [Shell script for SQLite to MySQL/MariaDB migration by @oliviermaridat](https://github.com/oliviermaridat/kanboard-sqlite2mysql) +- [Git hooks for integration with Kanboard by Gene Pavlovsky](https://github.com/gene-pavlovsky/kanboard-git-hooks) Are there some tutorials about Kanboard in other languages? -- cgit v1.2.3 From f74d7ef209701bba905c0179b30f24a6e3faa5db Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 24 Apr 2016 17:03:09 -0400 Subject: Added more template hooks --- ChangeLog | 1 + app/Template/task/details.php | 4 ++++ app/Template/task/dropdown.php | 2 +- app/Template/task/layout.php | 3 ++- app/Template/task/show.php | 2 +- app/Template/task_creation/form.php | 4 ++-- app/Template/task_modification/edit_task.php | 6 +++++- doc/plugin-hooks.markdown | 5 ++++- 8 files changed, 20 insertions(+), 7 deletions(-) (limited to 'doc') diff --git a/ChangeLog b/ChangeLog index 898d2b00..be44bc3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ New features: Improvements: +* Added more template hooks * Added tasks search with the API * Added priority field to API procedures * Added API procedure "getMemberGroups" diff --git a/app/Template/task/details.php b/app/Template/task/details.php index 141c4a0b..5b8b7c6d 100644 --- a/app/Template/task/details.php +++ b/app/Template/task/details.php @@ -1,6 +1,8 @@

    text->e($task['title']) ?>

    + hook->render('template:task:details:top', array('task' => $task)) ?> +
      @@ -149,4 +151,6 @@ url->button('fa-play', t('Set start date'), 'taskmodification', 'start', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
    + + hook->render('template:task:details:bottom', array('task' => $task)) ?>
    diff --git a/app/Template/task/dropdown.php b/app/Template/task/dropdown.php index f98f5172..6fea3728 100644 --- a/app/Template/task/dropdown.php +++ b/app/Template/task/dropdown.php @@ -55,6 +55,6 @@ - hook->render('template:task:dropdown') ?> + hook->render('template:task:dropdown', array('task' => $task)) ?> diff --git a/app/Template/task/layout.php b/app/Template/task/layout.php index 52db5d1b..ba2cd8d5 100644 --- a/app/Template/task/layout.php +++ b/app/Template/task/layout.php @@ -1,5 +1,6 @@
    projectHeader->render($project, 'Listing', 'show') ?> + hook->render('template:task:layout:top', array('task' => $task)) ?> -
    \ No newline at end of file + diff --git a/app/Template/task/show.php b/app/Template/task/show.php index 86422941..8f41d653 100644 --- a/app/Template/task/show.php +++ b/app/Template/task/show.php @@ -34,7 +34,7 @@ 'project' => $project, )) ?> -hook->render('template:task:show:before-attachements', array('task' => $task, 'project' => $project)) ?> +hook->render('template:task:show:before-attachments', array('task' => $task, 'project' => $project)) ?> render('task_file/show', array( 'task' => $task, 'files' => $files, diff --git a/app/Template/task_creation/form.php b/app/Template/task_creation/form.php index 9bfd839f..c963bdcf 100644 --- a/app/Template/task_creation/form.php +++ b/app/Template/task_creation/form.php @@ -29,7 +29,7 @@ form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> - hook->render('template:task:form:left-column', array('values'=>$values, 'errors'=>$errors)) ?> + hook->render('template:task:form:left-column', array('values' => $values, 'errors' => $errors)) ?>
    @@ -43,7 +43,7 @@ task->selectTimeEstimated($values, $errors) ?> task->selectDueDate($values, $errors) ?> - hook->render('template:task:form:right-column', array('values'=>$values, 'errors'=>$errors)) ?> + hook->render('template:task:form:right-column', array('values' => $values, 'errors' => $errors)) ?>
    diff --git a/app/Template/task_modification/edit_task.php b/app/Template/task_modification/edit_task.php index b5891c15..5ddec5ea 100644 --- a/app/Template/task_modification/edit_task.php +++ b/app/Template/task_modification/edit_task.php @@ -14,6 +14,8 @@ task->selectCategory($categories_list, $values, $errors) ?> task->selectPriority($project, $values) ?> task->selectScore($values, $errors) ?> + + hook->render('template:task:form:left-column', array('values' => $values, 'errors' => $errors)) ?>
    @@ -21,6 +23,8 @@ task->selectTimeSpent($values, $errors) ?> task->selectStartDate($values, $errors) ?> task->selectDueDate($values, $errors) ?> + + hook->render('template:task:form:right-column', array('values' => $values, 'errors' => $errors)) ?>
    @@ -32,4 +36,4 @@ url->link(t('cancel'), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, 'close-popover') ?>
    - \ No newline at end of file + diff --git a/doc/plugin-hooks.markdown b/doc/plugin-hooks.markdown index 2237e354..f6760f96 100644 --- a/doc/plugin-hooks.markdown +++ b/doc/plugin-hooks.markdown @@ -169,6 +169,9 @@ List of template hooks: | `template:project:integrations` | Integration page in projects settings | | `template:project:sidebar` | Sidebar in project settings | | `template:project-user:sidebar` | Sidebar on project user overview page | +| `template:task:layout:top` | Task layout top (after page header) | +| `template:task:details:top` | Task summary top | +| `template:task:details:bottom` | Task summary bottom | | `template:task:details:first-column` | Task summary first column | | `template:task:details:second-column` | Task summary second column | | `template:task:details:third-column` | Task summary third column | @@ -184,7 +187,7 @@ List of template hooks: | `template:task:show:before-tasklinks` | Show task page: before tasklinks | | `template:task:show:before-subtasks` | Show task page: before subtasks | | `template:task:show:before-timetracking` | Show task page: before timetracking | -| `template:task:show:before-attachements` | Show task page: before attachments | +| `template:task:show:before-attachments` | Show task page: before attachments | | `template:task:show:before-comments` | Show task page: before comments | | `template:user:authentication:form` | "Edit authentication" form in user profile | | `template:user:create-remote:form` | "Create remote user" form | -- cgit v1.2.3 From 5fe413ad28790406c0acfabc0fcc256d051aa76a Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 26 Apr 2016 23:01:50 -0400 Subject: Added workaround in documentation for API and Apache+php-fpm --- doc/faq.markdown | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc') diff --git a/doc/faq.markdown b/doc/faq.markdown index 8e8dab63..879b070f 100644 --- a/doc/faq.markdown +++ b/doc/faq.markdown @@ -49,6 +49,18 @@ php_value arg_separator.output "&" Otherwise Kanboard will try to override the value directly in PHP. +Authentication failure with the API and Apache + PHP-FPM +-------------------------------------------------------- + +php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default. +For this workaround to work, add these lines to your `.htaccess` file: + +``` +RewriteCond %{HTTP:Authorization} ^(.+)$ +RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] +``` + + Known issues with eAccelerator ------------------------------ -- cgit v1.2.3