Always apply merge hooks in task creation controller
This commit is contained in:
parent
fe56fd66f4
commit
cbe606cef5
|
|
@ -29,6 +29,9 @@ class TaskCreationController extends BaseController
|
|||
$values = $this->prepareValues($swimlanes_list);
|
||||
}
|
||||
|
||||
$values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values));
|
||||
$values = $this->hook->merge('controller:task-creation:form:default', $values, array('default_values' => $values));
|
||||
|
||||
$this->response->html($this->template->render('task_creation/show', array(
|
||||
'project' => $project,
|
||||
'errors' => $errors,
|
||||
|
|
@ -125,8 +128,6 @@ class TaskCreationController extends BaseController
|
|||
'owner_id' => $this->userSession->getId(),
|
||||
);
|
||||
|
||||
$values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values));
|
||||
$values = $this->hook->merge('controller:task-creation:form:default', $values, array('default_values' => $values));
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ class TaskGanttCreationController extends BaseController
|
|||
$project = $this->getProject();
|
||||
|
||||
$values = $values + array(
|
||||
'project_id' => $project['id'],
|
||||
'column_id' => $this->columnModel->getFirstColumnId($project['id']),
|
||||
'position' => 1
|
||||
);
|
||||
'project_id' => $project['id'],
|
||||
'column_id' => $this->columnModel->getFirstColumnId($project['id']),
|
||||
'position' => 1
|
||||
);
|
||||
|
||||
$values = $this->hook->merge('controller:task:form:default', $values, array('default_values' => $values));
|
||||
$values = $this->hook->merge('controller:gantt:task:form:default', $values, array('default_values' => $values));
|
||||
|
|
|
|||
|
|
@ -37,9 +37,12 @@ class TaskModificationController extends BaseController
|
|||
$project = $this->projectModel->getById($task['project_id']);
|
||||
|
||||
if (empty($values)) {
|
||||
$values = $this->prepareValues($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));
|
||||
|
||||
$this->response->html($this->template->render('task_modification/show', array(
|
||||
'project' => $project,
|
||||
'values' => $values,
|
||||
|
|
@ -71,19 +74,4 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue