/** * (non-PHPDoc) * @see \Icinga\Web\Form::onSuccess() For the method documentation. */ public function onSuccess() { foreach ($this->objects as $object) { /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ $comment = new AddCommentCommand(); $comment->setObject($object); $comment->setComment($this->getElement('comment')->getValue()); $comment->setAuthor($this->request->getUser()->getUsername()); $comment->setPersistent($this->getElement('persistent')->isChecked()); $this->getTransport($this->request)->send($comment); } Notification::success($this->translatePlural('Adding comment..', 'Adding comments..', count($this->objects))); return true; }