ServiceGroup: allow to assign them to services...

...via assignment rules

fixes #13415
This commit is contained in:
Thomas Gelf 2016-12-13 09:51:52 +01:00
parent 52f0fc9177
commit f1a61e2557
2 changed files with 21 additions and 0 deletions

View File

@ -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;
}
}

View File

@ -5,4 +5,9 @@ namespace Icinga\Module\Director\Objects;
class IcingaServiceGroup extends IcingaObjectGroup
{
protected $table = 'icinga_servicegroup';
public function supportsAssignments()
{
return true;
}
}