diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-07 10:31:48 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-07 10:31:48 -0400 |
commit | c0ee8b409223ee38a24a7bbd896efe9386e785b2 (patch) | |
tree | 4f31a6fef1bcfbd0ff601bdb178d9adbb9170b81 /app/Controller/TaskModificationController.php | |
parent | 928d27d2ad735d9c6c7ec4954a5a462181f482dd (diff) |
Show project name in task forms
Diffstat (limited to 'app/Controller/TaskModificationController.php')
-rw-r--r-- | app/Controller/TaskModificationController.php | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/app/Controller/TaskModificationController.php b/app/Controller/TaskModificationController.php index b064123a..d37f4bb4 100644 --- a/app/Controller/TaskModificationController.php +++ b/app/Controller/TaskModificationController.php @@ -37,11 +37,7 @@ class TaskModificationController extends BaseController $project = $this->projectModel->getById($task['project_id']); if (empty($values)) { - $values = $task; - $values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values)); - $values = $this->hook->merge('controller:task-modification:form:default', $values, array('default_values' => $values)); - $values = $this->dateParser->format($values, array('date_due'), $this->dateParser->getUserDateFormat()); - $values = $this->dateParser->format($values, array('date_started'), $this->dateParser->getUserDateTimeFormat()); + $values = $this->prepareValues($task); } $this->response->html($this->template->render('task_modification/show', array( @@ -75,4 +71,22 @@ class TaskModificationController extends BaseController $this->edit($values, $errors); } } + + /** + * Prepare form values + * + * @access protected + * @param array $task + * @return array + */ + protected function prepareValues(array $task) + { + $values = $task; + $values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values)); + $values = $this->hook->merge('controller:task-modification:form:default', $values, array('default_values' => $values)); + $values = $this->dateParser->format($values, array('date_due'), $this->dateParser->getUserDateFormat()); + $values = $this->dateParser->format($values, array('date_started'), $this->dateParser->getUserDateTimeFormat()); + + return $values; + } } |