mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-07 05:59:35 -05:00
forms: get backend from process
This commit is contained in:
parent
8795c2b06e
commit
85f566ee67
3 changed files with 17 additions and 17 deletions
|
|
@ -13,10 +13,9 @@ class Businessprocess_NodeController extends Controller
|
|||
$node = $bp->getNode($this->getParam('node'));
|
||||
|
||||
$form = new ProcessForm();
|
||||
$form->setBackend($this->backend)
|
||||
->setProcess($bp)
|
||||
->setNode($node)
|
||||
->handleRequest();
|
||||
$form->setProcess($bp)
|
||||
->setNode($node)
|
||||
->handleRequest();
|
||||
|
||||
$this->view->form = $form;
|
||||
$this->view->node = $node;
|
||||
|
|
@ -33,19 +32,18 @@ class Businessprocess_NodeController extends Controller
|
|||
);
|
||||
$form = new SimulationForm();
|
||||
|
||||
$form->setBackend($this->backend)
|
||||
->setProcess($bp)
|
||||
->setSession($this->session())
|
||||
->setNode($node)
|
||||
// TODO: find a better way to handle redirects
|
||||
->setRedirectUrl(
|
||||
sprintf(
|
||||
'businessprocess/process/show?simulation=1&processName=%s#!%s',
|
||||
$bp->getName(),
|
||||
$detail->getAbsoluteUrl()
|
||||
)
|
||||
)
|
||||
->handleRequest();
|
||||
$form->setProcess($bp)
|
||||
->setSession($this->session())
|
||||
->setNode($node)
|
||||
// TODO: find a better way to handle redirects
|
||||
->setRedirectUrl(
|
||||
sprintf(
|
||||
'businessprocess/process/show?simulation=1&processName=%s#!%s',
|
||||
$bp->getName(),
|
||||
$detail->getAbsoluteUrl()
|
||||
)
|
||||
)
|
||||
->handleRequest();
|
||||
|
||||
$this->view->form = $form;
|
||||
$this->view->node = $node;
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ class ProcessForm extends Form
|
|||
public function setProcess($process)
|
||||
{
|
||||
$this->process = $process;
|
||||
$this->setBackend($process->getBackend());
|
||||
$this->processList = array();
|
||||
foreach ($process->getNodes() as $node) {
|
||||
if ($node instanceof BpNode) {
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class SimulationForm extends Form
|
|||
public function setProcess($process)
|
||||
{
|
||||
$this->process = $process;
|
||||
$this->setBackend($process->getBackend());
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue