Verified Commit 586d242b authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(supann) Fix valide field in supannCMSAffectation

It was spelled valid instead of valide and the values were wrong.

issue #6015
parent 08a70bd1
...@@ -44,8 +44,9 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute ...@@ -44,8 +44,9 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute
), ),
new BooleanAttribute( new BooleanAttribute(
_('Valid'), _('Card validity'), _('Valid'), _('Card validity'),
'none_valid', TRUE, 'none_valide', TRUE,
TRUE TRUE, '',
'vrai', 'faux'
), ),
new SelectAttribute( new SelectAttribute(
_('Source'), _('Card managing system and establishment'), _('Source'), _('Card managing system and establishment'),
...@@ -61,6 +62,11 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute ...@@ -61,6 +62,11 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute
parent::__construct($description, $ldapName, $attributes, $acl, $label); parent::__construct($description, $ldapName, $attributes, $acl, $label);
} }
protected function isValid (): bool
{
return ($this->attributes[3]->getValue() === TRUE);
}
function supannGetValues (&$values) function supannGetValues (&$values)
{ {
foreach ($this->attributes as &$attribute) { foreach ($this->attributes as &$attribute) {
...@@ -75,14 +81,12 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute ...@@ -75,14 +81,12 @@ class SupannCMSAffectationAttribute extends SupannCompositeAttribute
if ($value == '') { if ($value == '') {
continue; continue;
} }
if ($this->attributes[3]->getValue() === TRUE) { if ($this->isValid()) {
/* Card is valid */
$values[$shortname][$value] = $value; $values[$shortname][$value] = $value;
} }
} }
unset($attribute); unset($attribute);
if ($this->attributes[3]->getValue() === TRUE) { if ($this->isValid()) {
/* Card is valid */
$format = $this->attributes[1]->getValue(); $format = $this->attributes[1]->getValue();
$id = $this->attributes[2]->getValue(); $id = $this->attributes[2]->getValue();
$supannCMSIdEtiquette = '{'.$format.'}'.$id; $supannCMSIdEtiquette = '{'.$format.'}'.$id;
......
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