diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-10-05 08:46:39 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-10-05 08:46:39 -0400 |
commit | 9159be81ec48dafa4ce0302418e5fcd2a95d734c (patch) | |
tree | 91e6fc577491d0ba73d8c24dd09c6e97a350064c /app/Controller/SubtaskController.php | |
parent | 1c0fad6e129aa390ae0926718c2c1d041959d2a3 (diff) | |
parent | b18e3d6a5c25cfbfc87ee4d62231ff8a2866da52 (diff) |
Merge pull-request #2707
Diffstat (limited to 'app/Controller/SubtaskController.php')
-rw-r--r-- | app/Controller/SubtaskController.php | 23 |
1 files 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 |