2015-07-28 15:20:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Forms;
|
|
|
|
|
|
|
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
|
|
|
|
|
|
|
class IcingaHostFieldForm extends DirectorObjectForm
|
|
|
|
{
|
|
|
|
public function setup()
|
|
|
|
{
|
|
|
|
$this->addElement('select', 'host_id', array(
|
2015-07-30 11:33:08 +02:00
|
|
|
'label' => 'Host Tpl',
|
|
|
|
'description' => 'Host Template',
|
|
|
|
'multiOptions' => $this->optionalEnum($this->db->enumHostTemplates())
|
2015-07-28 15:20:33 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
$this->addElement('select', 'datafield_id', array(
|
2015-07-30 11:33:08 +02:00
|
|
|
'label' => 'Field',
|
|
|
|
'description' => 'Field to assign',
|
|
|
|
'multiOptions' => $this->optionalEnum($this->db->enumDatafields())
|
2015-07-28 15:20:33 +02:00
|
|
|
));
|
|
|
|
|
|
|
|
$this->optionalBoolean(
|
|
|
|
'is_required',
|
|
|
|
$this->translate('Required'),
|
2015-07-30 11:33:08 +02:00
|
|
|
$this->translate('Whether this field should be required or not')
|
2015-07-28 15:20:33 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|