mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
parent
f2d89aee74
commit
b35dd4ddfe
@ -67,6 +67,13 @@ class Monitoring_CommentController extends Controller
|
|||||||
$this->view->comment = $this->comment;
|
$this->view->comment = $this->comment;
|
||||||
if ($this->hasPermission('monitoring/command/comment/delete')) {
|
if ($this->hasPermission('monitoring/command/comment/delete')) {
|
||||||
$this->view->delCommentForm = $this->createDelCommentForm();
|
$this->view->delCommentForm = $this->createDelCommentForm();
|
||||||
|
$this->view->delCommentForm->populate(
|
||||||
|
array(
|
||||||
|
'redirect' => Url::fromPath('monitoring/list/comments'),
|
||||||
|
'comment_id' => $this->comment->id,
|
||||||
|
'comment_is_service' => isset($this->comment->service_description)
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,7 +89,7 @@ class Monitoring_CommentController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Create a command form to delete a single comment
|
* Create a command form to delete a single comment
|
||||||
*
|
*
|
||||||
* @return DeleteCommentCommandForm
|
* @return DeleteCommentsCommandForm
|
||||||
*/
|
*/
|
||||||
private function createDelCommentForm()
|
private function createDelCommentForm()
|
||||||
{
|
{
|
||||||
@ -93,12 +100,6 @@ class Monitoring_CommentController extends Controller
|
|||||||
Url::fromPath('monitoring/comment/show')
|
Url::fromPath('monitoring/comment/show')
|
||||||
->setParam('comment_id', $this->comment->id)
|
->setParam('comment_id', $this->comment->id)
|
||||||
);
|
);
|
||||||
$delCommentForm->populate(
|
|
||||||
array(
|
|
||||||
'redirect' => Url::fromPath('monitoring/list/comments'),
|
|
||||||
'comment_id' => $this->comment->id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$delCommentForm->handleRequest();
|
$delCommentForm->handleRequest();
|
||||||
return $delCommentForm;
|
return $delCommentForm;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
use Icinga\Module\Monitoring\Controller;
|
use Icinga\Module\Monitoring\Controller;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentsCommandForm;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
@ -84,7 +84,7 @@ class Monitoring_CommentsController extends Controller
|
|||||||
$this->view->comments = $this->comments;
|
$this->view->comments = $this->comments;
|
||||||
$this->view->listAllLink = Url::fromPath('monitoring/list/comments')
|
$this->view->listAllLink = Url::fromPath('monitoring/list/comments')
|
||||||
->setQueryString($this->filter->toQueryString());
|
->setQueryString($this->filter->toQueryString());
|
||||||
$delCommentForm = new DeleteCommentCommandForm();
|
$delCommentForm = new DeleteCommentsCommandForm();
|
||||||
$delCommentForm->setTitle($this->view->translate('Remove all Comments'));
|
$delCommentForm->setTitle($this->view->translate('Remove all Comments'));
|
||||||
$delCommentForm->addDescription(sprintf(
|
$delCommentForm->addDescription(sprintf(
|
||||||
$this->translate('Confirm removal of %d comments.'),
|
$this->translate('Confirm removal of %d comments.'),
|
||||||
|
@ -5,6 +5,7 @@ use Icinga\Module\Monitoring\Controller;
|
|||||||
use Icinga\Module\Monitoring\Object\Service;
|
use Icinga\Module\Monitoring\Object\Service;
|
||||||
use Icinga\Module\Monitoring\Object\Host;
|
use Icinga\Module\Monitoring\Object\Host;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
||||||
|
use Icinga\Module\Monitoring\Command\Object\DeleteDowntimeCommand;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
||||||
|
|
||||||
@ -102,6 +103,13 @@ class Monitoring_DowntimeController extends Controller
|
|||||||
->setParam('service', $this->downtime->service_description);
|
->setParam('service', $this->downtime->service_description);
|
||||||
if ($this->hasPermission('monitoring/command/downtime/delete')) {
|
if ($this->hasPermission('monitoring/command/downtime/delete')) {
|
||||||
$this->view->delDowntimeForm = $this->createDelDowntimeForm();
|
$this->view->delDowntimeForm = $this->createDelDowntimeForm();
|
||||||
|
$this->view->delDowntimeForm->populate(
|
||||||
|
array(
|
||||||
|
'redirect' => Url::fromPath('monitoring/list/downtimes'),
|
||||||
|
'downtime_id' => $this->downtime->id,
|
||||||
|
'downtime_is_service' => $this->isService
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,18 +130,11 @@ class Monitoring_DowntimeController extends Controller
|
|||||||
private function createDelDowntimeForm()
|
private function createDelDowntimeForm()
|
||||||
{
|
{
|
||||||
$this->assertPermission('monitoring/command/downtime/delete');
|
$this->assertPermission('monitoring/command/downtime/delete');
|
||||||
|
|
||||||
$delDowntimeForm = new DeleteDowntimeCommandForm();
|
$delDowntimeForm = new DeleteDowntimeCommandForm();
|
||||||
$delDowntimeForm->setAction(
|
$delDowntimeForm->setAction(
|
||||||
Url::fromPath('monitoring/downtime/show')
|
Url::fromPath('monitoring/downtime/show')
|
||||||
->setParam('downtime_id', $this->downtime->id)
|
->setParam('downtime_id', $this->downtime->id)
|
||||||
);
|
);
|
||||||
$delDowntimeForm->populate(
|
|
||||||
array(
|
|
||||||
'redirect' => Url::fromPath('monitoring/list/downtimes'),
|
|
||||||
'downtime_id' => $this->downtime->id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
$delDowntimeForm->handleRequest();
|
$delDowntimeForm->handleRequest();
|
||||||
return $delDowntimeForm;
|
return $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\DeleteCommentCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentsCommandForm;
|
||||||
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;
|
||||||
@ -501,7 +501,7 @@ 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 DeleteCommentCommandForm();
|
$this->view->delCommentForm = new DeleteCommentsCommandForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,12 +4,13 @@
|
|||||||
namespace Icinga\Module\Monitoring\Forms\Command\Object;
|
namespace Icinga\Module\Monitoring\Forms\Command\Object;
|
||||||
|
|
||||||
use Icinga\Module\Monitoring\Command\Object\DeleteCommentCommand;
|
use Icinga\Module\Monitoring\Command\Object\DeleteCommentCommand;
|
||||||
|
use Icinga\Module\Monitoring\Forms\Command\CommandForm;
|
||||||
use Icinga\Web\Notification;
|
use Icinga\Web\Notification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Form for deleting host or service comments
|
* Form for deleting host or service comments
|
||||||
*/
|
*/
|
||||||
class DeleteCommentCommandForm extends ObjectsCommandForm
|
class DeleteCommentCommandForm extends CommandForm
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* (non-PHPDoc)
|
* (non-PHPDoc)
|
||||||
@ -26,23 +27,34 @@ class DeleteCommentCommandForm extends ObjectsCommandForm
|
|||||||
*/
|
*/
|
||||||
public function createElements(array $formData = array())
|
public function createElements(array $formData = array())
|
||||||
{
|
{
|
||||||
$this->addElements(array(
|
$this->addElements(
|
||||||
array(
|
array(
|
||||||
'hidden',
|
|
||||||
'comment_id',
|
|
||||||
array(
|
array(
|
||||||
'required' => true,
|
'hidden',
|
||||||
'decorators' => array('ViewHelper')
|
'comment_id',
|
||||||
)
|
array(
|
||||||
),
|
'required' => true,
|
||||||
array(
|
'validators' => array('NotEmpty'),
|
||||||
'hidden',
|
'decorators' => array('ViewHelper')
|
||||||
'redirect',
|
)
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'decorators' => array('ViewHelper')
|
'hidden',
|
||||||
|
'comment_is_service',
|
||||||
|
array(
|
||||||
|
'filters' => array('Boolean'),
|
||||||
|
'decorators' => array('ViewHelper')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'hidden',
|
||||||
|
'redirect',
|
||||||
|
array(
|
||||||
|
'decorators' => array('ViewHelper')
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
));
|
);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,14 +86,10 @@ class DeleteCommentCommandForm extends ObjectsCommandForm
|
|||||||
*/
|
*/
|
||||||
public function onSuccess()
|
public function onSuccess()
|
||||||
{
|
{
|
||||||
foreach ($this->objects as $object) {
|
$cmd = new DeleteCommentCommand();
|
||||||
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
|
$cmd->setIsService($this->getElement('comment_is_service')->getValue())
|
||||||
$delComment = new DeleteCommentCommand();
|
->setCommentId($this->getElement('comment_id')->getValue());
|
||||||
$delComment
|
$this->getTransport($this->request)->send($cmd);
|
||||||
->setObject($object)
|
|
||||||
->setCommentId($this->getElement('comment_id')->getValue());
|
|
||||||
$this->getTransport($this->request)->send($delComment);
|
|
||||||
}
|
|
||||||
$redirect = $this->getElement('redirect')->getValue();
|
$redirect = $this->getElement('redirect')->getValue();
|
||||||
if (! empty($redirect)) {
|
if (! empty($redirect)) {
|
||||||
$this->setRedirectUrl($redirect);
|
$this->setRedirectUrl($redirect);
|
||||||
|
@ -0,0 +1,92 @@
|
|||||||
|
<?php
|
||||||
|
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
|
||||||
|
|
||||||
|
namespace Icinga\Module\Monitoring\Forms\Command\Object;
|
||||||
|
|
||||||
|
use Icinga\Module\Monitoring\Command\Object\DeleteCommentCommand;
|
||||||
|
use Icinga\Web\Notification;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Form for deleting host or service comments
|
||||||
|
*/
|
||||||
|
class DeleteCommentsCommandForm extends ObjectsCommandForm
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* (non-PHPDoc)
|
||||||
|
* @see \Zend_Form::init() For the method documentation.
|
||||||
|
*/
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
$this->setAttrib('class', 'inline');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (non-PHPDoc)
|
||||||
|
* @see \Icinga\Web\Form::createElements() For the method documentation.
|
||||||
|
*/
|
||||||
|
public function createElements(array $formData = array())
|
||||||
|
{
|
||||||
|
$this->addElements(array(
|
||||||
|
array(
|
||||||
|
'hidden',
|
||||||
|
'comment_id',
|
||||||
|
array(
|
||||||
|
'required' => true,
|
||||||
|
'decorators' => array('ViewHelper')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'hidden',
|
||||||
|
'redirect',
|
||||||
|
array(
|
||||||
|
'decorators' => array('ViewHelper')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
));
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (non-PHPDoc)
|
||||||
|
* @see \Icinga\Web\Form::addSubmitButton() For the method documentation.
|
||||||
|
*/
|
||||||
|
public function addSubmitButton()
|
||||||
|
{
|
||||||
|
$this->addElement(
|
||||||
|
'button',
|
||||||
|
'btn_submit',
|
||||||
|
array(
|
||||||
|
'ignore' => true,
|
||||||
|
'escape' => false,
|
||||||
|
'type' => 'submit',
|
||||||
|
'class' => 'link-like',
|
||||||
|
'label' => $this->getView()->icon('trash'),
|
||||||
|
'title' => $this->translate('Delete this comment'),
|
||||||
|
'decorators' => array('ViewHelper')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (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 */
|
||||||
|
$delComment = new DeleteCommentCommand();
|
||||||
|
$delComment
|
||||||
|
->setObject($object)
|
||||||
|
->setCommentId($this->getElement('comment_id')->getValue());
|
||||||
|
$this->getTransport($this->request)->send($delComment);
|
||||||
|
}
|
||||||
|
$redirect = $this->getElement('redirect')->getValue();
|
||||||
|
if (! empty($redirect)) {
|
||||||
|
$this->setRedirectUrl($redirect);
|
||||||
|
}
|
||||||
|
Notification::success($this->translate('Deleting comment..'));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -33,6 +33,16 @@ class DeleteDowntimeCommandForm extends CommandForm
|
|||||||
'hidden',
|
'hidden',
|
||||||
'downtime_id',
|
'downtime_id',
|
||||||
array(
|
array(
|
||||||
|
'required' => true,
|
||||||
|
'validators' => array('NotEmpty'),
|
||||||
|
'decorators' => array('ViewHelper')
|
||||||
|
)
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'hidden',
|
||||||
|
'downtime_is_service',
|
||||||
|
array(
|
||||||
|
'filters' => array('Boolean'),
|
||||||
'decorators' => array('ViewHelper')
|
'decorators' => array('ViewHelper')
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
@ -76,19 +86,10 @@ class DeleteDowntimeCommandForm extends CommandForm
|
|||||||
*/
|
*/
|
||||||
public function onSuccess()
|
public function onSuccess()
|
||||||
{
|
{
|
||||||
$id = $this->getElement('downtime_id')->getValue();
|
$cmd = new DeleteDowntimeCommand();
|
||||||
|
$cmd->setDowntimeId($this->getElement('downtime_id')->getValue());
|
||||||
// Presence of downtime id, only delete this specific downtime
|
$cmd->setIsService($this->getElement('downtime_is_service')->getValue());
|
||||||
$firstDowntime = $this->downtimes[0];
|
$this->getTransport($this->request)->send($cmd);
|
||||||
|
|
||||||
$delDowntime = new DeleteDowntimeCommand();
|
|
||||||
$delDowntime->setDowntimeId($id);
|
|
||||||
$delDowntime->setDowntimeType(
|
|
||||||
isset($firstDowntime->service_description) ?
|
|
||||||
DeleteDowntimeCommand::DOWNTIME_TYPE_SERVICE :
|
|
||||||
DeleteDowntimeCommand::DOWNTIME_TYPE_HOST
|
|
||||||
);
|
|
||||||
$this->getTransport($this->request)->send($delDowntime);
|
|
||||||
|
|
||||||
$redirect = $this->getElement('redirect')->getValue();
|
$redirect = $this->getElement('redirect')->getValue();
|
||||||
if (! empty($redirect)) {
|
if (! empty($redirect)) {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
$this->comment->service_description,
|
$this->comment->service_description,
|
||||||
$this->comment->service_display_name,
|
$this->comment->service_display_name,
|
||||||
$this->comment->host_name,
|
$this->comment->host_name,
|
||||||
$this->comment->host_display_names
|
$this->comment->host_display_name
|
||||||
); ?>
|
); ?>
|
||||||
</td>
|
</td>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
@ -65,7 +65,12 @@ foreach ($object->downtimes as $downtime) {
|
|||||||
<td data-base-target="_self">
|
<td data-base-target="_self">
|
||||||
<?php if (isset($delDowntimeForm)) { // Form is unset if the current user lacks the respective permission
|
<?php if (isset($delDowntimeForm)) { // Form is unset if the current user lacks the respective permission
|
||||||
$delDowntimeForm = clone $delDowntimeForm;
|
$delDowntimeForm = clone $delDowntimeForm;
|
||||||
$delDowntimeForm->populate(array('downtime_id' => $downtime->id));
|
$delDowntimeForm->populate(
|
||||||
|
array(
|
||||||
|
'downtime_id' => $downtime->id,
|
||||||
|
'downtime_is_service' => $object->getType() === $object::TYPE_SERVICE
|
||||||
|
)
|
||||||
|
);
|
||||||
echo $delDowntimeForm;
|
echo $delDowntimeForm;
|
||||||
} ?>
|
} ?>
|
||||||
<span class="sr-only"><?= $this->translate('Downtime'); ?></span>
|
<span class="sr-only"><?= $this->translate('Downtime'); ?></span>
|
||||||
|
@ -3,20 +3,13 @@
|
|||||||
|
|
||||||
namespace Icinga\Module\Monitoring\Command\Object;
|
namespace Icinga\Module\Monitoring\Command\Object;
|
||||||
|
|
||||||
|
use Icinga\Module\Monitoring\Command\IcingaCommand;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a host or service comment
|
* Delete a host or service comment
|
||||||
*/
|
*/
|
||||||
class DeleteCommentCommand extends ObjectCommand
|
class DeleteCommentCommand extends IcingaCommand
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* (non-PHPDoc)
|
|
||||||
* @see \Icinga\Module\Monitoring\Command\Object\ObjectCommand::$allowedObjects For the property documentation.
|
|
||||||
*/
|
|
||||||
protected $allowedObjects = array(
|
|
||||||
self::TYPE_HOST,
|
|
||||||
self::TYPE_SERVICE
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID of the comment that is to be deleted
|
* ID of the comment that is to be deleted
|
||||||
*
|
*
|
||||||
@ -24,6 +17,13 @@ class DeleteCommentCommand extends ObjectCommand
|
|||||||
*/
|
*/
|
||||||
protected $commentId;
|
protected $commentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of the comment, either 'host' or 'service'
|
||||||
|
*
|
||||||
|
* @var boolean
|
||||||
|
*/
|
||||||
|
protected $isService = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the ID of the comment that is to be deleted
|
* Set the ID of the comment that is to be deleted
|
||||||
*
|
*
|
||||||
@ -46,4 +46,27 @@ class DeleteCommentCommand extends ObjectCommand
|
|||||||
{
|
{
|
||||||
return $this->commentId;
|
return $this->commentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the command affects a service comment
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function getIsService()
|
||||||
|
{
|
||||||
|
return $this->isService;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether the command affects a service
|
||||||
|
*
|
||||||
|
* @param boolean $value The value, defaults to true
|
||||||
|
*
|
||||||
|
* @return this fluent interface
|
||||||
|
*/
|
||||||
|
public function setIsService($value = true)
|
||||||
|
{
|
||||||
|
$this->isService = (bool) $value;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -323,14 +323,9 @@ class IcingaCommandFileCommandRenderer implements IcingaCommandRendererInterface
|
|||||||
|
|
||||||
public function renderDeleteComment(DeleteCommentCommand $command)
|
public function renderDeleteComment(DeleteCommentCommand $command)
|
||||||
{
|
{
|
||||||
if ($command->getObject()->getType() === $command::TYPE_HOST) {
|
|
||||||
$commandString = 'DEL_HOST_COMMENT';
|
|
||||||
} else {
|
|
||||||
$commandString = 'DEL_SVC_COMMENT';
|
|
||||||
}
|
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'%s;%u',
|
'%s;%u',
|
||||||
$commandString,
|
$command->getIsService() ? 'DEL_SVC_COMMENT' : 'DEL_HOST_COMMENT',
|
||||||
$command->getCommentId()
|
$command->getCommentId()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ namespace Icinga\Module\Monitoring\Web\Controller;
|
|||||||
|
|
||||||
use Icinga\Module\Monitoring\Controller;
|
use Icinga\Module\Monitoring\Controller;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\CheckNowCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\CheckNowCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentsCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\ObjectsCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\ObjectsCommandForm;
|
||||||
use Icinga\Module\Monitoring\Forms\Command\Object\RemoveAcknowledgementCommandForm;
|
use Icinga\Module\Monitoring\Forms\Command\Object\RemoveAcknowledgementCommandForm;
|
||||||
@ -81,7 +81,7 @@ abstract class MonitoredObjectController extends Controller
|
|||||||
->handleRequest();
|
->handleRequest();
|
||||||
$this->view->toggleFeaturesForm = $toggleFeaturesForm;
|
$this->view->toggleFeaturesForm = $toggleFeaturesForm;
|
||||||
if (! empty($this->object->comments) && $auth->hasPermission('monitoring/command/comment/delete')) {
|
if (! empty($this->object->comments) && $auth->hasPermission('monitoring/command/comment/delete')) {
|
||||||
$delCommentForm = new DeleteCommentCommandForm();
|
$delCommentForm = new DeleteCommentsCommandForm();
|
||||||
$delCommentForm
|
$delCommentForm
|
||||||
->setObjects($this->object)
|
->setObjects($this->object)
|
||||||
->handleRequest();
|
->handleRequest();
|
||||||
@ -142,7 +142,7 @@ abstract class MonitoredObjectController extends Controller
|
|||||||
{
|
{
|
||||||
$this->assertHttpMethod('POST');
|
$this->assertHttpMethod('POST');
|
||||||
$this->assertPermission('monitoring/command/comment/delete');
|
$this->assertPermission('monitoring/command/comment/delete');
|
||||||
$this->handleCommandForm(new DeleteCommentCommandForm());
|
$this->handleCommandForm(new DeleteCommentsCommandForm());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user