Bulk Move Tasks done v0.2
This commit is contained in:
1
Asset/css/skeleton.css
vendored
1
Asset/css/skeleton.css
vendored
@@ -1 +0,0 @@
|
|||||||
/* Skeleton plugin styles -- add CSS here. Loaded via template:layout:css. */
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
// Skeleton plugin script -- add JS here. Loaded via template:layout:js.
|
|
||||||
25
Plugin.php
25
Plugin.php
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Kanboard\Plugin\Skeleton;
|
namespace Kanboard\Plugin\BulkMoveTasks;
|
||||||
|
|
||||||
use Kanboard\Core\Plugin\Base;
|
use Kanboard\Core\Plugin\Base;
|
||||||
|
|
||||||
@@ -8,28 +8,19 @@ class Plugin extends Base
|
|||||||
{
|
{
|
||||||
public function initialize()
|
public function initialize()
|
||||||
{
|
{
|
||||||
// 1. Render a visible word at the top of every page (the demo output).
|
// Add a "Move all tasks to another column" entry to the board column
|
||||||
$this->template->hook->attach('template:layout:top', 'skeleton:layout/header');
|
// header dropdown. The hook passes the current $column and $swimlane.
|
||||||
|
$this->template->hook->attach('template:board:column:dropdown', 'bulkMoveTasks:board/column_dropdown');
|
||||||
// 2. Load the plugin stylesheet (currently empty -- proves the CSS hook fires).
|
|
||||||
$this->hook->on('template:layout:css', array(
|
|
||||||
'template' => 'plugins/Skeleton/Asset/css/skeleton.css',
|
|
||||||
));
|
|
||||||
|
|
||||||
// 3. Load the plugin script (currently empty -- proves the JS hook fires).
|
|
||||||
$this->hook->on('template:layout:js', array(
|
|
||||||
'template' => 'plugins/Skeleton/Asset/js/skeleton.js',
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPluginName()
|
public function getPluginName()
|
||||||
{
|
{
|
||||||
return 'Skeleton';
|
return 'BulkMoveTasks';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPluginDescription()
|
public function getPluginDescription()
|
||||||
{
|
{
|
||||||
return t('Reusable skeleton/template for building Kanboard plugins.');
|
return t('Move all tasks from one board column to another in a single action.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPluginAuthor()
|
public function getPluginAuthor()
|
||||||
@@ -39,12 +30,12 @@ class Plugin extends Base
|
|||||||
|
|
||||||
public function getPluginVersion()
|
public function getPluginVersion()
|
||||||
{
|
{
|
||||||
return '0.1.0';
|
return '0.2.0';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPluginHomepage()
|
public function getPluginHomepage()
|
||||||
{
|
{
|
||||||
return 'https://code.beco.cc/beco/kanboard-plugin-skeleton';
|
return 'https://code.beco.cc/beco/BulkMoveTasks';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompatibleVersion()
|
public function getCompatibleVersion()
|
||||||
|
|||||||
76
README.md
76
README.md
@@ -1,19 +1,27 @@
|
|||||||
# Skeleton -- a Kanboard plugin template
|
# BulkMoveTasks -- move a whole column of tasks at once
|
||||||
|
|
||||||
A minimal, working Kanboard plugin that you copy and rename as the starting point for a
|
A Kanboard plugin that adds a "Move all tasks to another column" action to the board
|
||||||
real plugin. By itself it does only one trivial thing: it renders the word "Skeleton" at
|
column header menu. It moves every task of that column (within the swimlane you clicked)
|
||||||
the top of every page. It changes no data and runs no database migration.
|
to a destination column you pick, in one step, instead of dragging cards one by one.
|
||||||
|
|
||||||
## What it demonstrates
|
## What it does
|
||||||
|
|
||||||
- A complete `Plugin.php` registration class with all the metadata Kanboard shows in
|
In the board, open a column's title dropdown. When the column has tasks you will see
|
||||||
Settings -> Plugins (name, description, author, version, homepage, compatible version).
|
**Move all tasks to another column**. It opens a small dialog listing the other columns of
|
||||||
- A template hook (`template:layout:top`) that injects a template into the page.
|
the project; choose one and confirm. All open tasks of the source column and swimlane are
|
||||||
- Asset hooks (`template:layout:css` and `template:layout:js`) that load a stylesheet and
|
appended, in their existing order, to the end of the destination column.
|
||||||
a script. They are empty for now but prove the injection path works -- handy when a real
|
|
||||||
plugin needs custom CSS or JS.
|
Each task is moved with Kanboard's normal move logic, so positions are recalculated and
|
||||||
- The standard plugin directory layout, with stub folders (`Controller/`, `Model/`,
|
the usual move events fire (activity stream, automatic actions, etc.) just as if you had
|
||||||
`Schema/`, `Locale/`, `Test/`) ready to grow into.
|
dragged the cards yourself.
|
||||||
|
|
||||||
|
## Scope of a move
|
||||||
|
|
||||||
|
- Acts on one swimlane at a time -- the swimlane of the column header you used. On a board
|
||||||
|
with several swimlanes, repeat per swimlane.
|
||||||
|
- Moves the open (active) tasks shown on the board. Closed tasks are not affected.
|
||||||
|
- Only users who can modify tasks in the project see the action, and the server re-checks
|
||||||
|
that permission before moving anything.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
@@ -21,45 +29,9 @@ the top of every page. It changes no data and runs no database migration.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
No build step and no dependencies.
|
Copy this folder into your Kanboard installation as `plugins/BulkMoveTasks/`. The
|
||||||
|
directory name must be exactly `BulkMoveTasks` (Kanboard derives the plugin namespace from
|
||||||
1. Copy this folder into your Kanboard installation as `plugins/Skeleton/`.
|
the folder name). No build step and no database migration.
|
||||||
2. Reload any page. The word "Skeleton" appears at the top.
|
|
||||||
3. Confirm it under Settings -> Plugins.
|
|
||||||
|
|
||||||
To uninstall, delete `plugins/Skeleton/`. Nothing else is left behind.
|
|
||||||
|
|
||||||
## Directory layout
|
|
||||||
|
|
||||||
```
|
|
||||||
Skeleton/
|
|
||||||
Plugin.php Registration and hook wiring (the only required file).
|
|
||||||
README.md
|
|
||||||
LICENSE AGPL-3.0.
|
|
||||||
Template/
|
|
||||||
layout/header.php The visible "Skeleton" word.
|
|
||||||
Asset/
|
|
||||||
css/skeleton.css Loaded via template:layout:css.
|
|
||||||
js/skeleton.js Loaded via template:layout:js.
|
|
||||||
Controller/ Stub for future request handlers.
|
|
||||||
Model/ Stub for future business logic / DB access.
|
|
||||||
Schema/ Stub for future database migrations.
|
|
||||||
Locale/ Stub for future translations (e.g. pt_BR/, fr_FR/).
|
|
||||||
Test/ Stub for future unit tests.
|
|
||||||
```
|
|
||||||
|
|
||||||
## How to fork this into a new plugin
|
|
||||||
|
|
||||||
1. Copy the folder and rename it, e.g. `plugins/MyPlugin/`. The folder name must match the
|
|
||||||
namespace and start with a capital letter.
|
|
||||||
2. In `Plugin.php`, change the namespace from `Kanboard\Plugin\Skeleton` to
|
|
||||||
`Kanboard\Plugin\MyPlugin`.
|
|
||||||
3. Update the metadata methods (`getPluginName`, `getPluginDescription`, `getPluginAuthor`,
|
|
||||||
`getPluginVersion`, `getPluginHomepage`, `getCompatibleVersion`).
|
|
||||||
4. Update the hook target paths: the lowercase prefix in `'skeleton:layout/header'` and the
|
|
||||||
`plugins/Skeleton/Asset/...` asset paths must match the new plugin name.
|
|
||||||
5. Replace `Template/layout/header.php` with your real template, or attach to a different
|
|
||||||
hook. See the Kanboard plugin hooks documentation for the full list of hook points.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
<div class="skeleton-plugin-marker">Skeleton</div>
|
|
||||||
Reference in New Issue
Block a user