parent
4463f16f04
commit
b314c074cc
|
@ -123,9 +123,7 @@ class Monitoring_DowntimesController extends Controller
|
||||||
$this->translate('Confirm removal of %d downtimes.'),
|
$this->translate('Confirm removal of %d downtimes.'),
|
||||||
count($this->downtimes)
|
count($this->downtimes)
|
||||||
));
|
));
|
||||||
$delDowntimeForm->setDowntimes($this->downtimes)
|
$delDowntimeForm->setDowntimes($this->downtimes)->handleRequest();
|
||||||
->setRedirectUrl(Url::fromPath('monitoring/list/downtimes'))
|
|
||||||
->handleRequest();
|
|
||||||
$this->view->delDowntimeForm = $delDowntimeForm;
|
$this->view->delDowntimeForm = $delDowntimeForm;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
use Icinga\Module\Monitoring\Controller;
|
use Icinga\Module\Monitoring\Controller;
|
||||||
use Icinga\Module\Monitoring\Backend;
|
use Icinga\Module\Monitoring\Backend;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentsCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
||||||
|
@ -295,6 +295,7 @@ class Monitoring_ListController extends Controller
|
||||||
|
|
||||||
if ($this->Auth()->hasPermission('monitoring/command/downtime/delete')) {
|
if ($this->Auth()->hasPermission('monitoring/command/downtime/delete')) {
|
||||||
$this->view->delDowntimeForm = new DeleteDowntimeCommandForm();
|
$this->view->delDowntimeForm = new DeleteDowntimeCommandForm();
|
||||||
|
$this->view->delDowntimeForm->handleRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,7 +502,8 @@ class Monitoring_ListController extends Controller
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->Auth()->hasPermission('monitoring/command/comment/delete')) {
|
if ($this->Auth()->hasPermission('monitoring/command/comment/delete')) {
|
||||||
$this->view->delCommentForm = new DeleteCommentsCommandForm();
|
$this->view->delCommentForm = new DeleteCommentCommandForm();
|
||||||
|
$this->view->delCommentForm->handleRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,11 +86,9 @@ if (count($comments) === 0) {
|
||||||
$delCommentForm->populate(
|
$delCommentForm->populate(
|
||||||
array(
|
array(
|
||||||
'comment_id' => $comment->id,
|
'comment_id' => $comment->id,
|
||||||
'comment_is_service' => isset($comment->service_description),
|
'comment_is_service' => isset($comment->service_description)
|
||||||
'redirect' => $this->url
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$delCommentForm->setAction($this->url('monitoring/comment/remove', array('comment_id' => $comment->id)));
|
|
||||||
echo $delCommentForm;
|
echo $delCommentForm;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -131,10 +131,9 @@ if (count($downtimes) === 0) {
|
||||||
$delDowntimeForm->populate(
|
$delDowntimeForm->populate(
|
||||||
array(
|
array(
|
||||||
'downtime_id' => $downtime->id,
|
'downtime_id' => $downtime->id,
|
||||||
'redirect' => $this->url
|
'downtime_is_service' => isset($downtime->service_description)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$delDowntimeForm->setAction($this->url('monitoring/downtime/remove', array('downtime_id' => $downtime->id)));
|
|
||||||
echo $delDowntimeForm;
|
echo $delDowntimeForm;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -48,7 +48,12 @@ foreach ($object->comments as $comment) {
|
||||||
<td data-base-target="_self">
|
<td data-base-target="_self">
|
||||||
<?php if (isset($delCommentForm)) { // Form is unset if the current user lacks the respective permission
|
<?php if (isset($delCommentForm)) { // Form is unset if the current user lacks the respective permission
|
||||||
$delCommentForm = clone $delCommentForm;
|
$delCommentForm = clone $delCommentForm;
|
||||||
$delCommentForm->populate(array('comment_id' => $comment->id));
|
$delCommentForm->populate(
|
||||||
|
array(
|
||||||
|
'comment_id' => $comment->id,
|
||||||
|
'comment_is_service' => isset($comment->service_description)
|
||||||
|
)
|
||||||
|
);
|
||||||
echo $delCommentForm;
|
echo $delCommentForm;
|
||||||
} ?>
|
} ?>
|
||||||
<span class="sr-only">(<?= $this->translate('Comment'); ?>): </span><?= str_replace(array('\r\n', '\n'), '<br>', $commentText); ?>
|
<span class="sr-only">(<?= $this->translate('Comment'); ?>): </span><?= str_replace(array('\r\n', '\n'), '<br>', $commentText); ?>
|
||||||
|
|
Loading…
Reference in New Issue