From 6c44f6a11a1154a9678257601071ed3c813e5799 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 May 2015 10:47:44 +0200 Subject: [PATCH 1/9] Deduplicate url-attribute parsing code Use function to fetch all host links in MonitoredObject instead. --- .../scripts/show/components/actions.phtml | 26 +++++++------------ .../Monitoring/Object/MonitoredObject.php | 13 ++++++++++ 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/modules/monitoring/application/views/scripts/show/components/actions.phtml b/modules/monitoring/application/views/scripts/show/components/actions.phtml index 35077abc0..18f8a8482 100644 --- a/modules/monitoring/application/views/scripts/show/components/actions.phtml +++ b/modules/monitoring/application/views/scripts/show/components/actions.phtml @@ -1,29 +1,21 @@ %s ', $this->translate('opens in new window')); -$linkText = '%s ' . $newTabInfo . ''; -$localLinkText = '%s'; - -if ($object->action_url) { - if (strpos($object->action_url, "' ") === false) { - $links[] = sprintf($linkText, $this->resolveMacros($object->action_url, $object), 'Action'); - } else { - // TODO: We should find out document what's going on here. Looks strange :p - foreach(explode("' ", $object->action_url) as $url) { - $url = strpos($url, "'") === 0 ? substr($url, 1) : $url; - $url = strrpos($url, "'") === strlen($url) - 1 ? substr($url, 0, strlen($url) - 1) : $url; - $links[] = sprintf($linkText, $this->resolveMacros($url, $object), 'Action'); - } - } +$links = MonitoredObject::parseAttributeUrls($object->action_url); +foreach ($links as $i => $link) { + $links[$i] = sprintf( + '%s ' . $newTabInfo . '', + $this->resolveMacros($object->action_url, $object), + 'Action' + ); } if (isset($this->actions)) { foreach ($this->actions as $id => $action) { - $links[] = sprintf($localLinkText, $action, $id); + $links[] = sprintf('%s', $action, $id); } } diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 236ca2aaa..37d29c82e 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -578,9 +578,22 @@ abstract class MonitoredObject implements Filterable */ public function getNotesUrls() {} + /** + * Get all action urls configured for this monitored object + * + * @return array All note urls as a string + */ + public function getActionUrls() + { + return MonitoredObject::parseAttributeUrls($this->action_url); + } + /** * Parse the content of the action_url or notes_url attributes * + * Find all occurences of http links, separated by whitespaces and quoted + * by single or double-ticks. + * * @link http://docs.icinga.org/latest/de/objectdefinitions.html * * @param string $urlString A string containing one or more urls From 37f58e55d87de18e494d92daf7de2f199ce7991c Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 May 2015 14:21:05 +0200 Subject: [PATCH 2/9] Move macro resolcing functionality into separate class Make macro resolving functionality available to all code, instead of depending on a view resf #6392 --- .../application/views/helpers/IconImage.php | 6 +- .../views/helpers/ResolveMacros.php | 50 +------------- .../library/Monitoring/Object/Host.php | 2 +- .../library/Monitoring/Object/Macro.php | 67 +++++++++++++++++++ .../library/Monitoring/Object/Service.php | 2 +- .../views/helpers/ResolveMacrosTest.php | 25 +++---- 6 files changed, 86 insertions(+), 66 deletions(-) create mode 100644 modules/monitoring/library/Monitoring/Object/Macro.php diff --git a/modules/monitoring/application/views/helpers/IconImage.php b/modules/monitoring/application/views/helpers/IconImage.php index e0e969db4..ccd74ee3c 100644 --- a/modules/monitoring/application/views/helpers/IconImage.php +++ b/modules/monitoring/application/views/helpers/IconImage.php @@ -1,6 +1,8 @@ host_icon_image && ! preg_match('/[\'"]/', $object->host_icon_image)) { return $this->view->img( - 'img/icons/' . $this->view->resolveMacros($object->host_icon_image, $object), + 'img/icons/' . Macro::resolveMacro($object->host_icon_image, $object), null, array( 'alt' => $object->host_icon_image_alt, @@ -48,7 +50,7 @@ class Zend_View_Helper_IconImage extends Zend_View_Helper_Abstract { if ($object->service_icon_image && ! preg_match('/[\'"]/', $object->service_icon_image)) { return $this->view->img( - 'img/icons/' . $this->view->resolveMacros($object->service_icon_image, $object), + 'img/icons/' . Macro::resolveMacros($object->service_icon_image, $object), null, array( 'alt' => $object->service_icon_image_alt, diff --git a/modules/monitoring/application/views/helpers/ResolveMacros.php b/modules/monitoring/application/views/helpers/ResolveMacros.php index 7d555f8fd..e6566936e 100644 --- a/modules/monitoring/application/views/helpers/ResolveMacros.php +++ b/modules/monitoring/application/views/helpers/ResolveMacros.php @@ -2,61 +2,17 @@ /* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ use \Zend_View_Helper_Abstract; -use Icinga\Module\Monitoring\Object\MonitoredObject; +use Icinga\Module\Monitoring\Object\Macro; class Zend_View_Helper_ResolveMacros extends Zend_View_Helper_Abstract { - /** - * Known icinga macros - * - * @var array - */ - private $icingaMacros = array( - 'HOSTNAME' => 'host_name', - 'HOSTADDRESS' => 'host_address', - 'SERVICEDESC' => 'service_description' - ); - - /** - * Return the given string with macros being resolved - * - * @param string $input The string in which to look for macros - * @param MonitoredObject|stdClass $object The host or service used to resolve macros - * - * @return string The substituted or unchanged string - */ public function resolveMacros($input, $object) { - $matches = array(); - if (preg_match_all('@\$([^\$\s]+)\$@', $input, $matches)) { - foreach ($matches[1] as $key => $value) { - $newValue = $this->resolveMacro($value, $object); - if ($newValue !== $value) { - $input = str_replace($matches[0][$key], $newValue, $input); - } - } - } - - return $input; + return Macro::resolveMacros($input, $object); } - /** - * Resolve a macro based on the given object - * - * @param string $macro The macro to resolve - * @param MonitoredObject|stdClass $object The object used to resolve the macro - * - * @return string The new value or the macro if it cannot be resolved - */ public function resolveMacro($macro, $object) { - if (array_key_exists($macro, $this->icingaMacros) && $object->{$this->icingaMacros[$macro]} !== false) { - return $object->{$this->icingaMacros[$macro]}; - } - if (array_key_exists($macro, $object->customvars)) { - return $object->customvars[$macro]; - } - - return $macro; + return Macro::resolveMacro($macro, $object); } } diff --git a/modules/monitoring/library/Monitoring/Object/Host.php b/modules/monitoring/library/Monitoring/Object/Host.php index 6bf6b05cc..da3d66613 100644 --- a/modules/monitoring/library/Monitoring/Object/Host.php +++ b/modules/monitoring/library/Monitoring/Object/Host.php @@ -7,7 +7,7 @@ use InvalidArgumentException; use Icinga\Module\Monitoring\Backend\MonitoringBackend; /** - * A Icinga host + * An Icinga host */ class Host extends MonitoredObject { diff --git a/modules/monitoring/library/Monitoring/Object/Macro.php b/modules/monitoring/library/Monitoring/Object/Macro.php new file mode 100644 index 000000000..4a9045b58 --- /dev/null +++ b/modules/monitoring/library/Monitoring/Object/Macro.php @@ -0,0 +1,67 @@ + 'host_name', + 'HOSTADDRESS' => 'host_address', + 'SERVICEDESC' => 'service_description', + 'host.name' => 'host_name', + 'host.address' => 'host_address', + 'service.description' => 'service_description' + ); + + /** + * Return the given string with macros being resolved + * + * @param string $input The string in which to look for macros + * @param MonitoredObject|stdClass $object The host or service used to resolve macros + * + * @return string The substituted or unchanged string + */ + public static function resolveMacros($input, $object) + { + $matches = array(); + if (preg_match_all('@\$([^\$\s]+)\$@', $input, $matches)) { + foreach ($matches[1] as $key => $value) { + $newValue = self::resolveMacro($value, $object); + if ($newValue !== $value) { + $input = str_replace($matches[0][$key], $newValue, $input); + } + } + } + + return $input; + } + + /** + * Resolve a macro based on the given object + * + * @param string $macro The macro to resolve + * @param MonitoredObject|stdClass $object The object used to resolve the macro + * + * @return string The new value or the macro if it cannot be resolved + */ + public static function resolveMacro($macro, $object) + { + if (array_key_exists($macro, self::$icingaMacros) && $object->{self::$icingaMacros[$macro]} !== false) { + return $object->{self::$icingaMacros[$macro]}; + } + if (array_key_exists($macro, $object->customvars)) { + return $object->customvars[$macro]; + } + + return $macro; + } +} diff --git a/modules/monitoring/library/Monitoring/Object/Service.php b/modules/monitoring/library/Monitoring/Object/Service.php index 17fd143b5..6b5cd5bf9 100644 --- a/modules/monitoring/library/Monitoring/Object/Service.php +++ b/modules/monitoring/library/Monitoring/Object/Service.php @@ -7,7 +7,7 @@ use InvalidArgumentException; use Icinga\Module\Monitoring\Backend\MonitoringBackend; /** - * A Icinga service + * An Icinga service */ class Service extends MonitoredObject { diff --git a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php b/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php index 31bf839a3..dc05f1e3d 100644 --- a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php +++ b/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php @@ -4,10 +4,10 @@ namespace Tests\Icinga\Modules\Monitoring\Application\Views\Helpers; use Mockery; -use Zend_View_Helper_ResolveMacros; use Icinga\Test\BaseTestCase; +use Icinga\Module\Monitoring\Object\Macro; -require_once realpath(BaseTestCase::$moduleDir . '/monitoring/application/views/helpers/ResolveMacros.php'); +require_once realpath(BaseTestCase::$moduleDir . '/monitoring/library/Monitoring/Object/Macro.php'); class ResolveMacrosTest extends BaseTestCase { @@ -17,9 +17,8 @@ class ResolveMacrosTest extends BaseTestCase $hostMock->host_name = 'test'; $hostMock->host_address = '1.1.1.1'; - $helper = new Zend_View_Helper_ResolveMacros(); - $this->assertEquals($helper->resolveMacros('$HOSTNAME$', $hostMock), $hostMock->host_name); - $this->assertEquals($helper->resolveMacros('$HOSTADDRESS$', $hostMock), $hostMock->host_address); + $this->assertEquals(Macro::resolveMacros('$HOSTNAME$', $hostMock), $hostMock->host_name); + $this->assertEquals(Macro::resolveMacros('$HOSTADDRESS$', $hostMock), $hostMock->host_address); } public function testServiceMacros() @@ -29,10 +28,9 @@ class ResolveMacrosTest extends BaseTestCase $svcMock->host_address = '1.1.1.1'; $svcMock->service_description = 'a service'; - $helper = new Zend_View_Helper_ResolveMacros(); - $this->assertEquals($helper->resolveMacros('$HOSTNAME$', $svcMock), $svcMock->host_name); - $this->assertEquals($helper->resolveMacros('$HOSTADDRESS$', $svcMock), $svcMock->host_address); - $this->assertEquals($helper->resolveMacros('$SERVICEDESC$', $svcMock), $svcMock->service_description); + $this->assertEquals(Macro::resolveMacros('$HOSTNAME$', $svcMock), $svcMock->host_name); + $this->assertEquals(Macro::resolveMacros('$HOSTADDRESS$', $svcMock), $svcMock->host_address); + $this->assertEquals(Macro::resolveMacros('$SERVICEDESC$', $svcMock), $svcMock->service_description); } public function testCustomvars() @@ -42,8 +40,7 @@ class ResolveMacrosTest extends BaseTestCase 'CUSTOMVAR' => 'test' ); - $helper = new Zend_View_Helper_ResolveMacros(); - $this->assertEquals($helper->resolveMacros('$CUSTOMVAR$', $objectMock), $objectMock->customvars['CUSTOMVAR']); + $this->assertEquals(Macro::resolveMacros('$CUSTOMVAR$', $objectMock), $objectMock->customvars['CUSTOMVAR']); } public function testFaultyMacros() @@ -55,9 +52,8 @@ class ResolveMacrosTest extends BaseTestCase 'NAME' => 'st' ); - $helper = new Zend_View_Helper_ResolveMacros(); $this->assertEquals( - $helper->resolveMacros('$$HOSTNAME$ $ HOSTNAME$ $HOST$NAME$', $hostMock), + Macro::resolveMacros('$$HOSTNAME$ $ HOSTNAME$ $HOST$NAME$', $hostMock), '$test $ HOSTNAME$ teNAME$' ); } @@ -69,9 +65,8 @@ class ResolveMacrosTest extends BaseTestCase 'V€RY_SP3C|@L' => 'not too special!' ); - $helper = new Zend_View_Helper_ResolveMacros(); $this->assertEquals( - $helper->resolveMacros('$V€RY_SP3C|@L$', $objectMock), + Macro::resolveMacros('$V€RY_SP3C|@L$', $objectMock), $objectMock->customvars['V€RY_SP3C|@L'] ); } From a66949162bdb21daee4850bed261d26fa08e4118 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 May 2015 14:58:16 +0200 Subject: [PATCH 3/9] Resolve macros when accessing getters on MonitoredObjects refs #6392 --- .../scripts/show/components/actions.phtml | 9 ++------ .../views/scripts/show/components/notes.phtml | 7 ++---- .../library/Monitoring/Object/Host.php | 4 +++- .../Monitoring/Object/MonitoredObject.php | 22 ++++++++++++++++--- .../library/Monitoring/Object/Service.php | 4 +++- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/modules/monitoring/application/views/scripts/show/components/actions.phtml b/modules/monitoring/application/views/scripts/show/components/actions.phtml index 18f8a8482..78365f733 100644 --- a/modules/monitoring/application/views/scripts/show/components/actions.phtml +++ b/modules/monitoring/application/views/scripts/show/components/actions.phtml @@ -1,16 +1,11 @@ %s ', $this->translate('opens in new window')); -$links = MonitoredObject::parseAttributeUrls($object->action_url); +$links = $object->getActionUrls(); foreach ($links as $i => $link) { - $links[$i] = sprintf( - '%s ' . $newTabInfo . '', - $this->resolveMacros($object->action_url, $object), - 'Action' - ); + $links[$i] = sprintf('%s ' . $newTabInfo . '', $link, 'Action'); } if (isset($this->actions)) { diff --git a/modules/monitoring/application/views/scripts/show/components/notes.phtml b/modules/monitoring/application/views/scripts/show/components/notes.phtml index 678d70c90..4a5041e50 100644 --- a/modules/monitoring/application/views/scripts/show/components/notes.phtml +++ b/modules/monitoring/application/views/scripts/show/components/notes.phtml @@ -1,15 +1,13 @@ getNotes()); $links = $object->getNotesUrls(); -?> - +if (! empty($links) || ! empty($notes)): ?> translate('Notes') ?> resolveMacros($notes, $object); echo $notes . '
'; } // add warning to links that open in new tabs to improve accessibility, as recommended by WCAG20 G201 @@ -19,8 +17,7 @@ $links = $object->getNotesUrls(); ); $linkText = '%s ' . $newTabInfo . ''; foreach ($links as $i => $link) { - $resolved = $this->resolveMacros($link, $object); - $links[$i] = sprintf($linkText, $this->escape($resolved), $this->escape($resolved)); + $links[$i] = sprintf($linkText, $this->escape($link), $this->escape($link)); } echo implode('
', $links); ?> diff --git a/modules/monitoring/library/Monitoring/Object/Host.php b/modules/monitoring/library/Monitoring/Object/Host.php index da3d66613..dd9b4c0c1 100644 --- a/modules/monitoring/library/Monitoring/Object/Host.php +++ b/modules/monitoring/library/Monitoring/Object/Host.php @@ -192,7 +192,9 @@ class Host extends MonitoredObject public function getNotesUrls() { - return MonitoredObject::parseAttributeUrls($this->host_notes_url); + return $this->resolveAllStrings( + MonitoredObject::parseAttributeUrls($this->host_notes_url) + ); } public function getNotes() diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 37d29c82e..b68bc0539 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -569,14 +569,14 @@ abstract class MonitoredObject implements Filterable * * @return string The notes as a string */ - public function getNotes() {} + public abstract function getNotes(); /** * Get all note urls configured for this monitored object * * @return array All note urls as a string */ - public function getNotesUrls() {} + public abstract function getNotesUrls(); /** * Get all action urls configured for this monitored object @@ -585,7 +585,23 @@ abstract class MonitoredObject implements Filterable */ public function getActionUrls() { - return MonitoredObject::parseAttributeUrls($this->action_url); + return $this->resolveAllStrings( + MonitoredObject::parseAttributeUrls($this->action_url) + ); + } + + /** + * Resolve macros in all given strings in the current object context + * + * @param array $strs An array of urls as string + * @return type + */ + protected function resolveAllStrings(array $strs) + { + foreach ($strs as $i => $str) { + $strs[$i] = Macro::resolveMacros($str, $this); + } + return $strs; } /** diff --git a/modules/monitoring/library/Monitoring/Object/Service.php b/modules/monitoring/library/Monitoring/Object/Service.php index 6b5cd5bf9..cb5615df1 100644 --- a/modules/monitoring/library/Monitoring/Object/Service.php +++ b/modules/monitoring/library/Monitoring/Object/Service.php @@ -202,7 +202,9 @@ class Service extends MonitoredObject public function getNotesUrls() { - return MonitoredObject::parseAttributeUrls($this->service_notes_url); + return $this->resolveAllStrings( + MonitoredObject::parseAttributeUrls($this->service_notes_url) + ); } public function getNotes() From 60e5608b4034a4ed67b79fc8b27b18114b858eeb Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 May 2015 15:02:58 +0200 Subject: [PATCH 4/9] Rename ResolveMacroTest refs #6392 --- .../Monitoring/Object/MacroTest.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename modules/monitoring/test/php/{application/views/helpers/ResolveMacrosTest.php => library/Monitoring/Object/MacroTest.php} (98%) diff --git a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php b/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php similarity index 98% rename from modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php rename to modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php index dc05f1e3d..d328df367 100644 --- a/modules/monitoring/test/php/application/views/helpers/ResolveMacrosTest.php +++ b/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php @@ -9,7 +9,7 @@ use Icinga\Module\Monitoring\Object\Macro; require_once realpath(BaseTestCase::$moduleDir . '/monitoring/library/Monitoring/Object/Macro.php'); -class ResolveMacrosTest extends BaseTestCase +class MacroTest extends BaseTestCase { public function testHostMacros() { From 2572842aa481b4c7b7939fa13cdf9b9a315c4816 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 May 2015 15:07:46 +0200 Subject: [PATCH 5/9] Add unit test cases for the new macro syntax refs #6392 --- .../test/php/library/Monitoring/Object/MacroTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php b/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php index d328df367..88cebe63e 100644 --- a/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php +++ b/modules/monitoring/test/php/library/Monitoring/Object/MacroTest.php @@ -19,6 +19,8 @@ class MacroTest extends BaseTestCase $this->assertEquals(Macro::resolveMacros('$HOSTNAME$', $hostMock), $hostMock->host_name); $this->assertEquals(Macro::resolveMacros('$HOSTADDRESS$', $hostMock), $hostMock->host_address); + $this->assertEquals(Macro::resolveMacros('$host.name$', $hostMock), $hostMock->host_name); + $this->assertEquals(Macro::resolveMacros('$host.address$', $hostMock), $hostMock->host_address); } public function testServiceMacros() @@ -31,6 +33,9 @@ class MacroTest extends BaseTestCase $this->assertEquals(Macro::resolveMacros('$HOSTNAME$', $svcMock), $svcMock->host_name); $this->assertEquals(Macro::resolveMacros('$HOSTADDRESS$', $svcMock), $svcMock->host_address); $this->assertEquals(Macro::resolveMacros('$SERVICEDESC$', $svcMock), $svcMock->service_description); + $this->assertEquals(Macro::resolveMacros('$host.name$', $svcMock), $svcMock->host_name); + $this->assertEquals(Macro::resolveMacros('$host.address$', $svcMock), $svcMock->host_address); + $this->assertEquals(Macro::resolveMacros('$service.description', $svcMock), $svcMock->service_description); } public function testCustomvars() From 3b601decc595b07ee4673f01040f7a312c24b554 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 May 2015 15:15:07 +0200 Subject: [PATCH 6/9] Remove unused ResolceMacro Helper refs #6392 --- .../views/helpers/ResolveMacros.php | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 modules/monitoring/application/views/helpers/ResolveMacros.php diff --git a/modules/monitoring/application/views/helpers/ResolveMacros.php b/modules/monitoring/application/views/helpers/ResolveMacros.php deleted file mode 100644 index e6566936e..000000000 --- a/modules/monitoring/application/views/helpers/ResolveMacros.php +++ /dev/null @@ -1,18 +0,0 @@ - Date: Thu, 28 May 2015 15:21:56 +0200 Subject: [PATCH 7/9] Access correct resolver function in IconImage refs #6392 --- modules/monitoring/application/views/helpers/IconImage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/views/helpers/IconImage.php b/modules/monitoring/application/views/helpers/IconImage.php index ccd74ee3c..12108f30b 100644 --- a/modules/monitoring/application/views/helpers/IconImage.php +++ b/modules/monitoring/application/views/helpers/IconImage.php @@ -28,7 +28,7 @@ class Zend_View_Helper_IconImage extends Zend_View_Helper_Abstract { if ($object->host_icon_image && ! preg_match('/[\'"]/', $object->host_icon_image)) { return $this->view->img( - 'img/icons/' . Macro::resolveMacro($object->host_icon_image, $object), + 'img/icons/' . Macro::resolveMacros($object->host_icon_image, $object), null, array( 'alt' => $object->host_icon_image_alt, From a298197e6ce085fe5dfd7b1420322f34196cc1da Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 May 2015 15:31:50 +0200 Subject: [PATCH 8/9] Fix layout of action lincs in view refs #6392 --- .../application/views/scripts/show/components/actions.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/views/scripts/show/components/actions.phtml b/modules/monitoring/application/views/scripts/show/components/actions.phtml index 78365f733..329a06fb9 100644 --- a/modules/monitoring/application/views/scripts/show/components/actions.phtml +++ b/modules/monitoring/application/views/scripts/show/components/actions.phtml @@ -21,5 +21,5 @@ if (empty($links)) { ?> translate('Actions') ?> - + ", $links) ?> From c7261bd4811a371312a43722b0ba41c5e6eedc1a Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 May 2015 15:37:01 +0200 Subject: [PATCH 9/9] Add missing columns for macro expansion refs #6392 --- modules/monitoring/application/controllers/HostsController.php | 2 ++ .../monitoring/application/controllers/ServicesController.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index 20ae71e6b..961e08822 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -56,6 +56,7 @@ class Monitoring_HostsController extends Controller 'host_icon_image', 'host_icon_image_alt', 'host_name', + 'host_address', 'host_state', 'host_problem', 'host_handled', @@ -94,6 +95,7 @@ class Monitoring_HostsController extends Controller 'host_icon_image', 'host_icon_image_alt', 'host_name', + 'host_address', 'host_state', 'host_problem', 'host_handled', diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index 1a8ec9a58..097ee607b 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -53,6 +53,7 @@ class Monitoring_ServicesController extends Controller 'host_icon_image', 'host_icon_image_alt', 'host_name', + 'host_address', 'host_output', 'host_state', 'host_problem', @@ -100,6 +101,7 @@ class Monitoring_ServicesController extends Controller 'host_icon_image', 'host_icon_image_alt', 'host_name', + 'host_address', 'host_output', 'host_state', 'host_problem',