Merge branch 'master' into bugfix/customvars-case-insensitive-8696

This commit is contained in:
Marius Hein 2015-05-21 16:51:04 +02:00
commit 57abafd10b
9 changed files with 34 additions and 8 deletions

View File

@ -54,6 +54,7 @@ class Monitoring_HostsController extends Controller
{
$this->hostList->setColumns(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_state',
'host_problem',
@ -96,6 +97,7 @@ class Monitoring_HostsController extends Controller
$this->view->checkNowForm = $checkNowForm;
$this->hostList->setColumns(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_state',
'host_problem',

View File

@ -71,6 +71,7 @@ class Monitoring_ListController extends Controller
$this->setAutorefreshInterval(10);
$query = $this->backend->select()->from('hostStatus', array_merge(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_display_name',
'host_state' => $stateColumn,
@ -163,6 +164,7 @@ class Monitoring_ListController extends Controller
'service_attempt',
'service_last_state_change' => $stateChangeColumn,
'service_icon_image',
'service_icon_image_alt',
'service_is_flapping',
'service_state_type',
'service_handled',

View File

@ -51,12 +51,14 @@ class Monitoring_ServicesController extends Controller
{
$this->serviceList->setColumns(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_output',
'host_state',
'host_problem',
'host_handled',
'service_icon_image',
'service_icon_image_alt',
'service_description',
'service_state',
'service_problem',
@ -96,12 +98,14 @@ class Monitoring_ServicesController extends Controller
$this->view->checkNowForm = $checkNowForm;
$this->serviceList->setColumns(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_output',
'host_state',
'host_problem',
'host_handled',
'service_icon_image',
'service_icon_image_alt',
'service_output',
'service_description',
'service_state',

View File

@ -25,7 +25,15 @@ class Zend_View_Helper_IconImage extends Zend_View_Helper_Abstract
public function host($object)
{
if ($object->host_icon_image && ! preg_match('/[\'"]/', $object->host_icon_image)) {
return $this->view->icon($this->view->resolveMacros($object->host_icon_image, $object));
return $this->view->img(
'img/icons/' . $this->view->resolveMacros($object->host_icon_image, $object),
null,
array(
'alt' => $object->host_icon_image_alt,
'title' => $object->host_icon_image_alt,
'data-tooltip-delay' => 0
)
);
}
return '';
}
@ -39,7 +47,15 @@ class Zend_View_Helper_IconImage extends Zend_View_Helper_Abstract
public function service($object)
{
if ($object->service_icon_image && ! preg_match('/[\'"]/', $object->service_icon_image)) {
return $this->view->icon($this->view->resolveMacros($object->service_icon_image, $object));
return $this->view->img(
'img/icons/' . $this->view->resolveMacros($object->service_icon_image, $object),
null,
array(
'alt' => $object->service_icon_image_alt,
'title' => $object->service_icon_image_alt,
'data-tooltip-delay' => 0
)
);
}
return '';
}

View File

@ -1,11 +1,10 @@
<?php if ($comment->objecttype === 'service'): ?>
<?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service(
$comment->service_description,
<?= sprintf(
$this->translate('%s on %s', 'Service running on host'),
$comment->service_display_name,
$comment->host_name,
$comment->host_display_name
); ?>
) ?>
<?php else: ?>
<?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($comment->host_name, $comment->host_display_name); ?>

View File

@ -41,6 +41,7 @@ class StatusQuery extends IdoQuery
'host_address' => 'h.address',
'host_ipv4' => 'INET_ATON(h.address)',
'host_icon_image' => 'h.icon_image',
'host_icon_image_alt' => 'h.icon_image_alt',
'host_action_url' => 'h.action_url',
'host_notes_url' => 'h.notes_url'
),
@ -176,6 +177,7 @@ class StatusQuery extends IdoQuery
'service_description' => 'so.name2',
'service_display_name' => 's.display_name COLLATE latin1_general_ci',
'service_icon_image' => 's.icon_image',
'service_icon_image_alt' => 's.icon_image_alt',
'service_action_url' => 's.action_url',
'service_notes_url' => 's.notes_url',
'object_type' => '(\'service\')'

View File

@ -40,7 +40,6 @@ class ServiceStatus extends DataView
'service_unhandled',
'service_output',
'service_last_state_change',
'service_icon_image',
'service_long_output',
'service_is_flapping',
'service_state_type',
@ -60,7 +59,6 @@ class ServiceStatus extends DataView
'service_last_notification',
'service_check_command',
'service_current_notification_number',
'host_icon_image',
'host_acknowledged',
'host_output',
'host_long_output',

View File

@ -90,6 +90,7 @@ class Host extends MonitoredObject
{
$columns = array(
'host_icon_image',
'host_icon_image_alt',
'host_acknowledged',
'host_action_url',
'host_active_checks_enabled',

View File

@ -107,6 +107,7 @@ class Service extends MonitoredObject
{
return $this->backend->select()->from('serviceStatus', array(
'host_icon_image',
'host_icon_image_alt',
'host_acknowledged',
'host_active_checks_enabled',
'host_address',
@ -120,6 +121,7 @@ class Service extends MonitoredObject
'host_passive_checks_enabled',
'host_state',
'service_icon_image',
'service_icon_image_alt',
'service_acknowledged',
'service_action_url',
'service_active_checks_enabled',