From 1ef643e00274ddcd3e951cd9a03188f99597d84f Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 17 Jun 2015 11:33:55 +0200 Subject: [PATCH] Improve service/host name layout in all views refs #9361 --- modules/monitoring/application/views/helpers/Link.php | 6 +++--- .../application/views/scripts/list/comments.phtml | 6 +++--- .../application/views/scripts/list/downtimes.phtml | 2 +- .../views/scripts/partials/comment/comment-detail.phtml | 6 +++--- .../views/scripts/partials/service/objects-header.phtml | 5 ++--- .../monitoring/application/views/scripts/show/history.phtml | 6 +++--- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/modules/monitoring/application/views/helpers/Link.php b/modules/monitoring/application/views/helpers/Link.php index 8faf6e5fb..35c5a4cbc 100644 --- a/modules/monitoring/application/views/helpers/Link.php +++ b/modules/monitoring/application/views/helpers/Link.php @@ -51,7 +51,8 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract public function service($service, $serviceLinkText, $host, $hostLinkText) { return sprintf( - $this->view->translate('%s on %s', 'Service running on host'), + '%s: %s', + $this->host($host, $hostLinkText), $this->view->qlink( $serviceLinkText, 'monitoring/service/show', @@ -61,8 +62,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract $service, $host )) - ), - $this->host($host, $hostLinkText) + ) ); } } diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml index c4309f46e..43b94be66 100644 --- a/modules/monitoring/application/views/scripts/list/comments.phtml +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -37,9 +37,9 @@ if (count($comments) === 0) { qlink( sprintf( - $this->translate('%s on %s', 'Service running on host'), - $comment->service_display_name, - $comment->host_display_name + '%s: %s', + $comment->host_display_name, + $comment->service_display_name ), 'monitoring/comment/show', array('comment_id' => $comment->id), diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 99b1c0e77..e0836aa26 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -54,7 +54,7 @@ if (count($downtimes) === 0) { } ?> qlink( - sprintf($this->translate('%s on %s', 'Service running on host'), $downtime->service_display_name, $downtime->host_display_name), + sprintf('%s: %s', $downtime->host_display_name, $downtime->service_display_name), 'monitoring/downtime/show', array('downtime_id' => $downtime->id), array('title' => sprintf( diff --git a/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml b/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml index 46de949d2..8583bfc59 100644 --- a/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml +++ b/modules/monitoring/application/views/scripts/partials/comment/comment-detail.phtml @@ -1,9 +1,9 @@ objecttype === 'service'): ?> icon('service', $this->translate('Service')); ?> translate('%s on %s', 'Service running on host'), - $comment->service_display_name, - $comment->host_display_name + '%s: %s', + $comment->host_display_name, + $comment->service_display_name ) ?> icon('host', $this->translate('Host')); ?> diff --git a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml index 176c43d92..ff39bcf22 100644 --- a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml @@ -18,9 +18,8 @@ $i = 0; iconImage()->service($service) ?> serviceFlags($service)) ?> - escape($service->getName()); ?> - translate('on') ?> - escape($service->getHost()->getName()); ?>
+ escape($service->getHost()->getName()); ?>: + escape($service->getName()); ?>
escape($service->service_output) ?> diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index 3777d0384..c34faf2f3 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -143,7 +143,8 @@ $output = $this->tickets ? preg_replace_callback( ?> translate('%s on %s', 'Service running on host'), + '%s: %s', + $event->host_display_name, $hostContext ? $this->qlink( $event->service_display_name, 'monitoring/show/service', @@ -156,8 +157,7 @@ $output = $this->tickets ? preg_replace_callback( $event->service_display_name, $event->host_display_name )) - ) : $this->escape($event->service_display_name), - $event->host_display_name + ) : $this->escape($event->service_display_name) ) ?> escape($event->host_name); ?>