ServiceController: beforeHandlingAddRequest hook
This commit is contained in:
parent
c1185106fa
commit
078e46df60
|
@ -79,6 +79,20 @@ class ServiceController extends ObjectController
|
|||
}
|
||||
}
|
||||
|
||||
protected function beforeHandlingAddRequest($form)
|
||||
{
|
||||
if ($this->apply) {
|
||||
if (!$form->hasBeenSent()) {
|
||||
$form->populate(array(
|
||||
'imports' => $this->apply->object_name,
|
||||
'object_name' => $this->apply->object_name,
|
||||
'object_type' => 'apply',
|
||||
));
|
||||
$form->getObject()->object_type = 'apply';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function editAction()
|
||||
{
|
||||
parent::editAction();
|
||||
|
|
|
@ -185,10 +185,16 @@ abstract class ObjectController extends ActionController
|
|||
ucfirst($ltype)
|
||||
);
|
||||
|
||||
$this->beforeHandlingAddRequest($form);
|
||||
|
||||
$form->handleRequest();
|
||||
$this->setViewScript('object/form');
|
||||
}
|
||||
|
||||
protected function beforeHandlingAddRequest($form)
|
||||
{
|
||||
}
|
||||
|
||||
public function cloneAction()
|
||||
{
|
||||
$type = $this->getType();
|
||||
|
|
Loading…
Reference in New Issue