summaryrefslogtreecommitdiff
path: root/app/Controller/TaskModificationController.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-08-07 10:31:48 -0400
committerFrederic Guillot <fred@kanboard.net>2016-08-07 10:31:48 -0400
commitc0ee8b409223ee38a24a7bbd896efe9386e785b2 (patch)
tree4f31a6fef1bcfbd0ff601bdb178d9adbb9170b81 /app/Controller/TaskModificationController.php
parent928d27d2ad735d9c6c7ec4954a5a462181f482dd (diff)
Show project name in task forms
Diffstat (limited to 'app/Controller/TaskModificationController.php')
-rw-r--r--app/Controller/TaskModificationController.php24
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;
+ }
}