Verified Commit 8be5d248 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚜 fix(plugins) Adapt code to changes on Object*Attribute in core

issue #6043
parent e91f3437
......@@ -42,8 +42,8 @@ class dhcpService extends dhcpPlugin
'ddns-update-style none'
]
);
$attributesInfo['main']['attrs'][] = new ObjectSelectAttribute(_('DHCP Primary'), _('Primary DHCP server'), 'dhcpPrimaryDN', FALSE, 'server');
$attributesInfo['main']['attrs'][] = new ObjectSelectAttribute(_('DHCP Secondary'), _('Secondary DHCP server'), 'dhcpSecondaryDN', FALSE, 'server');
$attributesInfo['main']['attrs'][] = new ObjectSelectAttribute(_('DHCP Primary'), _('Primary DHCP server'), 'dhcpPrimaryDN', FALSE, ['server']);
$attributesInfo['main']['attrs'][] = new ObjectSelectAttribute(_('DHCP Secondary'), _('Secondary DHCP server'), 'dhcpSecondaryDN', FALSE, ['server']);
return $attributesInfo;
}
}
......@@ -54,9 +54,10 @@ class networkInterface extends simplePlugin
_('Mac address'), _('Mac address of this system'),
'macAddress', FALSE
),
new SelectAttribute(
new ObjectSelectAttribute(
_('VLAN'), _('VLAN'),
'fdNetworkInterfaceVlanId', FALSE
'fdNetworkInterfaceVlanId', FALSE,
['ipamVlan'], 'fdIpamVlanInnerId'
),
new StringAttribute(
_('VLAN tag'), _('VLAN tag'),
......@@ -65,7 +66,7 @@ class networkInterface extends simplePlugin
new ObjectSelectAttribute(
_('Subnet'), _('Subnet'),
'fdNetworkInterfaceSubnetDN', FALSE,
'ipamSubnet'
['ipamSubnet']
),
new SetAttribute(
new IPAttribute(
......@@ -83,8 +84,5 @@ class networkInterface extends simplePlugin
global $config;
parent::__construct($dn, $object, $parent, $mainTab);
$vlans = objects::ls('ipamVlan', ['fdIpamVlanInnerId' => 1,'cn' => 1]);
$this->attributesAccess['fdNetworkInterfaceVlanId']->setChoices(array_column($vlans, 'fdIpamVlanInnerId'), array_column($vlans, 'cn'));
}
}
......@@ -21,9 +21,9 @@
class ImportServerAttribute extends ObjectSelectAttribute
{
function __construct ($label, $description, $ldapName, $filter, $acl = "")
function __construct (string $label, string $description, string $ldapName, $objectFilter = '', $acl = '')
{
parent::__construct($label, $description, $ldapName, TRUE, 'server', NULL, $filter, $acl);
parent::__construct($label, $description, $ldapName, TRUE, ['server'], 'dn', 'nameAttr', $objectFilter, $acl);
$this->setInLdap(FALSE);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment