/** * {@inheritdoc} */ public function onSuccess() { $cmd = new DeleteDowntimeCommand(); $cmd->setDowntimeId($this->getElement('downtime_id')->getValue()); $cmd->setIsService($this->getElement('downtime_is_service')->getValue()); $this->getTransport($this->request)->send($cmd); $redirect = $this->getElement('redirect')->getValue(); if (!empty($redirect)) { $this->setRedirectUrl($redirect); } Notification::success($this->translate('Deleting downtime.')); return true; }
/** * (non-PHPDoc) * @see \Icinga\Web\Form::onSuccess() For the method documentation. */ public function onSuccess() { foreach ($this->downtimes as $downtime) { $delDowntime = new DeleteDowntimeCommand(); $delDowntime->setDowntimeId($downtime->id); $delDowntime->setIsService(isset($downtime->service_description)); $this->getTransport($this->request)->send($delDowntime); } $redirect = $this->getElement('redirect')->getValue(); if (!empty($redirect)) { $this->setRedirectUrl($redirect); } Notification::success($this->translate('Deleting downtime.')); return true; }