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()
|
||||
{
|
||||
// TODO: check behaviour on update!
|
||||
$objectType = $this->getSentValue('object_type', 'external_object');
|
||||
$isTemplate = $objectType === 'template';
|
||||
$this->addHidden('object_type', 'external_object');
|
||||
|
||||
$this->addElement('text', 'object_name', array(
|
||||
|
|
|
@ -8,24 +8,24 @@ class IcingaCommandForm extends DirectorObjectForm
|
|||
{
|
||||
public function setup()
|
||||
{
|
||||
if ($this->isTemplate()) {
|
||||
$this->addElement('select', 'methods_execute', array(
|
||||
'label' => $this->translate('Command type'),
|
||||
'description' => $this->translate('Whether this should be a template'),
|
||||
'multiOptions' => array(
|
||||
null => '- please choose -',
|
||||
'PluginCheck' => 'Plugin Check Command',
|
||||
'PluginNotification' => 'Notification Plugin Command',
|
||||
'PluginEvent' => 'Event Plugin Command',
|
||||
'IcingaCheck' => 'Icinga Check Command',
|
||||
'ClusterCheck' => 'Icinga Cluster Command',
|
||||
'RandomCheck' => 'Random Check Command',
|
||||
'ClusterZoneCheck' => 'Icinga Cluster Zone Check Command',
|
||||
'CrlCheck' => 'Crl Check Command',
|
||||
),
|
||||
'class' => 'autosubmit'
|
||||
));
|
||||
}
|
||||
$this->addObjectTypeElement();
|
||||
|
||||
$this->addElement('select', 'methods_execute', array(
|
||||
'label' => $this->translate('Command type'),
|
||||
'multiOptions' => array(
|
||||
null => '- please choose -',
|
||||
'PluginCheck' => 'Plugin Check Command',
|
||||
'PluginNotification' => 'Notification Plugin Command',
|
||||
'PluginEvent' => 'Event Plugin Command',
|
||||
'IcingaCheck' => 'Icinga Check Command',
|
||||
'ClusterCheck' => 'Icinga Cluster Command',
|
||||
'RandomCheck' => 'Random Check Command',
|
||||
'ClusterZoneCheck' => 'Icinga Cluster Zone Check Command',
|
||||
'CrlCheck' => 'Crl Check Command',
|
||||
),
|
||||
'required' => ! $this->isTemplate(),
|
||||
'class' => 'autosubmit'
|
||||
));
|
||||
|
||||
$this->addElement('text', 'object_name', array(
|
||||
'label' => $this->translate('Command name'),
|
||||
|
|
|
@ -8,19 +8,9 @@ class IcingaEndpointForm extends DirectorObjectForm
|
|||
{
|
||||
public function setup()
|
||||
{
|
||||
$isTemplate = $this->getSentValue('object_type') === 'template';
|
||||
/*
|
||||
$this->addElement('select', 'object_type', array(
|
||||
'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->addObjectTypeElement();
|
||||
|
||||
if ($this->isTemplate()) {
|
||||
$this->addElement('text', 'object_name', array(
|
||||
'label' => $this->translate('Endpoint template name'),
|
||||
'required' => true,
|
||||
|
|
|
@ -9,6 +9,8 @@ class IcingaHostForm extends DirectorObjectForm
|
|||
{
|
||||
public function setup()
|
||||
{
|
||||
$this->addObjectTypeElement();
|
||||
|
||||
$this->addElement('text', 'object_name', array(
|
||||
'label' => $this->translate('Hostname'),
|
||||
'required' => true,
|
||||
|
@ -66,6 +68,7 @@ class IcingaHostForm extends DirectorObjectForm
|
|||
*/
|
||||
|
||||
$elements = array(
|
||||
'object_type',
|
||||
'object_name',
|
||||
'display_name',
|
||||
'address',
|
||||
|
|
|
@ -8,6 +8,8 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||
{
|
||||
public function setup()
|
||||
{
|
||||
$this->addObjectTypeElement();
|
||||
|
||||
$this->addElement('text', 'object_name', array(
|
||||
'label' => $this->translate('Name'),
|
||||
'required' => true,
|
||||
|
|
|
@ -8,6 +8,7 @@ class IcingaServiceGroupForm extends DirectorObjectForm
|
|||
{
|
||||
public function setup()
|
||||
{
|
||||
$this->addHidden('object_type', 'object');
|
||||
$this->addElement('text', 'object_name', array(
|
||||
'label' => $this->translate('Servicegroup'),
|
||||
'required' => true,
|
||||
|
|
Loading…
Reference in New Issue