From cdc3d43a048800df5037616c4a79cc3c5a791d82 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 5 Dec 2016 13:20:27 +0100 Subject: [PATCH] Respect newlines in host and service notes fixes #12313 --- .../views/scripts/show/components/notes.phtml | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/application/views/scripts/show/components/notes.phtml b/modules/monitoring/application/views/scripts/show/components/notes.phtml index 25c1d8ecb..c4c12f80e 100644 --- a/modules/monitoring/application/views/scripts/show/components/notes.phtml +++ b/modules/monitoring/application/views/scripts/show/components/notes.phtml @@ -2,16 +2,10 @@ use Icinga\Web\Navigation\Navigation; -$navigation = new Navigation(); -//$navigation->load($object->getType() . '-note'); -foreach ($navigation as $item) { - $item->setObject($object); -} +/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ -$notes = trim($object->getNotes()); -if ($notes) { - $navigation->addItem($notes); -} +$navigation = new Navigation(); +$notes = trim($object->notes); $links = $object->getNotesUrls(); if (! empty($links)) { @@ -35,11 +29,16 @@ if (! empty($links)) { } } -if ($navigation->isEmpty() || !$navigation->hasRenderableItems()) { +if (($navigation->isEmpty() || ! $navigation->hasRenderableItems()) && $notes === '') { return; } ?> - translate('Notes'); ?> - getRenderer()->setElementTag('td')->setCssClass('notes'); ?> + translate('Notes') ?> + + getRenderer() ?> + +

nl2br($this->escape($notes)) ?>

+ + \ No newline at end of file