Commit 5004123b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4529 The category in department and organization should be a dropdown...

Fixes #4529 The category in department and organization should be a dropdown filled from the configuration backend
parent e0902c86
......@@ -392,6 +392,12 @@ attributetype ( 1.3.6.1.4.1.38414.8.18.6 NAME 'fdAclTabOnObjects'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
SINGLE-VALUE )
attributetype ( 1.3.6.1.4.1.38414.8.18.7 NAME 'fdDepartmentCategories'
DESC 'FusionDirectory - available categories for departments'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Plugins
attributetype ( 1.3.6.1.4.1.38414.8.19.1 NAME 'fdOGroupRDN'
......@@ -566,7 +572,7 @@ objectclass ( 1.3.6.1.4.1.38414.8.2.1 NAME 'fusionDirectoryConf'
fdDisplayErrors $ fdLdapMaxQueryTime $ fdLdapStats $ fdDebugLevel $
fdEnableSnapshots $ fdSnapshotBase $
fdTabHook $ fdShells $ fdDisplayHookOutput $
fdAclTabOnObjects $
fdAclTabOnObjects $ fdDepartmentCategories $
fdRfc2307bis $ fdCopyPaste $ fdSnapshotURI $
fdSnapshotAdminDn $ fdSnapshotAdminPassword $ fdPersonalTitleInDN $ fdAccountRDN $
fdSslCaCertPath $ fdSslKeyPath $ fdSslCertPath $
......
......@@ -73,7 +73,7 @@ class department extends simplePlugin
_('Description'), sprintf(_('Short description of this %s'), $name),
'description', TRUE
),
new StringAttribute(
new SelectAttribute(
_('Category'), sprintf(_('Category of this %s'), $name),
'businessCategory', FALSE
),
......@@ -141,6 +141,15 @@ class department extends simplePlugin
parent::__construct($config, $dn, $object);
$categoriesList = $this->config->get_cfg_value('DepartmentCategories', array());
/* Insert current value to possibilities */
$businessCategory = $this->attributesAccess['businessCategory']->getValue();
if (($businessCategory != "") && !in_array($businessCategory, $categoriesList)) {
$categoriesList[] = $businessCategory;
}
$this->attributesAccess['businessCategory']->setChoices($categoriesList);
$this->attributesAccess[$this->getNamingAttr()]->setUnique(TRUE);
}
......
......@@ -444,6 +444,13 @@ class configInLdap extends simplePlugin
_('For very specific ACL rights setting where you might need to give right on a single object.'),
'fdAclTabOnObjects'
),
new SetAttribute(
new StringAttribute (
_('Available department categories'), _('Available categories in the departments dropdown'),
'fdDepartmentCategories', FALSE
),
array()
),
)
),
);
......
Supports Markdown
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