From 285d10ef228a9d22f2ce3c2c3df3ab3dc5274441 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Fri, 26 Sep 2014 16:32:07 +0200 Subject: [PATCH] Replace Zend Note Element through Icingas Note Element fixes #7318 fixes #7309 fixes #7307 --- .../DisableNotificationsExpireCommandForm.php | 14 ++++++++------ .../Object/AcknowledgeProblemCommandForm.php | 4 ++-- .../forms/Command/Object/AddCommentCommandForm.php | 4 ++-- .../forms/Command/Object/CheckNowCommandForm.php | 4 ++-- .../Object/ScheduleServiceCheckCommandForm.php | 4 ++-- .../Object/ScheduleServiceDowntimeCommandForm.php | 4 ++-- .../forms/Config/Instance/RemoteInstanceForm.php | 2 +- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/modules/monitoring/application/forms/Command/Instance/DisableNotificationsExpireCommandForm.php b/modules/monitoring/application/forms/Command/Instance/DisableNotificationsExpireCommandForm.php index 67d2c7fc6..272fb6660 100644 --- a/modules/monitoring/application/forms/Command/Instance/DisableNotificationsExpireCommandForm.php +++ b/modules/monitoring/application/forms/Command/Instance/DisableNotificationsExpireCommandForm.php @@ -9,6 +9,7 @@ use DateInterval; use Icinga\Module\Monitoring\Command\Instance\DisableNotificationsExpireCommand; use Icinga\Module\Monitoring\Form\Command\CommandForm; use Icinga\Web\Form\Element\DateTimePicker; +use Icinga\Web\Form\Element\Note; use Icinga\Web\Notification; use Icinga\Web\Request; @@ -33,12 +34,13 @@ class DisableNotificationsExpireCommandForm extends CommandForm public function createElements(array $formData = array()) { $this->addElement( - 'note', - 'command-info', - array( - 'value' => mt( - 'monitoring', - 'This command is used to disable host and service notifications for a specific time.' + new Note( + 'command-info', + array( + 'value' => mt( + 'monitoring', + 'This command is used to disable host and service notifications for a specific time.' + ) ) ) ); diff --git a/modules/monitoring/application/forms/Command/Object/AcknowledgeProblemCommandForm.php b/modules/monitoring/application/forms/Command/Object/AcknowledgeProblemCommandForm.php index f54c8bdb2..c5b78e25c 100644 --- a/modules/monitoring/application/forms/Command/Object/AcknowledgeProblemCommandForm.php +++ b/modules/monitoring/application/forms/Command/Object/AcknowledgeProblemCommandForm.php @@ -8,6 +8,7 @@ use DateTime; use DateInterval; use Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand; use Icinga\Web\Form\Element\DateTimePicker; +use Icinga\Web\Form\Element\Note; use Icinga\Web\Notification; use Icinga\Web\Request; @@ -34,8 +35,7 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm public function createElements(array $formData = array()) { $this->addElements(array( - array( - 'note', + new Note( 'command-info', array( 'value' => mt( diff --git a/modules/monitoring/application/forms/Command/Object/AddCommentCommandForm.php b/modules/monitoring/application/forms/Command/Object/AddCommentCommandForm.php index a89353d52..1f6f9573e 100644 --- a/modules/monitoring/application/forms/Command/Object/AddCommentCommandForm.php +++ b/modules/monitoring/application/forms/Command/Object/AddCommentCommandForm.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Monitoring\Form\Command\Object; use Icinga\Module\Monitoring\Command\Object\AddCommentCommand; +use Icinga\Web\Form\Element\Note; use Icinga\Web\Notification; use Icinga\Web\Request; @@ -31,8 +32,7 @@ class AddCommentCommandForm extends ObjectsCommandForm public function createElements(array $formData = array()) { $this->addElements(array( - array( - 'note', + new Note( 'command-info', array( 'value' => mt( diff --git a/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php b/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php index a77040ee5..14e7be011 100644 --- a/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php +++ b/modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php @@ -6,6 +6,7 @@ namespace Icinga\Module\Monitoring\Form\Command\Object; use Icinga\Module\Monitoring\Command\Object\ScheduleHostCheckCommand; use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand; +use Icinga\Web\Form\Element\Note; use Icinga\Web\Notification; use Icinga\Web\Request; @@ -30,8 +31,7 @@ class CheckNowCommandForm extends ObjectsCommandForm public function addSubmitButton() { $this->addElements(array( - array( - 'note', // Bogus + new Note( 'icon', // Bogus array( 'decorators' => array(array( diff --git a/modules/monitoring/application/forms/Command/Object/ScheduleServiceCheckCommandForm.php b/modules/monitoring/application/forms/Command/Object/ScheduleServiceCheckCommandForm.php index 0a54e2af4..304ccb435 100644 --- a/modules/monitoring/application/forms/Command/Object/ScheduleServiceCheckCommandForm.php +++ b/modules/monitoring/application/forms/Command/Object/ScheduleServiceCheckCommandForm.php @@ -8,6 +8,7 @@ use DateTime; use DateInterval; use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand; use Icinga\Web\Form\Element\DateTimePicker; +use Icinga\Web\Form\Element\Note; use Icinga\Web\Notification; use Icinga\Web\Request; @@ -36,8 +37,7 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm $checkTime = new DateTime(); $checkTime->add(new DateInterval('PT1H')); $this->addElements(array( - array( - 'note', + new Note( 'command-info', array( 'value' => mt( diff --git a/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php b/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php index 86e06f071..58b391d14 100644 --- a/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php +++ b/modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php @@ -8,6 +8,7 @@ use DateTime; use DateInterval; use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand; use Icinga\Web\Form\Element\DateTimePicker; +use Icinga\Web\Form\Element\Note; use Icinga\Web\Form\Element\Number; use Icinga\Web\Notification; use Icinga\Web\Request; @@ -48,8 +49,7 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm $end = clone $start; $end->add(new DateInterval('PT1H')); $this->addElements(array( - array( - 'note', + new Note( 'command-info', array( 'value' => mt( diff --git a/modules/monitoring/application/forms/Config/Instance/RemoteInstanceForm.php b/modules/monitoring/application/forms/Config/Instance/RemoteInstanceForm.php index 0e78a0aec..c5cfd9f3f 100644 --- a/modules/monitoring/application/forms/Config/Instance/RemoteInstanceForm.php +++ b/modules/monitoring/application/forms/Config/Instance/RemoteInstanceForm.php @@ -51,7 +51,7 @@ class RemoteInstanceForm extends Form 'Enter the username to use for connecting to the remote machine or leave blank for default' ) ) - ); + );clear $this->addElement( 'text', 'path',