2015-06-02 11:56:42 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Forms;
|
|
|
|
|
2016-12-13 09:51:52 +01:00
|
|
|
use Icinga\Module\Director\Objects\IcingaService;
|
2015-06-02 11:56:42 +02:00
|
|
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
|
|
|
|
2015-06-12 12:02:51 +02:00
|
|
|
class IcingaServiceGroupForm extends DirectorObjectForm
|
2015-06-02 11:56:42 +02:00
|
|
|
{
|
|
|
|
public function setup()
|
|
|
|
{
|
2016-02-17 21:58:28 +01:00
|
|
|
$this->addHidden('object_type', 'object');
|
2016-03-09 20:55:26 +01:00
|
|
|
|
2015-07-30 11:33:08 +02:00
|
|
|
$this->addElement('text', 'object_name', array(
|
|
|
|
'label' => $this->translate('Servicegroup'),
|
|
|
|
'required' => true,
|
2016-03-09 20:55:26 +01:00
|
|
|
'description' => $this->translate('Icinga object name for this service group')
|
2015-06-02 11:56:42 +02:00
|
|
|
));
|
|
|
|
|
2016-03-09 20:55:26 +01:00
|
|
|
$this->addGroupDisplayNameElement()
|
2016-12-13 09:51:52 +01:00
|
|
|
->addAssignmentElements()
|
2016-03-09 20:55:26 +01:00
|
|
|
->setButtons();
|
2015-06-02 11:56:42 +02:00
|
|
|
}
|
2016-12-13 09:51:52 +01:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2015-06-02 11:56:42 +02:00
|
|
|
}
|