Commit 0e538eb4 authored by Côme Chilliet's avatar Côme Chilliet

🚑 fix(supann) Add special handling for {INCONNU} for regimeinsc and sectdisc

See SupAnn documentation regarding supannEtuInscription for more details
 on this madness.

issue #6034
parent c59a6aae
......@@ -39,11 +39,11 @@ class SupannEtuInscriptionAttribute extends SupannCompositeAttribute
),
new SelectAttribute(
_('Registration type'), _('supannEtuRegimeInscription - The type of this registration'),
'supannEtuRegimeInscription_regimeinsc', TRUE
'supannEtuRegimeInscription_regimeinsc', FALSE
),
new SelectAttribute(
_('Disciplinary Sector'), _('supannEtuSecteurDisciplinaire - Disciplinary sector education diploma'),
'supannEtuSecteurDisciplinaire_sectdisc', TRUE
'supannEtuSecteurDisciplinaire_sectdisc', FALSE
),
new SelectAttribute(
_('Diploma type'), _('supannEtuTypeDiplome - Type of diploma'),
......@@ -153,4 +153,31 @@ class SupannEtuInscriptionAttribute extends SupannCompositeAttribute
}
unset($attribute);
}
/* Remove SupAnn weirdness */
function readValues (string $value): array
{
$values = parent::readValues($value);
if ($values[2] == '{INCONNU}') {
$values[2] = '';
}
if ($values[3] == '{INCONNU}') {
$values[3] = '';
}
return $values;
}
/* Add {INCONNU} values for special cases regimeinsc and sectdisc */
function writeValues (array $values)
{
if ($values[2] == '') {
$values[2] = '{INCONNU}';
}
if ($values[3] == '') {
$values[3] = '{INCONNU}';
}
return parent::writeValues($values);
}
}
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