Add documentation for metadata
This commit is contained in:
@@ -10,14 +10,14 @@ Breaking changes:
|
|||||||
New features:
|
New features:
|
||||||
|
|
||||||
* Add CSV import for users and tasks
|
* Add CSV import for users and tasks
|
||||||
|
* Add Task, User and Project metadata for plugin creators
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
* Allow to change comments sorting
|
* Allow to change comments sorting
|
||||||
* Add the possibility to append or not custom filters
|
* Add the possibility to append or not custom filters
|
||||||
* Make mail transports pluggable
|
* Make mail transports pluggable
|
||||||
* Add Task, User and Project metadata for plugin creators
|
* Do not show scroll-bars when a column is collapsed on Windows systems
|
||||||
* Do not show scroll-bars when a column is collapsed (IE)
|
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
|
|||||||
38
doc/plugin-metadata.markdown
Normal file
38
doc/plugin-metadata.markdown
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
Metadata
|
||||||
|
========
|
||||||
|
|
||||||
|
You can attach metadata for each project, task and user.
|
||||||
|
Metadata are custom fields, it's a key/value table.
|
||||||
|
|
||||||
|
By example your plugin can store external information for a task or new settings for a project.
|
||||||
|
Basically that allow you to exend the default fields without having to create new tables.
|
||||||
|
|
||||||
|
Attach metadata to tasks
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
```php
|
||||||
|
|
||||||
|
// Return a dictionary of metadata (keys/values) for the $task_id
|
||||||
|
$this->taskMetadata->getAll($task_id);
|
||||||
|
|
||||||
|
// Get a value only for a task
|
||||||
|
$this->taskMetadata->get($task_id, 'my_plugin_variable', 'default_value');
|
||||||
|
|
||||||
|
// Return true if the metadata my_plugin_variable exists
|
||||||
|
$this->taskMetadata->exists($task_id, 'my_plugin_variable');
|
||||||
|
|
||||||
|
// Create or update metadata for the task
|
||||||
|
$this->taskMetadata->save($task_id, ['my_plugin_variable' => 'something']);
|
||||||
|
```
|
||||||
|
|
||||||
|
Metadata types
|
||||||
|
--------------
|
||||||
|
|
||||||
|
- TaskMetadata: `$this->taskMetadata`
|
||||||
|
- ProjectMetadata: `$this->projectMetadata`
|
||||||
|
- UserMetadata: `$this->userMetadata`
|
||||||
|
|
||||||
|
Notes
|
||||||
|
-----
|
||||||
|
|
||||||
|
- Always prefix the metadata name with your plugin name
|
||||||
@@ -13,6 +13,7 @@ Plugin creators should specify explicitly the compatible versions of Kanboard. I
|
|||||||
- [Add schema migrations for plugins](plugin-schema-migrations.markdown)
|
- [Add schema migrations for plugins](plugin-schema-migrations.markdown)
|
||||||
- [Add mail transports](plugin-mail-transports.markdown)
|
- [Add mail transports](plugin-mail-transports.markdown)
|
||||||
- [Add notification types](plugin-notifications.markdown)
|
- [Add notification types](plugin-notifications.markdown)
|
||||||
|
- [Attach metadata to users, tasks and projects](plugin-metadata.markdown)
|
||||||
|
|
||||||
Examples of plugins
|
Examples of plugins
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user