From a4686877e8d2391ad3a765ad41870ae0dbc05b45 Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 28 Sep 2016 09:26:24 +0100 Subject: Moved plugin added fields on the first column to position before checkbox For templating reasons, when adding new fields to the first column they should be between tag selection and the checkbox. --- app/Template/task_creation/show.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Template/task_creation/show.php b/app/Template/task_creation/show.php index c2cc4aac..0c267aff 100644 --- a/app/Template/task_creation/show.php +++ b/app/Template/task_creation/show.php @@ -10,13 +10,14 @@ task->selectTitle($values, $errors) ?> task->selectDescription($values, $errors) ?> task->selectTags($project) ?> - + + hook->render('template:task:form:first-column', array('values' => $values, 'errors' => $errors)) ?> + form->checkbox('another_task', t('Create another task'), 1, isset($values['another_task']) && $values['another_task'] == 1) ?> form->checkbox('duplicate_multiple_projects', t('Duplicate to multiple projects'), 1) ?> - hook->render('template:task:form:first-column', array('values' => $values, 'errors' => $errors)) ?>
-- cgit v1.2.3 From a44d7fa396774af97a1dfe3bb06be3515b9723e1 Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 28 Sep 2016 17:25:32 +0100 Subject: Added hook for plugins --- app/Template/subtask/create.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Template/subtask/create.php b/app/Template/subtask/create.php index 3c080f7c..cc4ccba6 100644 --- a/app/Template/subtask/create.php +++ b/app/Template/subtask/create.php @@ -9,7 +9,8 @@ subtask->selectTitle($values, $errors, array('autofocus')) ?> subtask->selectAssignee($users_list, $values, $errors) ?> subtask->selectTimeEstimated($values, $errors) ?> - + hook->render('template:subtask:form:create', array('values' => $values, 'errors' => $errors)) ?> + form->checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?>
-- cgit v1.2.3 From ee2de22b58da86400de33b0bd5f8cc6383ce88ea Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 28 Sep 2016 17:25:52 +0100 Subject: Added hook for plugins --- app/Template/subtask/edit.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Template/subtask/edit.php b/app/Template/subtask/edit.php index 8f256cea..07419f79 100644 --- a/app/Template/subtask/edit.php +++ b/app/Template/subtask/edit.php @@ -11,7 +11,8 @@ subtask->selectAssignee($users_list, $values, $errors) ?> subtask->selectTimeEstimated($values, $errors) ?> subtask->selectTimeSpent($values, $errors) ?> - + hook->render('template:subtask:form:edit', array('values' => $values, 'errors' => $errors)) ?> +
-- cgit v1.2.3 From 3cd709aec91bd0dbf7edcf19fcc72530884f9374 Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 28 Sep 2016 17:27:21 +0100 Subject: Added hooks for plugins --- app/Template/dashboard/subtasks.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Template/dashboard/subtasks.php b/app/Template/dashboard/subtasks.php index b71deeb9..10bc5d89 100644 --- a/app/Template/dashboard/subtasks.php +++ b/app/Template/dashboard/subtasks.php @@ -10,6 +10,7 @@ order(t('Project'), 'project_name') ?> order(t('Task'), 'task_name') ?> order(t('Subtask'), \Kanboard\Model\SubtaskModel::TABLE.'.title') ?> + hook->render('template:dashboard:subtasks:header', array('values' => $values, 'errors' => $errors, 'paginator' => $paginator)) ?> getCollection() as $subtask): ?> @@ -26,6 +27,7 @@ subtask->toggleStatus($subtask, $subtask['project_id']) ?> + hook->render('template:dashboard:subtasks:rows', array('subtask' => $subtask)) ?> text->e($subtask['time_spent']).'h' ?> -- cgit v1.2.3 From 7a9ee838f02483c995216450b9b3dcfcee02e32d Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 28 Sep 2016 17:28:48 +0100 Subject: Added hooks for plugins --- app/Template/subtask/table.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index 5c60df44..a13103f0 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -7,6 +7,7 @@ + hook->render('template:subtask:table:header', array('values' => $values, 'errors' => $errors)) ?> @@ -29,6 +30,7 @@ text->e($subtask['name'] ?: $subtask['username']) ?> + hook->render('template:subtask:table:rows', array('subtask' => $subtask)) ?>
  • -- cgit v1.2.3 From a5aa42369491ca5d6d181ae072d5a313845a274e Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 28 Sep 2016 17:29:33 +0100 Subject: Added hook for plugins --- app/Template/board/tooltip_subtasks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Template/board/tooltip_subtasks.php b/app/Template/board/tooltip_subtasks.php index 8d5bc059..afff5e2b 100644 --- a/app/Template/board/tooltip_subtasks.php +++ b/app/Template/board/tooltip_subtasks.php @@ -1,7 +1,7 @@
    - + @@ -9,6 +9,7 @@ + hook->render('template:board:tooltip:subtasks:rows', array('subtask' => $subtask)) ?> - hook->render('template:dashboard:subtasks:header', array('values' => $values, 'errors' => $errors, 'paginator' => $paginator)) ?> + hook->render('template:dashboard:subtasks:header', array('paginator' => $paginator)) ?> getCollection() as $subtask): ?> -- cgit v1.2.3 From b2cfe6f0b188db64c602414db1faa6d0fbd29fca Mon Sep 17 00:00:00 2001 From: Eskiso Date: Mon, 3 Oct 2016 23:40:14 +0100 Subject: Removed $values and $errors --- app/Template/subtask/table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index a13103f0..0c4e6df0 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -7,7 +7,7 @@ - hook->render('template:subtask:table:header', array('values' => $values, 'errors' => $errors)) ?> + hook->render('template:subtask:table:header', array('subtask' => $subtask)) ?> -- cgit v1.2.3 From 33436390b83a5287f09a25801fffcbdef4cbbeeb Mon Sep 17 00:00:00 2001 From: Eskiso Date: Tue, 4 Oct 2016 08:53:07 +0100 Subject: No need for values in array --- app/Template/subtask/table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index 0c4e6df0..6ce7dc0a 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -7,7 +7,7 @@ - hook->render('template:subtask:table:header', array('subtask' => $subtask)) ?> + hook->render('template:subtask:table:header', array()) ?> -- cgit v1.2.3 From f9fa6ceb859c2974bb56c2f2b5bf103219e70994 Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 5 Oct 2016 02:27:15 +0100 Subject: Removed second argument (empty) --- app/Template/subtask/table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index 6ce7dc0a..d5d67165 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -7,7 +7,7 @@ - hook->render('template:subtask:table:header', array()) ?> + hook->render('template:subtask:table:header') ?> -- cgit v1.2.3 From 11817d63de0398ad5c5e1ec622fa2ccbce8adb5e Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 5 Oct 2016 02:32:35 +0100 Subject: Renamed hook to better describe position. --- app/Template/dashboard/subtasks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Template/dashboard/subtasks.php b/app/Template/dashboard/subtasks.php index f2138f97..13770f0f 100644 --- a/app/Template/dashboard/subtasks.php +++ b/app/Template/dashboard/subtasks.php @@ -10,7 +10,7 @@ - hook->render('template:dashboard:subtasks:header', array('paginator' => $paginator)) ?> + hook->render('template:dashboard:subtasks:header:before-timetracking', array('paginator' => $paginator)) ?> getCollection() as $subtask): ?> -- cgit v1.2.3 From 471f24f41437fe476dd17c0000169ec100d8c894 Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 5 Oct 2016 02:35:35 +0100 Subject: Renamed hook to better describe position. --- app/Template/subtask/table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Template/subtask/table.php b/app/Template/subtask/table.php index d5d67165..bea49aed 100644 --- a/app/Template/subtask/table.php +++ b/app/Template/subtask/table.php @@ -7,7 +7,7 @@ - hook->render('template:subtask:table:header') ?> + hook->render('template:subtask:table:header:before-timetracking') ?> -- cgit v1.2.3 From 83a02a112a4ba6648db8e8cd24d84b8f139f9fec Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 5 Oct 2016 02:50:56 +0100 Subject: Added hook to header of table --- app/Template/board/tooltip_subtasks.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Template/board/tooltip_subtasks.php b/app/Template/board/tooltip_subtasks.php index afff5e2b..335c28ce 100644 --- a/app/Template/board/tooltip_subtasks.php +++ b/app/Template/board/tooltip_subtasks.php @@ -2,6 +2,7 @@
    subtask->toggleStatus($subtask, $task['project_id']) ?> text->e($subtask['name'] ?: $subtask['username']) ?> -- cgit v1.2.3 From c0991e2a442858e7d427accca99517c5399d0c3f Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 28 Sep 2016 17:31:42 +0100 Subject: Added hooks for plugins --- app/Model/SubtaskModel.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Model/SubtaskModel.php b/app/Model/SubtaskModel.php index 608ffce7..737a933d 100644 --- a/app/Model/SubtaskModel.php +++ b/app/Model/SubtaskModel.php @@ -255,6 +255,7 @@ class SubtaskModel extends Base { $this->helper->model->removeFields($values, array('another_subtask')); $this->helper->model->resetFields($values, array('time_estimated', 'time_spent')); + $this->hook->reference('model:subtask:modification:prepare', $values); } /** @@ -272,6 +273,7 @@ class SubtaskModel extends Base $values['time_estimated'] = isset($values['time_estimated']) ? $values['time_estimated'] : 0; $values['time_spent'] = isset($values['time_spent']) ? $values['time_spent'] : 0; $values['user_id'] = isset($values['user_id']) ? $values['user_id'] : 0; + $this->hook->reference('model:subtask:creation:prepare', $values); } /** -- cgit v1.2.3 From 3cf554e6382ac28b64e23bfcb7064b48bc6b8696 Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 28 Sep 2016 17:41:27 +0100 Subject: Added prepareValues with hook for plugins --- app/Controller/SubtaskController.php | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/app/Controller/SubtaskController.php b/app/Controller/SubtaskController.php index 7502d84f..134b057e 100644 --- a/app/Controller/SubtaskController.php +++ b/app/Controller/SubtaskController.php @@ -27,10 +27,7 @@ class SubtaskController extends BaseController $task = $this->getTask(); if (empty($values)) { - $values = array( - 'task_id' => $task['id'], - 'another_subtask' => $this->request->getIntegerParam('another_subtask', 0) - ); + $values = $this->prepareValues($task); } $this->response->html($this->template->render('subtask/create', array( @@ -40,6 +37,24 @@ class SubtaskController extends BaseController 'task' => $task, ))); } + + /** + * Prepare form values + * + * @access protected + * @param array $task + * @return array + */ + protected function prepareValues(array $task) + { + $values = array( + 'task_id' => $task['id'], + 'another_subtask' => $this->request->getIntegerParam('another_subtask', 0) + ); + + $values = $this->hook->merge('controller:subtask:form:default', $values, array('default_values' => $values)); + return $values; + } /** * Validation and creation -- cgit v1.2.3 From 30422c9087ef6d6de34700d1137d5943697e3fd2 Mon Sep 17 00:00:00 2001 From: Eskiso Date: Sat, 1 Oct 2016 12:11:37 +0100 Subject: Removed $values and $errors --- app/Template/dashboard/subtasks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Template/dashboard/subtasks.php b/app/Template/dashboard/subtasks.php index 10bc5d89..f2138f97 100644 --- a/app/Template/dashboard/subtasks.php +++ b/app/Template/dashboard/subtasks.php @@ -10,7 +10,7 @@ order(t('Project'), 'project_name') ?> order(t('Task'), 'task_name') ?> order(t('Subtask'), \Kanboard\Model\SubtaskModel::TABLE.'.title') ?>
    order(t('Project'), 'project_name') ?> order(t('Task'), 'task_name') ?> order(t('Subtask'), \Kanboard\Model\SubtaskModel::TABLE.'.title') ?>
    + hook->render('template:board:tooltip:subtasks:header:before-assignee') ?> -- cgit v1.2.3 From b18e3d6a5c25cfbfc87ee4d62231ff8a2866da52 Mon Sep 17 00:00:00 2001 From: Eskiso Date: Wed, 5 Oct 2016 03:06:56 +0100 Subject: Added new subtask hooks --- doc/plugin-hooks.markdown | 134 +++++++++++++++++++++++++--------------------- 1 file changed, 72 insertions(+), 62 deletions(-) diff --git a/doc/plugin-hooks.markdown b/doc/plugin-hooks.markdown index b3272d73..8f1a3bb7 100644 --- a/doc/plugin-hooks.markdown +++ b/doc/plugin-hooks.markdown @@ -141,6 +141,8 @@ List of reference hooks: | `model:task:creation:prepare` | Alter form values before to save a task | | `model:task:modification:prepare` | Alter form values before to edit a task | | `model:color:get-list` | Alter default_colors values | +| `model:subtask:modification:prepare` | Alter form values before to save a subtask | +| `model:subtask:creation:prepare` | Alter form values before to edit a subtask | Template Hooks @@ -186,68 +188,76 @@ Template names without prefix are core templates. List of template hooks: -| Hook | Description | -|--------------------------------------------|----------------------------------------------------| -| `template:analytic:sidebar` | Sidebar on analytic pages | -| `template:app:filters-helper:before` | Filter helper dropdown (top) | -| `template:app:filters-helper:after` | Filter helper dropdown (bottom) | -| `template:auth:login-form:before` | Login page (top) | -| `template:auth:login-form:after` | Login page (bottom) | -| `template:board:private:task:before-title` | Task in private board: before title | -| `template:board:private:task:after-title` | Task in private board: after title | -| `template:board:public:task:before-title` | Task in public board: before title | -| `template:board:public:task:after-title` | Task in public board: after title | -| `template:board:task:footer` | Task in board: footer | -| `template:board:task:icons` | Task in board: tooltip icon | -| `template:board:column:dropdown` | Dropdown menu in board columns | -| `template:config:sidebar` | Sidebar on settings page | -| `template:config:application ` | Application settings form | -| `template:config:email` | Email settings page | -| `template:config:integrations` | Integration page in global settings | -| `template:dashboard:sidebar` | Sidebar on dashboard page | -| `template:dashboard:show` | Main page of the dashboard | -| `template:export:sidebar` | Sidebar on export pages | -| `template:import:sidebar` | Sidebar on import pages | -| `template:header:dropdown` | Page header dropdown menu (user avatar icon) | -| `template:header:creation-dropdown` | Page header dropdown menu (plus icon) | -| `template:layout:head` | Page layout `` tag | -| `template:layout:top` | Page layout top header | -| `template:layout:bottom` | Page layout footer | -| `template:project:dropdown` | "Actions" menu on left in different project views | -| `template:project:header:before` | Project filters (before) | -| `template:project:header:after` | Project filters (after) | -| `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:project-list:menu:before` | Project list: before menu entries | -| `template:project-list:menu:after` | Project list: after menu entries | -| `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 | -| `template:task:details:fourth-column` | Task summary fourth column | -| `template:task:dropdown` | Task dropdown menu in listing pages | -| `template:task:sidebar:actions` | Sidebar on task page (section actions) | -| `template:task:sidebar:information` | Sidebar on task page (section information) | -| `template:task:form:first-column` | 1st column in task form | -| `template:task:form:second-column` | 2nd column in task form | -| `template:task:form:third-column` | 3nd column in task form | -| `template:task:show:top ` | Show task page: top | -| `template:task:show:bottom` | Show task page: bottom | -| `template:task:show:before-description` | Show task page: before description | -| `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-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 | -| `template:user:external` | "External authentication" page in user profile | -| `template:user:integrations` | Integration page in user profile | -| `template:user:sidebar:actions` | Sidebar in user profile (section actions) | -| `template:user:sidebar:information` | Sidebar in user profile (section information) | +| Hook | Description | +|-----------------------------------------------------------|----------------------------------------------------| +| `template:analytic:sidebar` | Sidebar on analytic pages | +| `template:app:filters-helper:before` | Filter helper dropdown (top) | +| `template:app:filters-helper:after` | Filter helper dropdown (bottom) | +| `template:auth:login-form:before` | Login page (top) | +| `template:auth:login-form:after` | Login page (bottom) | +| `template:board:private:task:before-title` | Task in private board: before title | +| `template:board:private:task:after-title` | Task in private board: after title | +| `template:board:public:task:before-title` | Task in public board: before title | +| `template:board:public:task:after-title` | Task in public board: after title | +| `template:board:task:footer` | Task in board: footer | +| `template:board:task:icons` | Task in board: tooltip icon | +| `template:board:column:dropdown` | Dropdown menu in board columns | +| `template:board:tooltip:subtasks:header:before-assignee` | Header of Subtask table on tootip before Assignee | +| `template:board:tooltip:subtasks:rows` | Column on row of Subtask table on tooltip | +| `template:config:sidebar` | Sidebar on settings page | +| `template:config:application ` | Application settings form | +| `template:config:email` | Email settings page | +| `template:config:integrations` | Integration page in global settings | +| `template:dashboard:sidebar` | Sidebar on dashboard page | +| `template:dashboard:show` | Main page of the dashboard | +| `template:dashboard:subtasks:header:before-timetracking` | Header of Subtask table before Time Tracking | +| `template:dashboard:subtasks:rows` | Column on row of Subtask table of the dashboard | +| `template:export:sidebar` | Sidebar on export pages | +| `template:import:sidebar` | Sidebar on import pages | +| `template:header:dropdown` | Page header dropdown menu (user avatar icon) | +| `template:header:creation-dropdown` | Page header dropdown menu (plus icon) | +| `template:layout:head` | Page layout `` tag | +| `template:layout:top` | Page layout top header | +| `template:layout:bottom` | Page layout footer | +| `template:project:dropdown` | "Actions" menu on left in different project views | +| `template:project:header:before` | Project filters (before) | +| `template:project:header:after` | Project filters (after) | +| `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:project-list:menu:before` | Project list: before menu entries | +| `template:project-list:menu:after` | Project list: after menu entries | +| `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 | +| `template:task:details:fourth-column` | Task summary fourth column | +| `template:task:dropdown` | Task dropdown menu in listing pages | +| `template:task:sidebar:actions` | Sidebar on task page (section actions) | +| `template:task:sidebar:information` | Sidebar on task page (section information) | +| `template:task:form:first-column` | 1st column in task form | +| `template:task:form:second-column` | 2nd column in task form | +| `template:task:form:third-column` | 3nd column in task form | +| `template:task:show:top ` | Show task page: top | +| `template:task:show:bottom` | Show task page: bottom | +| `template:task:show:before-description` | Show task page: before description | +| `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-attachments` | Show task page: before attachments | +| `template:task:show:before-comments` | Show task page: before comments | +| `template:subtask:form:create` | "Create Subtask" form | +| `template:subtask:form:edit` | "Edit Subtask" form | +| `template:subtask:table:header:before-timetracking` | Subtask table header before Time Tracking | +| `template:subtask:table:rows` | Column on row of subtasks table | +| `template:user:authentication:form` | "Edit authentication" form in user profile | +| `template:user:create-remote:form` | "Create remote user" form | +| `template:user:external` | "External authentication" page in user profile | +| `template:user:integrations` | Integration page in user profile | +| `template:user:sidebar:actions` | Sidebar in user profile (section actions) | +| `template:user:sidebar:information` | Sidebar in user profile (section information) | Another template hooks can be added if necessary, just ask on the issue tracker. -- cgit v1.2.3