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

Merge branch '6038-editing-supann-status-does-not-work-as-expected' into '1.4-dev'

Resolve "Editing SupAnn Status does not work as expected."

See merge request fusiondirectory/fd-plugins!696
parents d5787e78 866a367c
......@@ -49,6 +49,7 @@ class supannAccountStatus extends simplePlugin implements UserTabLockingAction
return [
'status' => [
'name' => _('Status'),
'class' => ['fullwidth'],
'attrs' => [
new OrderedArrayAttribute(
new CompositeAttribute(
......@@ -179,13 +180,13 @@ class supannAccountStatus extends simplePlugin implements UserTabLockingAction
{
$errors = parent::check();
$labels = [];
$resources = [];
foreach ($this->supannRessourceEtatDate as $line) {
$label = preg_replace('/^\{([^}]+)\}.*$/', '\1', $line);
if (in_array($label, $labels)) {
$errors[] = sprintf(_('Label "%s" is present more than once in supannRessourceEtatDate'), $label);
$resource = preg_replace('/^\{([^}]+)\}.*$/', '\1', $line);
if (in_array($resource, $resources)) {
$errors[] = sprintf(_('Resource "%s" is present more than once in supannRessourceEtatDate'), $resource);
} else {
$labels[] = $label;
$resources[] = $resource;
}
}
......
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