diff --git a/modules/monitoring/application/controllers/CommentController.php b/modules/monitoring/application/controllers/CommentController.php index e5e181449..b5b374c12 100644 --- a/modules/monitoring/application/controllers/CommentController.php +++ b/modules/monitoring/application/controllers/CommentController.php @@ -70,6 +70,15 @@ class Monitoring_CommentController extends Controller } } + /** + * Receive DeleteCommentCommandForm post from other controller + */ + public function removeAction() + { + $this->assertHttpMethod('POST'); + $this->createDelCommentForm(); + } + /** * Create a command form to delete a single comment * diff --git a/modules/monitoring/application/controllers/DowntimeController.php b/modules/monitoring/application/controllers/DowntimeController.php index ec1da00ef..20eebc6ca 100644 --- a/modules/monitoring/application/controllers/DowntimeController.php +++ b/modules/monitoring/application/controllers/DowntimeController.php @@ -105,6 +105,15 @@ class Monitoring_DowntimeController extends Controller } } + /** + * Receive DeleteDowntimeCommandForm post from other controller + */ + public function removeAction() + { + $this->assertHttpMethod('POST'); + $this->createDelDowntimeForm(); + } + /** * Create a command form to delete a single comment * diff --git a/modules/monitoring/application/controllers/DowntimesController.php b/modules/monitoring/application/controllers/DowntimesController.php index 2931f7d3e..f6dc53cb3 100644 --- a/modules/monitoring/application/controllers/DowntimesController.php +++ b/modules/monitoring/application/controllers/DowntimesController.php @@ -7,7 +7,6 @@ use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimesCommandForm; use Icinga\Web\Url; -use Icinga\Web\Widget\Tabextension\DashboardAction; /** * Display detailed information about a downtime diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml index 5d5d21217..141c688e7 100644 --- a/modules/monitoring/application/views/scripts/list/comments.phtml +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -84,16 +84,7 @@ if (count($comments) === 0) { populate(array('comment_id' => $comment->id, 'redirect' => $this->url)); - if ($comment->objecttype === 'host') { - $delCommentForm->setAction( - $this->url('monitoring/host/delete-comment', array('host' => $comment->host_name)) - ); - } else { - $delCommentForm->setAction($this->url('monitoring/service/delete-comment', array( - 'host' => $comment->host_name, - 'service' => $comment->service_description - ))); - } + $delCommentForm->setAction($this->url('monitoring/comment/remove', array('comment_id' => $comment->id))); echo $delCommentForm; ?> diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index f1351a225..859326b2e 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -129,14 +129,7 @@ if (count($downtimes) === 0) { populate(array('downtime_id' => $downtime->id, 'redirect' => $this->url)); - if (! $isService) { - $delDowntimeForm->setAction($this->url('monitoring/host/delete-downtime', array('host' => $downtime->host_name))); - } else { - $delDowntimeForm->setAction($this->url('monitoring/service/delete-downtime', array( - 'host' => $downtime->host_name, - 'service' => $downtime->service_description - ))); - } + $delDowntimeForm->setAction($this->url('monitoring/downtime/remove', array('downtime_id' => $downtime->id))); echo $delDowntimeForm; ?> diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 7e87a8fb6..cc927feb6 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -303,6 +303,10 @@ var data = self.icinga.ui.getSelectionKeys($table); var url = $table.data('icinga-multiselect-url'); + if ($(event.target).closest('form').length) { + // allow form actions in table rows to pass through + return; + } event.stopPropagation(); event.preventDefault();