diff --git a/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php b/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php index a07777778..d690091db 100644 --- a/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php +++ b/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php @@ -88,7 +88,7 @@ class ScheduleDowntimeForm extends WithChildrenCommandForm $cfg = $this->getConfiguration(); $preferences = $this->getUserPreferences(); - $downtimes = Backend::getInstance($this->getRequest()->getParam('backend'))->select() + $downtimes = Backend::createBackend($this->getRequest()->getParam('backend'))->select() ->from( 'downtime', array( diff --git a/modules/monitoring/application/views/helpers/CommandForm.php b/modules/monitoring/application/views/helpers/CommandForm.php index d93f7eeff..66803128c 100644 --- a/modules/monitoring/application/views/helpers/CommandForm.php +++ b/modules/monitoring/application/views/helpers/CommandForm.php @@ -72,7 +72,6 @@ class Zend_View_Helper_CommandForm extends Zend_View_Helper_Abstract public function labelSubmitForm($submitLabel, $submitTitle, $cls, $commandName, array $arguments = array()) { $form = $this->simpleForm($commandName, $arguments); - $button = new Zend_Form_Element_Button( array( 'name' => 'btn_submit', diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml index fff7bd1f9..aa0d9a02f 100644 --- a/modules/monitoring/application/views/scripts/show/components/comments.phtml +++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml @@ -1,3 +1,7 @@ +getHelper('CommandForm'); +?>
@@ -41,11 +45,18 @@
-
- -
+ comment_internal_id; + + echo $cf->iconSubmitForm( + 'icinga-icon-remove', + 'Remove comment', + 'btn-small', + 'removecomment', + $deleteData + ); + ?>
escape($comment->comment_author); ?>, comment_type; ?> (format()->timeSince($comment->comment_timestamp); ?>) diff --git a/modules/monitoring/application/views/scripts/show/components/status.phtml b/modules/monitoring/application/views/scripts/show/components/status.phtml index bf282d762..cc138e307 100644 --- a/modules/monitoring/application/views/scripts/show/components/status.phtml +++ b/modules/monitoring/application/views/scripts/show/components/status.phtml @@ -2,6 +2,9 @@ $object = $this->object; $type = (isset($object->service_description) === true) ? 'service' : 'host'; + /** @var Zend_View_Helper_CommandForm $cf */ + $cf = $this->getHelper('CommandForm'); + if ($type === 'host') { $objectStateName = strtolower($this->util()->getHostStateName($this->object->host_state)); $objectState = (int) $object->host_state; @@ -72,14 +75,44 @@

pluginOutput($object->output); ?>

-
- 0): ?> - + object->host_acknowledged || $this->object->service_acknowledged): ?> + labelSubmitForm( + 'Remove Ack', + 'Remove problem acknowledgement', + 'btn-cta btn-half-left', + 'removeacknowledgement', + array( + 'host' => $this->object->host_name, + 'service' => $this->object->service_description + ) + ) ?> + + + Acknowledge + - - -
+ + labelSubmitForm( + 'Recheck', + 'Reschedule next check immediately', + 'btn-cta ' . (($objectState > 0) ? 'btn-half-right' : 'btn-wide'), + 'reschedulenextcheck', + array( + 'host' => $this->object->host_name, + 'service' => $this->object->service_description, + 'checktime' => time(), + 'forcecheck' => '1' + ) + ) ?>
@@ -123,11 +156,17 @@ dateFormat()->formatDateTime($object->next_check); ?>
-
- -
+ + +
diff --git a/modules/monitoring/library/Monitoring/Object/AbstractObject.php b/modules/monitoring/library/Monitoring/Object/AbstractObject.php index 33a653735..cc8c09f29 100644 --- a/modules/monitoring/library/Monitoring/Object/AbstractObject.php +++ b/modules/monitoring/library/Monitoring/Object/AbstractObject.php @@ -169,6 +169,7 @@ abstract class AbstractObject 'comment_author', 'comment_data', 'comment_type', + 'comment_internal_id' ) )->where('comment_objecttype_id', $this->type) )->fetchAll();