mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-01 07:59:26 -05:00
ProcessController: simplify form-related code
This commit is contained in:
parent
4f2ae8a532
commit
4add34aca6
1 changed files with 8 additions and 14 deletions
|
|
@ -25,9 +25,9 @@ class ProcessController extends Controller
|
|||
$this->setTitle($this->translate('Create a new business process'));
|
||||
$this->tabsForCreate()->activate('create');
|
||||
|
||||
$this->view->form = BpConfigForm::construct()
|
||||
$this->view->form = $this->loadForm('bpConfig')
|
||||
->setStorage($this->storage())
|
||||
->setRedirectUrl('businessprocess/process/show')
|
||||
->setSuccessUrl('businessprocess/process/show')
|
||||
->handleRequest();
|
||||
}
|
||||
|
||||
|
|
@ -170,21 +170,15 @@ class ProcessController extends Controller
|
|||
$bp->getTitle()
|
||||
);
|
||||
|
||||
$url = sprintf(
|
||||
'businessprocess/process/show?config=%s&unlocked#!%s',
|
||||
$bp->getName(),
|
||||
$this->getRequest()->getUrl()
|
||||
$url = Url::fromPath(
|
||||
'businessprocess/process/show?unlocked',
|
||||
array('config' => $bp->getName())
|
||||
);
|
||||
$this->view->form = BpConfigForm::construct()
|
||||
|
||||
$this->view->form = $this->loadForm('bpConfig')
|
||||
->setProcessConfig($bp)
|
||||
->setStorage($this->storage())
|
||||
->setRedirectUrl($url)
|
||||
->handleRequest();
|
||||
|
||||
$this->view->deleteForm = DeleteConfigForm::construct()
|
||||
->setStorage($this->storage())
|
||||
->setController($this)
|
||||
->setBpConfig($bp)
|
||||
->setSuccessUrl($url)
|
||||
->handleRequest();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue