mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
parent
6005913bbd
commit
31e2b23d82
29
application/forms/IcingaServiceFieldForm.php
Normal file
29
application/forms/IcingaServiceFieldForm.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Icinga\Module\Director\Forms;
|
||||||
|
|
||||||
|
use Icinga\Module\Director\Web\Form\DirectorObjectForm;
|
||||||
|
|
||||||
|
class IcingaServiceFieldForm extends DirectorObjectForm
|
||||||
|
{
|
||||||
|
public function setup()
|
||||||
|
{
|
||||||
|
$this->addElement('select', 'service_id', array(
|
||||||
|
'label' => 'Service Tpl',
|
||||||
|
'description' => 'Service Template',
|
||||||
|
'multiOptions' => $this->optionalEnum($this->getDb()->enumServiceTemplates())
|
||||||
|
));
|
||||||
|
|
||||||
|
$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.')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
18
library/Director/Objects/IcingaServiceField.php
Normal file
18
library/Director/Objects/IcingaServiceField.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Icinga\Module\Director\Objects;
|
||||||
|
|
||||||
|
use Icinga\Module\Director\Data\Db\DbObject;
|
||||||
|
|
||||||
|
class IcingaServiceField extends DbObject
|
||||||
|
{
|
||||||
|
protected $keyName = array('service_id', 'datafield_id');
|
||||||
|
|
||||||
|
protected $table = 'icinga_service_field';
|
||||||
|
|
||||||
|
protected $defaultProperties = array(
|
||||||
|
'service_id' => null,
|
||||||
|
'datafield_id' => null,
|
||||||
|
'is_required' => null
|
||||||
|
);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user