diff --git a/application/forms/CleanupNodeForm.php b/application/forms/CleanupNodeForm.php index 22c5c50..c6e5398 100644 --- a/application/forms/CleanupNodeForm.php +++ b/application/forms/CleanupNodeForm.php @@ -4,14 +4,13 @@ namespace Icinga\Module\Businessprocess\Forms; use Icinga\Module\Businessprocess\BpConfig; use Icinga\Module\Businessprocess\Modification\ProcessChanges; -use Icinga\Module\Businessprocess\Web\Form\QuickForm; +use Icinga\Module\Businessprocess\Web\Form\BpConfigBaseForm; use Icinga\Module\Monitoring\Backend\MonitoringBackend; use Icinga\Web\Session\SessionNamespace; -use ipl\Html\FormattedString; use ipl\Html\Html; use ipl\Sql\Connection as IcingaDbConnection; -class CleanupNodeForm extends QuickForm +class CleanupNodeForm extends BpConfigBaseForm { /** @var MonitoringBackend|IcingaDbConnection */ protected $backend; @@ -42,37 +41,6 @@ class CleanupNodeForm extends QuickForm } } - /** - * @param MonitoringBackend|IcingaDbConnection $backend - * @return $this - */ - public function setBackend($backend) - { - $this->backend = $backend; - return $this; - } - - /** - * @param BpConfig $process - * @return $this - */ - public function setProcess(BpConfig $process) - { - $this->bp = $process; - $this->setBackend($process->getBackend()); - return $this; - } - - /** - * @param SessionNamespace $session - * @return $this - */ - public function setSession(SessionNamespace $session) - { - $this->session = $session; - return $this; - } - public function onSuccess() { $changes = ProcessChanges::construct($this->bp, $this->session); diff --git a/application/forms/MoveNodeForm.php b/application/forms/MoveNodeForm.php index 7396277..876ab90 100644 --- a/application/forms/MoveNodeForm.php +++ b/application/forms/MoveNodeForm.php @@ -9,12 +9,12 @@ use Icinga\Module\Businessprocess\BpNode; use Icinga\Module\Businessprocess\Exception\ModificationError; use Icinga\Module\Businessprocess\Modification\ProcessChanges; use Icinga\Module\Businessprocess\Node; +use Icinga\Module\Businessprocess\Web\Form\BpConfigBaseForm; use Icinga\Module\Businessprocess\Web\Form\CsrfToken; -use Icinga\Module\Businessprocess\Web\Form\QuickForm; use Icinga\Web\Session; use Icinga\Web\Session\SessionNamespace; -class MoveNodeForm extends QuickForm +class MoveNodeForm extends BpConfigBaseForm { /** @var BpConfig */ protected $bp; @@ -95,16 +95,6 @@ class MoveNodeForm extends QuickForm $this->setSubmitLabel('movenode'); } - /** - * @param BpConfig $process - * @return $this - */ - public function setProcess(BpConfig $process) - { - $this->bp = $process; - return $this; - } - /** * @param Node $node * @return $this @@ -125,16 +115,6 @@ class MoveNodeForm extends QuickForm return $this; } - /** - * @param SessionNamespace $session - * @return $this - */ - public function setSession(SessionNamespace $session) - { - $this->session = $session; - return $this; - } - public function onSuccess() { if (! CsrfToken::isValid($this->getValue('csrfToken'))) {