mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-22 13:24:25 +02:00
parent
41868de7f1
commit
e6e51dc2be
@ -288,25 +288,30 @@ class SyncPropertyForm extends DirectorObjectForm
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($dummy->listProperties() as $prop) {
|
foreach ($dummy->listProperties() as $prop) {
|
||||||
if ($prop === 'id') {
|
if ($dummy instanceof IcingaObject && $prop === 'id') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: allow those fields, but munge them (store ids)
|
// TODO: allow those fields, but munge them (store ids)
|
||||||
//if (preg_match('~_id$~', $prop)) continue;
|
//if (preg_match('~_id$~', $prop)) continue;
|
||||||
if (substr($prop, -3) === '_id') {
|
if (substr($prop, -3) === '_id') {
|
||||||
|
if ($dummy instanceof IcingaObject) {
|
||||||
|
if ($dummy->hasRelation($prop)) {
|
||||||
$prop = substr($prop, 0, -3);
|
$prop = substr($prop, 0, -3);
|
||||||
if (! $dummy instanceof IcingaObject || ! $dummy->hasRelation($prop)) {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$props[$prop] = $prop;
|
$props[$prop] = $prop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($dummy instanceof IcingaObject) {
|
||||||
foreach ($dummy->listMultiRelations() as $prop) {
|
foreach ($dummy->listMultiRelations() as $prop) {
|
||||||
$props[$prop] = sprintf('%s (%s)', $prop, $this->translate('a list'));
|
$props[$prop] = sprintf('%s (%s)', $prop, $this->translate('a list'));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ksort($props);
|
ksort($props);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user