mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 08:44:11 +02:00
Use category_id in DataFieldForm
This commit is contained in:
parent
575fa88518
commit
19d43fae5d
@ -164,6 +164,11 @@ class DirectorDatafieldForm extends DirectorObjectForm
|
|||||||
'rows' => '3',
|
'rows' => '3',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$this->addElement('select', 'category_id', [
|
||||||
|
'label' => $this->translate('Data Field Category'),
|
||||||
|
'multiOptions' => $this->optionalEnum($this->enumCategpories()),
|
||||||
|
]);
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
try {
|
try {
|
||||||
$types = $this->enumDataTypes();
|
$types = $this->enumDataTypes();
|
||||||
@ -285,4 +290,12 @@ class DirectorDatafieldForm extends DirectorObjectForm
|
|||||||
|
|
||||||
return $enum;
|
return $enum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function enumCategpories()
|
||||||
|
{
|
||||||
|
$db = $this->getDb()->getDbAdapter();
|
||||||
|
return $db->fetchPairs(
|
||||||
|
$db->select()->from('director_datafield_category', ['id', 'category_name'])
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user