FinanceBuddy: finance fields in task form + metadata persistence (v0.3)

This commit is contained in:
2026-07-07 16:50:40 -03:00
parent b25316e58f
commit 2c9ef4ce7d
6 changed files with 263 additions and 6 deletions

View File

@@ -17,6 +17,17 @@ class Plugin extends Base
// Per-board opt-in: a checkbox on the project's Settings -> Integrations page. Nothing
// else in the plugin renders or saves until a project manager enables it for that board.
$this->template->hook->attach('template:project:integrations', 'financeBuddy:project/integration');
// Finance fields in the task create/edit form (middle column). The template gates itself
// on the board being enabled. These are not task columns, so core cannot persist them:
// FinancePersistence strips them from the task write and stores them in task metadata,
// all synchronously via the model hooks below.
$this->template->hook->attach('template:task:form:second-column', 'financeBuddy:task/form_fields');
$persistence = new \Kanboard\Plugin\FinanceBuddy\Model\FinancePersistence($this->container);
$this->hook->on('model:task:creation:prepare', array($persistence, 'onCreationPrepare'));
$this->hook->on('model:task:creation:aftersave', array($persistence, 'onCreationAfterSave'));
$this->hook->on('model:task:modification:prepare', array($persistence, 'onModificationPrepare'));
}
public function getHelpers()
@@ -43,7 +54,7 @@ class Plugin extends Base
public function getPluginVersion()
{
return '0.2.0';
return '0.3.0';
}
public function getPluginHomepage()