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