mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-02 03:39:35 -05:00
Merge pull request #152 from Icinga/bugfix/cannot-remove-a-node-132
Make node removal working as expected
This commit is contained in:
commit
28bed2859b
2 changed files with 17 additions and 2 deletions
|
|
@ -133,9 +133,10 @@ class DeleteNodeForm extends QuickForm
|
|||
{
|
||||
$changes = ProcessChanges::construct($this->bp, $this->session);
|
||||
|
||||
switch ($this->getValue('confirm')) {
|
||||
$confirm = $this->getValue('confirm');
|
||||
switch ($confirm) {
|
||||
case 'yes':
|
||||
$changes->deleteNode($this->node, $this->parentNode->getName());
|
||||
$changes->deleteNode($this->node, $this->parentNode === null ? null : $this->parentNode->getName());
|
||||
break;
|
||||
case 'all':
|
||||
$changes->deleteNode($this->node);
|
||||
|
|
@ -143,6 +144,17 @@ class DeleteNodeForm extends QuickForm
|
|||
case 'no':
|
||||
$this->setSuccessMessage($this->translate('Well, maybe next time'));
|
||||
}
|
||||
|
||||
switch ($confirm) {
|
||||
case 'yes':
|
||||
case 'all':
|
||||
if ($this->successUrl === null) {
|
||||
$this->successUrl = clone $this->getRequest()->getUrl();
|
||||
}
|
||||
|
||||
$this->successUrl->getParams()->remove(array('action', 'deletenode'));
|
||||
}
|
||||
|
||||
// Trigger session desctruction to make sure it get's stored.
|
||||
// TODO: figure out why this is necessary, might be an unclean shutdown on redirect
|
||||
unset($changes);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ abstract class QuickForm extends QuickBaseForm
|
|||
*/
|
||||
protected $request;
|
||||
|
||||
/**
|
||||
* @var Url
|
||||
*/
|
||||
protected $successUrl;
|
||||
|
||||
protected $successMessage;
|
||||
|
|
|
|||
Loading…
Reference in a new issue