mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
Revert "Allow IcingaService to be cloned to a different host"
This reverts commit aeebc0f0bb1f201d512a16a237ee545d84e72839.
This commit is contained in:
parent
a9e9a73624
commit
1eebc49bdd
@ -55,26 +55,15 @@ class IcingaCloneObjectForm extends DirectorForm
|
||||
], 'y');
|
||||
}
|
||||
|
||||
if ($this->object instanceof IcingaService) {
|
||||
if ($this->object->get('service_set_id') !== null) {
|
||||
$this->addElement('select', 'target_service_set', [
|
||||
'label' => $this->translate('Target Service Set'),
|
||||
'description' => $this->translate(
|
||||
'Clone this service to the very same or to another Service Set'
|
||||
),
|
||||
'multiOptions' => $this->enumServiceSets(),
|
||||
'value' => $this->object->get('service_set_id')
|
||||
]);
|
||||
} elseif ($this->object->get('host_id') !== null) {
|
||||
$this->addElement('select', 'target_host', [
|
||||
'label' => $this->translate('Target Host'),
|
||||
'description' => $this->translate(
|
||||
'Clone this service to the very same or to another Host'
|
||||
),
|
||||
'multiOptions' => $this->optionalEnum($this->enumHostsAndTemplates()),
|
||||
'value' => $this->object->get('host_id')
|
||||
]);
|
||||
}
|
||||
if ($this->object instanceof IcingaService && $this->object->get('service_set_id') !== null) {
|
||||
$this->addElement('select', 'target_service_set', [
|
||||
'label' => $this->translate('Target Service Set'),
|
||||
'description' => $this->translate(
|
||||
'Clone this service to the very same or to another Service Set'
|
||||
),
|
||||
'multiOptions' => $this->enumServiceSets(),
|
||||
'value' => $this->object->get('service_set_id')
|
||||
]);
|
||||
}
|
||||
|
||||
if ($this->object->isTemplate() && $this->object->supportsFields()) {
|
||||
@ -92,16 +81,6 @@ class IcingaCloneObjectForm extends DirectorForm
|
||||
);
|
||||
}
|
||||
|
||||
protected function enumHostsAndTemplates()
|
||||
{
|
||||
$db = $this->object->getConnection();
|
||||
|
||||
return [
|
||||
$this->translate('Templates') => $db->enumHostTemplates(),
|
||||
$this->translate('Hosts') => $db->enumHosts(),
|
||||
];
|
||||
}
|
||||
|
||||
public function onSuccess()
|
||||
{
|
||||
$object = $this->object;
|
||||
@ -140,11 +119,6 @@ class IcingaCloneObjectForm extends DirectorForm
|
||||
'service_set_id',
|
||||
IcingaServiceSet::loadWithAutoIncId((int) $set, $connection)->get('id')
|
||||
);
|
||||
} elseif ($host = $this->getValue('target_host')) {
|
||||
$new->set(
|
||||
'host_id',
|
||||
IcingaHost::loadWithAutoIncId((int) $host, $connection)->get('id')
|
||||
);
|
||||
}
|
||||
|
||||
$services = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user