SyncPropertyForm: allow to sync m:n relations

This commit is contained in:
Thomas Gelf 2016-10-12 08:59:42 +00:00
parent acbce05c08
commit c044de89de
2 changed files with 12 additions and 0 deletions

View File

@ -260,6 +260,9 @@ class SyncPropertyForm extends DirectorObjectForm
if ($dummy->supportsGroups()) {
$special['groups'] = $this->translate('Group membership');
}
if ($dummy->supportsRanges()) {
$special['ranges'] = $this->translate('Time ranges');
}
}
foreach ($dummy->listProperties() as $prop) {
@ -279,6 +282,10 @@ class SyncPropertyForm extends DirectorObjectForm
$props[$prop] = $prop;
}
foreach ($dummy->listMultiRelations() as $prop) {
$props[$prop] = sprintf('%s (%s)', $prop, $this->translate('a list'));
}
ksort($props);
return array(

View File

@ -163,6 +163,11 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return array_key_exists($property, $this->multiRelations);
}
public function listMultiRelations()
{
return array_keys($this->multiRelations);
}
public function getMultiRelation($property)
{
if (! $this->hasLoadedMultiRelation($property)) {