diff --git a/supann/config/supann/class_supannConfig.inc b/supann/config/supann/class_supannConfig.inc index abf5b083c929da00b25c7406d9eea465077fd28d..600ce5e156178eb3029a7a23aadbc08bd2465ce1 100644 --- a/supann/config/supann/class_supannConfig.inc +++ b/supann/config/supann/class_supannConfig.inc @@ -26,14 +26,14 @@ class supannConfig extends simplePlugin static function plInfo (): array { return [ - 'plShortName' => _('SupAnn'), - 'plTitle' => _('SupAnn configuration'), - 'plDescription' => _('FusionDirectory SupAnn plugin configuration'), - 'plObjectClass' => ['fdSupannPluginConf'], - 'plPriority' => 10, - 'plObjectType' => ['configuration'], + 'plShortName' => _('SupAnn'), + 'plTitle' => _('SupAnn configuration'), + 'plDescription' => _('FusionDirectory SupAnn plugin configuration'), + 'plObjectClass' => ['fdSupannPluginConf'], + 'plPriority' => 10, + 'plObjectType' => ['configuration'], - 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) + 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) ]; } @@ -43,11 +43,11 @@ class supannConfig extends simplePlugin $defaultStates = []; foreach ($officialStates as $state => $substates) { foreach (array_keys($substates) as $substate) { - $defaultStates[] = $state.':'.$substate; + $defaultStates[] = $state . ':' . $substate; } } return [ - 'main' => [ + 'main' => [ 'name' => _('SupAnn'), 'class' => ['fullwidth'], 'attrs' => [ @@ -134,7 +134,7 @@ class supannConfig extends simplePlugin ), ], ], - 'status' => [ + 'status' => [ 'name' => _('Status'), 'class' => ['fullwidth'], 'attrs' => [ @@ -168,7 +168,7 @@ class supannConfig extends simplePlugin new SelectAttribute( _('Status'), _('Active status this substatus is tied to'), 'fdSupannRessourceSubStates_status', TRUE, - ['A','I','S'], 'A', + ['A', 'I', 'S'], 'A', [_('Active'), _('Inactive'), _('Suspended')] ), new StringAttribute( @@ -207,7 +207,7 @@ class supannConfig extends simplePlugin ), ], ], - 'cms' => [ + 'cms' => [ 'name' => _('Multiservice card'), 'class' => ['fullwidth'], 'attrs' => [ @@ -311,7 +311,7 @@ class supannConfig extends simplePlugin ), ] ], - 'consent' => [ + 'consent' => [ 'name' => _('Consent'), 'class' => ['fullwidth'], 'attrs' => [ @@ -375,7 +375,7 @@ class supannConfig extends simplePlugin ), ] ], - 'features' => [ + 'features' => [ 'name' => _('Features'), 'attrs' => [ new BooleanAttribute( @@ -403,6 +403,25 @@ class supannConfig extends simplePlugin 'fdLifeCycleByOrchestrator', FALSE, FALSE ), + new setAttribute( + new CompositeAttribute( + _('Behavior Supann Ressources Etats'), + 'fdSupannRessourceBehavior', + [ + new SelectAttribute( + 'Ressource type', _('Supann Ressource Type'), + 'fdSupannRessourceBehaviorType', FALSE, + ), + new SelectAttribute( + _('Status desired'), _('Status desired'), + 'fdSupannRessourceBehaviorDesired', FALSE, + ), + ], + '/.*/', + '%s:%s', + '', + ), + ), ], ], ]; @@ -417,6 +436,11 @@ class supannConfig extends simplePlugin $this->attributesAccess['fdSupannRessourceSubStates']->setSubmitForm('updateFieldsChoices'); $this->officialSubstates = array_merge(...array_values(array_map('array_keys', supannAccountStatus::getOfficialSubstates()))); $this->updateFieldsChoices(); + + //Management of life cycle behavior + $this->attributesAccess['fdSupannRessourceBehavior']->attribute->attributes[0]->setChoices(['COMPTE', 'MAIL']); + $this->attributesAccess['fdSupannRessourceBehavior']->attribute->attributes[1]->setChoices(['ACTIVE', 'INACTIVE', 'SUSPENDU']); + } function updateFieldsChoices ()