Fix comment and downtime list inline forms

refs #8903
refs #8902
This commit is contained in:
Matthias Jentsch 2015-05-04 17:59:16 +02:00
parent 11c9cde557
commit 7c8ff44fd1
6 changed files with 24 additions and 19 deletions

View File

@ -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
*

View File

@ -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
*

View File

@ -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

View File

@ -84,16 +84,7 @@ if (count($comments) === 0) {
<?php
$delCommentForm = clone $delCommentForm;
$delCommentForm->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;
?>
</td>

View File

@ -129,14 +129,7 @@ if (count($downtimes) === 0) {
<?php
$delDowntimeForm = clone $delDowntimeForm;
$delDowntimeForm->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;
?>
</td>

View File

@ -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();