Added prepareValues with hook for plugins
This commit is contained in:
@@ -27,10 +27,7 @@ class SubtaskController extends BaseController
|
|||||||
$task = $this->getTask();
|
$task = $this->getTask();
|
||||||
|
|
||||||
if (empty($values)) {
|
if (empty($values)) {
|
||||||
$values = array(
|
$values = $this->prepareValues($task);
|
||||||
'task_id' => $task['id'],
|
|
||||||
'another_subtask' => $this->request->getIntegerParam('another_subtask', 0)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->response->html($this->template->render('subtask/create', array(
|
$this->response->html($this->template->render('subtask/create', array(
|
||||||
@@ -40,6 +37,24 @@ class SubtaskController extends BaseController
|
|||||||
'task' => $task,
|
'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
|
* Validation and creation
|
||||||
|
|||||||
Reference in New Issue
Block a user