From 31e2b23d82b11e17a1721ab449901e8049348764 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 28 Jul 2015 15:21:44 +0200 Subject: [PATCH] IcingaServiceField: Implement the field assignment refs #9752 --- application/forms/IcingaServiceFieldForm.php | 29 +++++++++++++++++++ .../Director/Objects/IcingaServiceField.php | 18 ++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 application/forms/IcingaServiceFieldForm.php create mode 100644 library/Director/Objects/IcingaServiceField.php diff --git a/application/forms/IcingaServiceFieldForm.php b/application/forms/IcingaServiceFieldForm.php new file mode 100644 index 00000000..49c506a9 --- /dev/null +++ b/application/forms/IcingaServiceFieldForm.php @@ -0,0 +1,29 @@ +addElement('select', 'service_id', array( + 'label' => 'Service Tpl', + 'description' => 'Service Template', + 'multiOptions' => $this->optionalEnum($this->getDb()->enumServiceTemplates()) + )); + + $this->addElement('select', 'datafield_id', array( + 'label' => 'Field', + 'description' => 'Field to assign', + 'multiOptions' => $this->optionalEnum($this->getDb()->enumDatafields()) + )); + + $this->optionalBoolean( + 'is_required', + $this->translate('Required'), + $this->translate('Whether this filed is required or not.') + ); + } +} diff --git a/library/Director/Objects/IcingaServiceField.php b/library/Director/Objects/IcingaServiceField.php new file mode 100644 index 00000000..af55dc46 --- /dev/null +++ b/library/Director/Objects/IcingaServiceField.php @@ -0,0 +1,18 @@ + null, + 'datafield_id' => null, + 'is_required' => null + ); +}