diff --git a/application/forms/IcingaServiceGroupForm.php b/application/forms/IcingaServiceGroupForm.php index 9b13fb64..cc4226b5 100644 --- a/application/forms/IcingaServiceGroupForm.php +++ b/application/forms/IcingaServiceGroupForm.php @@ -2,6 +2,7 @@ namespace Icinga\Module\Director\Forms; +use Icinga\Module\Director\Objects\IcingaService; use Icinga\Module\Director\Web\Form\DirectorObjectForm; class IcingaServiceGroupForm extends DirectorObjectForm @@ -17,6 +18,21 @@ class IcingaServiceGroupForm extends DirectorObjectForm )); $this->addGroupDisplayNameElement() + ->addAssignmentElements() ->setButtons(); } + + protected function addAssignmentElements() + { + $this->addAssignFilter(array( + 'columns' => IcingaService::enumProperties($this->db, 'service.'), + 'required' => true, + 'description' => $this->translate( + 'This allows you to configure an assignment filter. Please feel' + . ' free to combine as many nested operators as you want' + ) + )); + + return $this; + } } diff --git a/library/Director/Objects/IcingaServiceGroup.php b/library/Director/Objects/IcingaServiceGroup.php index b29f51b6..937e5b5e 100644 --- a/library/Director/Objects/IcingaServiceGroup.php +++ b/library/Director/Objects/IcingaServiceGroup.php @@ -5,4 +5,9 @@ namespace Icinga\Module\Director\Objects; class IcingaServiceGroup extends IcingaObjectGroup { protected $table = 'icinga_servicegroup'; + + public function supportsAssignments() + { + return true; + } }