Skip to content

Commit

Permalink
ServiceGroup: allow to assign them to services...
Browse files Browse the repository at this point in the history
...via assignment rules

fixes #13415
  • Loading branch information
Thomas-Gelf committed Dec 13, 2016
1 parent 52f0fc9 commit f1a61e2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions application/forms/IcingaServiceGroupForm.php
Expand Up @@ -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
Expand All @@ -17,6 +18,21 @@ public function setup()
));

$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;
}
}
5 changes: 5 additions & 0 deletions library/Director/Objects/IcingaServiceGroup.php
Expand Up @@ -5,4 +5,9 @@
class IcingaServiceGroup extends IcingaObjectGroup
{
protected $table = 'icinga_servicegroup';

public function supportsAssignments()
{
return true;
}
}

0 comments on commit f1a61e2

Please sign in to comment.