mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-27 07:44:05 +02:00
forms: use object_type element
This commit is contained in:
parent
7b1c17799d
commit
8b39a223f8
@ -8,9 +8,6 @@ class IcingaApiUserForm extends DirectorObjectForm
|
|||||||
{
|
{
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
// TODO: check behaviour on update!
|
|
||||||
$objectType = $this->getSentValue('object_type', 'external_object');
|
|
||||||
$isTemplate = $objectType === 'template';
|
|
||||||
$this->addHidden('object_type', 'external_object');
|
$this->addHidden('object_type', 'external_object');
|
||||||
|
|
||||||
$this->addElement('text', 'object_name', array(
|
$this->addElement('text', 'object_name', array(
|
||||||
|
@ -8,24 +8,24 @@ class IcingaCommandForm extends DirectorObjectForm
|
|||||||
{
|
{
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
if ($this->isTemplate()) {
|
$this->addObjectTypeElement();
|
||||||
$this->addElement('select', 'methods_execute', array(
|
|
||||||
'label' => $this->translate('Command type'),
|
$this->addElement('select', 'methods_execute', array(
|
||||||
'description' => $this->translate('Whether this should be a template'),
|
'label' => $this->translate('Command type'),
|
||||||
'multiOptions' => array(
|
'multiOptions' => array(
|
||||||
null => '- please choose -',
|
null => '- please choose -',
|
||||||
'PluginCheck' => 'Plugin Check Command',
|
'PluginCheck' => 'Plugin Check Command',
|
||||||
'PluginNotification' => 'Notification Plugin Command',
|
'PluginNotification' => 'Notification Plugin Command',
|
||||||
'PluginEvent' => 'Event Plugin Command',
|
'PluginEvent' => 'Event Plugin Command',
|
||||||
'IcingaCheck' => 'Icinga Check Command',
|
'IcingaCheck' => 'Icinga Check Command',
|
||||||
'ClusterCheck' => 'Icinga Cluster Command',
|
'ClusterCheck' => 'Icinga Cluster Command',
|
||||||
'RandomCheck' => 'Random Check Command',
|
'RandomCheck' => 'Random Check Command',
|
||||||
'ClusterZoneCheck' => 'Icinga Cluster Zone Check Command',
|
'ClusterZoneCheck' => 'Icinga Cluster Zone Check Command',
|
||||||
'CrlCheck' => 'Crl Check Command',
|
'CrlCheck' => 'Crl Check Command',
|
||||||
),
|
),
|
||||||
'class' => 'autosubmit'
|
'required' => ! $this->isTemplate(),
|
||||||
));
|
'class' => 'autosubmit'
|
||||||
}
|
));
|
||||||
|
|
||||||
$this->addElement('text', 'object_name', array(
|
$this->addElement('text', 'object_name', array(
|
||||||
'label' => $this->translate('Command name'),
|
'label' => $this->translate('Command name'),
|
||||||
|
@ -8,19 +8,9 @@ class IcingaEndpointForm extends DirectorObjectForm
|
|||||||
{
|
{
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
$isTemplate = $this->getSentValue('object_type') === 'template';
|
$this->addObjectTypeElement();
|
||||||
/*
|
|
||||||
$this->addElement('select', 'object_type', array(
|
if ($this->isTemplate()) {
|
||||||
'label' => $this->translate('Object type'),
|
|
||||||
'description' => $this->translate('Whether this should be a template'),
|
|
||||||
'multiOptions' => array(
|
|
||||||
null => '- please choose -',
|
|
||||||
'object' => 'Endpoint object',
|
|
||||||
'template' => 'Endpoint template',
|
|
||||||
)
|
|
||||||
));
|
|
||||||
*/
|
|
||||||
if ($isTemplate) {
|
|
||||||
$this->addElement('text', 'object_name', array(
|
$this->addElement('text', 'object_name', array(
|
||||||
'label' => $this->translate('Endpoint template name'),
|
'label' => $this->translate('Endpoint template name'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
@ -9,6 +9,8 @@ class IcingaHostForm extends DirectorObjectForm
|
|||||||
{
|
{
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
|
$this->addObjectTypeElement();
|
||||||
|
|
||||||
$this->addElement('text', 'object_name', array(
|
$this->addElement('text', 'object_name', array(
|
||||||
'label' => $this->translate('Hostname'),
|
'label' => $this->translate('Hostname'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
@ -66,6 +68,7 @@ class IcingaHostForm extends DirectorObjectForm
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$elements = array(
|
$elements = array(
|
||||||
|
'object_type',
|
||||||
'object_name',
|
'object_name',
|
||||||
'display_name',
|
'display_name',
|
||||||
'address',
|
'address',
|
||||||
|
@ -8,6 +8,8 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||||||
{
|
{
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
|
$this->addObjectTypeElement();
|
||||||
|
|
||||||
$this->addElement('text', 'object_name', array(
|
$this->addElement('text', 'object_name', array(
|
||||||
'label' => $this->translate('Name'),
|
'label' => $this->translate('Name'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
@ -8,6 +8,7 @@ class IcingaServiceGroupForm extends DirectorObjectForm
|
|||||||
{
|
{
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
|
$this->addHidden('object_type', 'object');
|
||||||
$this->addElement('text', 'object_name', array(
|
$this->addElement('text', 'object_name', array(
|
||||||
'label' => $this->translate('Servicegroup'),
|
'label' => $this->translate('Servicegroup'),
|
||||||
'required' => true,
|
'required' => true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user