mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
parent
863bf08864
commit
02eea2ad11
@ -151,7 +151,6 @@ class HostController extends MonitoredObjectController
|
||||
$this->assertPermission('monitoring/command/downtime/schedule');
|
||||
|
||||
$form = new ScheduleHostDowntimeCommandForm();
|
||||
$form->setBackend($this->backend);
|
||||
$form->setTitle($this->translate('Schedule Host Downtime'));
|
||||
$this->handleCommandForm($form);
|
||||
}
|
||||
@ -164,7 +163,6 @@ class HostController extends MonitoredObjectController
|
||||
$this->assertPermission('monitoring/command/process-check-result');
|
||||
|
||||
$form = new ProcessCheckResultCommandForm();
|
||||
$form->setBackend($this->backend);
|
||||
$form->setTitle($this->translate('Submit Passive Host Check Result'));
|
||||
$this->handleCommandForm($form);
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ class HostsController extends Controller
|
||||
protected function handleCommandForm(ObjectsCommandForm $form)
|
||||
{
|
||||
$form
|
||||
->setBackend($this->backend)
|
||||
->setObjects($this->hostList)
|
||||
->setRedirectUrl(Url::fromPath('monitoring/hosts/show')->setParams($this->params))
|
||||
->handleRequest();
|
||||
@ -194,7 +195,6 @@ class HostsController extends Controller
|
||||
$this->assertPermission('monitoring/command/downtime/schedule');
|
||||
|
||||
$form = new ScheduleHostDowntimeCommandForm();
|
||||
$form->setBackend($this->backend);
|
||||
$form->setTitle($this->translate('Schedule Host Downtimes'));
|
||||
$this->handleCommandForm($form);
|
||||
}
|
||||
@ -207,7 +207,6 @@ class HostsController extends Controller
|
||||
$this->assertPermission('monitoring/command/process-check-result');
|
||||
|
||||
$form = new ProcessCheckResultCommandForm();
|
||||
$form->setBackend($this->backend);
|
||||
$form->setTitle($this->translate('Submit Passive Host Check Results'));
|
||||
$this->handleCommandForm($form);
|
||||
}
|
||||
|
@ -121,7 +121,6 @@ class ServiceController extends MonitoredObjectController
|
||||
$this->assertPermission('monitoring/command/process-check-result');
|
||||
|
||||
$form = new ProcessCheckResultCommandForm();
|
||||
$form->setBackend($this->backend);
|
||||
$form->setTitle($this->translate('Submit Passive Service Check Result'));
|
||||
$this->handleCommandForm($form);
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ class ServicesController extends Controller
|
||||
protected function handleCommandForm(ObjectsCommandForm $form)
|
||||
{
|
||||
$form
|
||||
->setBackend($this->backend)
|
||||
->setObjects($this->serviceList)
|
||||
->setRedirectUrl(Url::fromPath('monitoring/services/show')->setParams($this->params))
|
||||
->handleRequest();
|
||||
@ -209,7 +210,6 @@ class ServicesController extends Controller
|
||||
$this->assertPermission('monitoring/command/process-check-result');
|
||||
|
||||
$form = new ProcessCheckResultCommandForm();
|
||||
$form->setBackend($this->backend);
|
||||
$form->setTitle($this->translate('Submit Passive Service Check Results'));
|
||||
$this->handleCommandForm($form);
|
||||
}
|
||||
|
@ -34,21 +34,21 @@ class AddCommentCommandForm extends ObjectsCommandForm
|
||||
*/
|
||||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(array(
|
||||
$this->addElement(
|
||||
'textarea',
|
||||
'comment',
|
||||
array(
|
||||
'textarea',
|
||||
'comment',
|
||||
array(
|
||||
'required' => true,
|
||||
'label' => $this->translate('Comment'),
|
||||
'description' => $this->translate(
|
||||
'If you work with other administrators, you may find it useful to share information about the'
|
||||
. ' the host or service that is having problems. Make sure you enter a brief description of'
|
||||
. ' what you are doing.'
|
||||
)
|
||||
'required' => true,
|
||||
'label' => $this->translate('Comment'),
|
||||
'description' => $this->translate(
|
||||
'If you work with other administrators, you may find it useful to share information about the'
|
||||
. ' the host or service that is having problems. Make sure you enter a brief description of'
|
||||
. ' what you are doing.'
|
||||
)
|
||||
),
|
||||
array(
|
||||
)
|
||||
);
|
||||
if (! $this->getBackend()->isIcinga2()) {
|
||||
$this->addElement(
|
||||
'checkbox',
|
||||
'persistent',
|
||||
array(
|
||||
@ -59,8 +59,8 @@ class AddCommentCommandForm extends ObjectsCommandForm
|
||||
. ' restarted.'
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -76,7 +76,9 @@ class AddCommentCommandForm extends ObjectsCommandForm
|
||||
$comment->setObject($object);
|
||||
$comment->setComment($this->getElement('comment')->getValue());
|
||||
$comment->setAuthor($this->request->getUser()->getUsername());
|
||||
$comment->setPersistent($this->getElement('persistent')->isChecked());
|
||||
if (($persistent = $this->getElement('persistent')) !== null) {
|
||||
$comment->setPersistent($persistent->isChecked());
|
||||
}
|
||||
$this->getTransport($this->request)->send($comment);
|
||||
}
|
||||
Notification::success($this->translatePlural(
|
||||
|
@ -122,6 +122,7 @@ abstract class MonitoredObjectController extends Controller
|
||||
protected function handleCommandForm(ObjectsCommandForm $form)
|
||||
{
|
||||
$form
|
||||
->setBackend($this->backend)
|
||||
->setObjects($this->object)
|
||||
->setRedirectUrl(Url::fromPath($this->commandRedirectUrl)->setParams($this->params))
|
||||
->handleRequest();
|
||||
|
Loading…
x
Reference in New Issue
Block a user