...
 
Commits (3)
......@@ -31,9 +31,10 @@ class term extends simplePlugin
'name' => _('Terms Lists'),
'icon' => 'geticon.php?context=applications&icon=term&size=16',
'ou' => get_ou('fdTaxonomyTermsRDN'),
]],
//'plSearchAttrs' => ['description'],
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo(), TRUE)
'mainAttr' => 'fdTaxonomyTermCode',
]],
'plSearchAttrs' => ['description'],
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo(), TRUE)
];
}
......@@ -48,21 +49,25 @@ class term extends simplePlugin
_('Code'), _('Code name of Term'),
'fdTaxonomyTermCode', TRUE
),
new StringAttribute(
_('Description'), _('Short description of this terms'),
'description', FALSE
),
new StringAttribute(
_('Referentiel'), _('Referentiel used'),
'fdTaxonomyReferentiel', FALSE
new SelectAttribute(
_('Referentiel'), _('Referentiel used'),
'ReferentielAndTaxonomy', FALSE,
[],
),
new TextAreaAttribute(
_('Term Long Label'), _('Long Label of Term code'),
'fdTaxonomyTermLongLabel', FALSE
),
new StringAttribute(
new HiddenArrayAttribute('fdTaxonomyReferentiel',FALSE,[] ),
new HiddenArrayAttribute('fdTaxonomyName',FALSE,[]),
/*new StringAttribute(
_('Taxonomy Name'), _('Name of taxonomy belonging to the Referentiel'),
'fdTaxonomyName', FALSE
),
),*/
new TextAreaAttribute(
_('Term Long Label'), _('Long Label of Term code'),
'fdTaxonomyTermLongLabel', FALSE
_('Description'), _('Short description of this terms'),
'description', FALSE
),
new DateAttribute(
_('StartDate'), _('Start Date of validity '),
......@@ -75,7 +80,7 @@ class term extends simplePlugin
'fdTaxonomyTermEndDate', FALSE,
'Ymd', '',
'today', NULL
)
),
]
]
];
......@@ -85,47 +90,23 @@ class term extends simplePlugin
{
global $config;
parent::__construct($dn, $object, $parent, $mainTab);
foreach ($config->get_cfg_value('TaxonomyList', []) as $taxonomy) {
list($referentiel, $taxonomy,$policy,$startDate,$endDate) = explode(';', $taxonomy);
// TODO : test the policy and the start/end Date
$ref_tax[] = $referentiel.">".$taxonomy;
}
$initval=$this->fdTaxonomyReferentiel[0].">".$this->fdTaxonomyName[0];
//list($code_entites, $label_entites) = static::listPossibleParentEntities();
//$this->attributesAccess['supannCodeEntiteParent']->attribute->setChoices($code_entites, $label_entites);
//$this->attributesAccess['ou']->setUnique('one');
//$this->attributesAccess['supannCodeEntite']->setUnique('whole', '(objectClass=supannEntite)');
//$this->attributesAccess['supannRefId']->setUnique('whole', '(objectClass=supannEntite)');
$this->attributesAccess['ReferentielAndTaxonomy']->setChoices($ref_tax);
}
//static public function listPossibleParentEntities (): array
//{
//global $config;
//$ldap = $config->get_ldap_link();
//$ldap->cd($config->current['BASE']);
//$ldap->search('(objectClass=supannEntite)', ['supannCodeEntite','ou','o','description']);
//$code_entites = [''];
//$label_entites = [''];
//while ($attrs = $ldap->fetch()) {
//if (isset($attrs['supannCodeEntite'][0])) {
//$code_entites[] = $attrs['supannCodeEntite'][0];
//if (isset($attrs['description'][0])) {
//$description = $attrs['description'][0];
//if (mb_strlen($description, 'UTF-8') > 30) {
//$description = mb_substr($description, 0, 27, 'UTF-8').'...';
//}
//$description = ' ('.$description.')';
//} else {
//$description = '';
//}
//if (isset($attrs['ou'][0])) {
//$label_entites[] = $attrs['ou'][0].$description;
//} else {
//$label_entites[] = $attrs['o'][0].$description;
//}
//}
//}
//return [$code_entites, $label_entites];
//}
protected function prepare_save (): array
{
$refAndTex = $this->attributesAccess['ReferentielAndTaxonomy']->getValue();
$hRefAndTex = explode('>', $refAndTex);
$this->fdTaxonomyReferentiel = $hRefAndTex[0];
$this->fdTaxonomyName = $hRefAndTex[1];
$this->ReferentielAndTaxonomy='';
return parent::prepare_save();
}
}
......@@ -25,10 +25,10 @@ class termManagement extends management
public static $columns = [
['ObjectTypeColumn', []],
['LinkColumn', ['attributes' => 'fdTaxonomyCode', 'label' => 'Name']],
['LinkColumn', ['attributes' => 'fdTaxonomyTerm', 'label' => 'Term']],
['LinkColumn', ['attributes' => 'mainAttr', 'label' => 'Name']],
['LinkColumn', ['attributes' => 'fdTaxonomyReferentiel', 'label' => 'Referentiel']],
['LinkColumn', ['attributes' => 'description', 'label' => 'Description']],
['LinkColumn', ['attributes' => 'fdTaxonomyName', 'label' => 'Taxonomy']],
['LinkColumn', ['attributes' => 'description', 'label' => 'Description']],
['ActionsColumn', ['label' => 'Actions']],
];
......
......@@ -11,10 +11,10 @@ attributetype ( 1.3.6.1.4.1.38414.81.10.1 NAME 'fdTaxonomyTermCode'
SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.81.10.2 NAME 'fdTaxonomyTermLongLabel'
DESC 'FusionDirectory - Long Label of a term belong to a taxonomy'
DESC 'FusionDirectory - long label of a term'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
attributetype ( 1.3.6.1.4.1.38414.81.10.3 NAME 'fdTaxonomyReferentiel'
DESC 'FusionDirectory - Referentiel which contain the term'
......@@ -29,23 +29,20 @@ attributetype ( 1.3.6.1.4.1.38414.81.10.4 NAME 'fdTaxonomyName'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
attributetype ( 1.3.6.1.4.1.38414.81.10.5 NAME 'fdTaxonomyTermStartDate'
DESC 'FusionDirectory - Term Validation start date'
DESC 'FusionDirectory - Term validity start date'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
attributetype ( 1.3.6.1.4.1.38414.81.10.6 NAME 'fdTaxonomyTermEndDate'
DESC 'FusionDirectory - Term Validation End date'
DESC 'FusionDirectory - Term validity end date'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
# Object Class
objectclass ( 1.3.6.1.4.1.38414.81.20.1 NAME 'fdTaxonomyTerms'
DESC 'FusionDirectory Taxonomy plugin configuration'
SUP top AUXILIARY
DESC 'FusionDirectory Taxonomy Terms Management'
MUST ( fdTaxonomyTermCode )
MAY (
fdTaxonomyTermLongLabel $ fdTaxonomyReferentiel $ fdTaxonomyName $ fdTaxonomyTermStartDate $ fdTaxonomyTermEndDate $ description
......