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