From 66592ecabf1f15f554505a0aa4ffb8d553da80b4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 2 Aug 2013 16:55:28 +0200 Subject: [PATCH] Enable dynamic form elements Expire time of the AcknowledgeForm and hours as well as minutes of the ScheduleDowntimeForm are now dynamic. refs #4439 --- library/Icinga/Web/Form.php | 2 -- .../application/forms/Command/AcknowledgeForm.php | 8 ++++++++ .../application/forms/Command/ScheduleDowntimeForm.php | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index 0f2b06487..797f749da 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -365,12 +365,10 @@ abstract class Form extends Zend_Form if ($this->getElement($this->tokenElementName) === null) { return false; } - if (strpos($elementValue, '|') === false) { return false; } - list($seed, $token) = explode('|', $elementValue); if (!is_numeric($seed)) { diff --git a/modules/monitoring/application/forms/Command/AcknowledgeForm.php b/modules/monitoring/application/forms/Command/AcknowledgeForm.php index 0a4f93578..6c2deda55 100644 --- a/modules/monitoring/application/forms/Command/AcknowledgeForm.php +++ b/modules/monitoring/application/forms/Command/AcknowledgeForm.php @@ -39,6 +39,14 @@ use Icinga\Protocol\Commandpipe\Comment; */ class AcknowledgeForm extends CommandForm { + /** + * Initialize form + */ + public function init() + { + $this->setName('AcknowledgeForm'); + } + /** * Interface method to build the form * @see CommandForm::create diff --git a/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php b/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php index 5bb1e8e49..1ac6afada 100644 --- a/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php +++ b/modules/monitoring/application/forms/Command/ScheduleDowntimeForm.php @@ -58,6 +58,14 @@ class ScheduleDowntimeForm extends WithChildrenCommandForm */ const TYPE_FLEXIBLE = 'flexible'; + /** + * Initialize form + */ + public function init() + { + $this->setName('ScheduleDowntimeForm'); + } + /** * Build an array of timestamps *