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

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