parent
e89a568fc3
commit
6005913bbd
|
@ -0,0 +1,29 @@
|
|||
<?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(
|
||||
'label' => 'Host Tpl',
|
||||
'description' => 'Host Template',
|
||||
'multiOptions' => $this->optionalEnum($this->getDb()->enumHostTemplates())
|
||||
));
|
||||
|
||||
$this->addElement('select', 'datafield_id', array(
|
||||
'label' => 'Field',
|
||||
'description' => 'Field to assign',
|
||||
'multiOptions' => $this->optionalEnum($this->getDb()->enumDatafields())
|
||||
));
|
||||
|
||||
$this->optionalBoolean(
|
||||
'is_required',
|
||||
$this->translate('Required'),
|
||||
$this->translate('Whether this filed is required or not.')
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Director\Objects;
|
||||
|
||||
use Icinga\Module\Director\Data\Db\DbObject;
|
||||
|
||||
class IcingaHostField extends DbObject
|
||||
{
|
||||
protected $keyName = array('host_id', 'datafield_id');
|
||||
|
||||
protected $table = 'icinga_host_field';
|
||||
|
||||
protected $defaultProperties = array(
|
||||
'host_id' => null,
|
||||
'datafield_id' => null,
|
||||
'is_required' => null
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue