summaryrefslogtreecommitdiff
path: root/app/Controller/TaskModificationController.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/TaskModificationController.php')
-rw-r--r--app/Controller/TaskModificationController.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/app/Controller/TaskModificationController.php b/app/Controller/TaskModificationController.php
index b064123a..cbc3777a 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,19 @@ 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));
+ return $values;
+ }
}