mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
parent
54eb0eaf22
commit
46fdaf4698
@ -27,7 +27,7 @@ class Monitoring_CommentController extends Controller
|
||||
|
||||
$this->comment = $this->backend->select()->from('comment', array(
|
||||
'id' => 'comment_internal_id',
|
||||
'objecttype' => 'comment_objecttype',
|
||||
'objecttype' => 'object_type',
|
||||
'comment' => 'comment_data',
|
||||
'author' => 'comment_author_name',
|
||||
'timestamp' => 'comment_timestamp',
|
||||
|
@ -32,7 +32,7 @@ class Monitoring_CommentsController extends Controller
|
||||
));
|
||||
$this->comments = $this->backend->select()->from('comment', array(
|
||||
'id' => 'comment_internal_id',
|
||||
'objecttype' => 'comment_objecttype',
|
||||
'objecttype' => 'object_type',
|
||||
'comment' => 'comment_data',
|
||||
'author' => 'comment_author_name',
|
||||
'timestamp' => 'comment_timestamp',
|
||||
@ -44,11 +44,11 @@ class Monitoring_CommentsController extends Controller
|
||||
'host_display_name',
|
||||
'service_display_name'
|
||||
))->addFilter($this->filter)->getQuery()->fetchAll();
|
||||
|
||||
|
||||
if (false === $this->comments) {
|
||||
throw new Zend_Controller_Action_Exception($this->translate('Comment not found'));
|
||||
}
|
||||
|
||||
|
||||
$this->getTabs()->add(
|
||||
'comments',
|
||||
array(
|
||||
|
@ -431,7 +431,7 @@ class Monitoring_ListController extends Controller
|
||||
|
||||
$query = $this->backend->select()->from('comment', array(
|
||||
'id' => 'comment_internal_id',
|
||||
'objecttype' => 'comment_objecttype',
|
||||
'objecttype' => 'object_type',
|
||||
'comment' => 'comment_data',
|
||||
'author' => 'comment_author_name',
|
||||
'timestamp' => 'comment_timestamp',
|
||||
|
@ -87,6 +87,19 @@ class HostList extends ObjectList
|
||||
return FilterOr::matchAny($filterExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the comments
|
||||
*
|
||||
* @return \Icinga\Module\Monitoring\DataView\Hostcomment
|
||||
*/
|
||||
public function getComments()
|
||||
{
|
||||
return $this->backend
|
||||
->select()
|
||||
->from('hostcomment', array('host_name'))
|
||||
->applyFilter(clone $this->filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the scheduled downtimes
|
||||
*
|
||||
|
@ -253,7 +253,7 @@ abstract class MonitoredObject implements Filterable
|
||||
'type' => 'comment_type',
|
||||
))
|
||||
->where('comment_type', array('comment', 'ack'))
|
||||
->where('comment_objecttype', $this->type);
|
||||
->where('object_type', $this->type);
|
||||
if ($this->type === self::TYPE_SERVICE) {
|
||||
$comments
|
||||
->where('service_host_name', $this->host_name)
|
||||
|
@ -135,6 +135,19 @@ class ServiceList extends ObjectList
|
||||
return FilterOr::matchAny($filterExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the comments
|
||||
*
|
||||
* @return \Icinga\Module\Monitoring\DataView\Hostcomment
|
||||
*/
|
||||
public function getComments()
|
||||
{
|
||||
return $this->backend
|
||||
->select()
|
||||
->from('servicecomment', array('host_name', 'service_description'))
|
||||
->applyFilter(clone $this->filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the scheduled downtimes
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user