supannRessourceEtat & supannRessourceEtatDate: fix parsing optional components value

This commit is contained in:
Benjamin Renard 2021-07-07 16:20:00 +02:00
parent 25162f406d
commit 6e98cfef20
2 changed files with 5 additions and 4 deletions

View file

@ -72,8 +72,9 @@ class LSformElement_supannRessourceEtat extends LSformElement_supannCompositeAtt
$parseValue = array(
'ressource' => $matches['ressource'],
'etat' => $matches['etat'],
'sous_etat' => (isset($matches['sous_etat'])?$matches['sous_etat']:null),
);
if (isset($matches['sous_etat']))
$parseValue['sous_etat'] = $matches['sous_etat'];
return $parseValue;
}
return;

View file

@ -84,10 +84,10 @@ class LSformElement_supannRessourceEtatDate extends LSformElement_supannComposit
$parseValue = array(
'ressource' => $matches['ressource'],
'etat' => $matches['etat'],
'sous_etat' => (isset($matches['sous_etat'])?$matches['sous_etat']:null),
'date_debut' => (isset($matches['date_debut'])?$matches['date_debut']:null),
'date_fin' => (isset($matches['date_fin'])?$matches['date_fin']:null),
);
foreach(array('sous_etat', 'date_debut', 'date_fin') as $c => $cconf)
if (isset($matches[$c]))
$parseValue[$c] = $matches[$c];
return $parseValue;
}
return;