forms/Icinga*: choose type first, then go on
This commit is contained in:
parent
c5a75e0b9e
commit
da29da0065
|
@ -9,6 +9,9 @@ class IcingaCommandForm extends DirectorObjectForm
|
|||
public function setup()
|
||||
{
|
||||
$this->addObjectTypeElement();
|
||||
if (! $this->hasObjectType()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->addElement('select', 'methods_execute', array(
|
||||
'label' => $this->translate('Command type'),
|
||||
|
|
|
@ -9,6 +9,9 @@ class IcingaEndpointForm extends DirectorObjectForm
|
|||
public function setup()
|
||||
{
|
||||
$this->addObjectTypeElement();
|
||||
if (! $this->hasObjectType()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->isTemplate()) {
|
||||
$this->addElement('text', 'object_name', array(
|
||||
|
|
|
@ -10,6 +10,9 @@ class IcingaHostForm extends DirectorObjectForm
|
|||
public function setup()
|
||||
{
|
||||
$this->addObjectTypeElement();
|
||||
if (! $this->hasObjectType()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->addElement('text', 'object_name', array(
|
||||
'label' => $this->translate('Hostname'),
|
||||
|
|
|
@ -9,6 +9,9 @@ class IcingaNotificationForm extends DirectorObjectForm
|
|||
public function setup()
|
||||
{
|
||||
$this->addObjectTypeElement();
|
||||
if (! $this->hasObjectType()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->addElement('text', 'object_name', array(
|
||||
'label' => $this->translate('Notification'),
|
||||
|
|
|
@ -9,6 +9,9 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||
public function setup()
|
||||
{
|
||||
$this->addObjectTypeElement();
|
||||
if (! $this->hasObjectType()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->addElement('text', 'object_name', array(
|
||||
'label' => $this->translate('Name'),
|
||||
|
|
|
@ -893,13 +893,22 @@ print_r($object);
|
|||
. ' to assign services, notifications and groups to other objects.'
|
||||
),
|
||||
'multiOptions' => $this->optionalEnum($types),
|
||||
'value' => $default,
|
||||
'class' => 'autosubmit'
|
||||
));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function hasObjectType()
|
||||
{
|
||||
return ! $this->valueIsEmpty($this->getSentOrObjectValue('object_type'));
|
||||
}
|
||||
|
||||
protected function valueIsEmpty($value)
|
||||
{
|
||||
return strlen($value) === 0;
|
||||
}
|
||||
|
||||
protected function addZoneElement()
|
||||
{
|
||||
if ($this->isTemplate()) {
|
||||
|
|
Loading…
Reference in New Issue