mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
supannRessourceEtat & supannRessourceEtatDate: fix parsing & formating optional components value
This commit is contained in:
parent
3c6ce596d9
commit
e8b8dd1730
2 changed files with 9 additions and 7 deletions
|
@ -73,7 +73,7 @@ class LSformElement_supannRessourceEtat extends LSformElement_supannCompositeAtt
|
||||||
'ressource' => $matches['ressource'],
|
'ressource' => $matches['ressource'],
|
||||||
'etat' => $matches['etat'],
|
'etat' => $matches['etat'],
|
||||||
);
|
);
|
||||||
if (isset($matches['sous_etat']))
|
if (isset($matches['sous_etat']) && !is_empty($matches['sous_etat']))
|
||||||
$parseValue['sous_etat'] = $matches['sous_etat'];
|
$parseValue['sous_etat'] = $matches['sous_etat'];
|
||||||
return $parseValue;
|
return $parseValue;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ class LSformElement_supannRessourceEtat extends LSformElement_supannCompositeAtt
|
||||||
if (!$value['ressource'] || !$value['etat'])
|
if (!$value['ressource'] || !$value['etat'])
|
||||||
return null;
|
return null;
|
||||||
$ret = "{".$value['ressource']."}".$value['etat'];
|
$ret = "{".$value['ressource']."}".$value['etat'];
|
||||||
if ($value['sous_etat'])
|
if (isset($value['sous_etat']) && !is_empty($matches['sous_etat']))
|
||||||
$ret .= ":".$value['sous_etat'];
|
$ret .= ":".$value['sous_etat'];
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,8 +85,8 @@ class LSformElement_supannRessourceEtatDate extends LSformElement_supannComposit
|
||||||
'ressource' => $matches['ressource'],
|
'ressource' => $matches['ressource'],
|
||||||
'etat' => $matches['etat'],
|
'etat' => $matches['etat'],
|
||||||
);
|
);
|
||||||
foreach(array('sous_etat', 'date_debut', 'date_fin') as $c => $cconf)
|
foreach(array('sous_etat', 'date_debut', 'date_fin') as $c)
|
||||||
if (isset($matches[$c]))
|
if (isset($matches[$c]) && !is_empty($matches[$c]))
|
||||||
$parseValue[$c] = $matches[$c];
|
$parseValue[$c] = $matches[$c];
|
||||||
return $parseValue;
|
return $parseValue;
|
||||||
}
|
}
|
||||||
|
@ -104,9 +104,11 @@ class LSformElement_supannRessourceEtatDate extends LSformElement_supannComposit
|
||||||
if (!$value['ressource'] || !$value['etat'])
|
if (!$value['ressource'] || !$value['etat'])
|
||||||
return null;
|
return null;
|
||||||
$ret = "{".$value['ressource']."}".$value['etat'];
|
$ret = "{".$value['ressource']."}".$value['etat'];
|
||||||
$ret .= ":".($value['sous_etat']?$value['sous_etat']:'');
|
foreach(array('sous_etat', 'date_debut', 'date_fin') as $c) {
|
||||||
$ret .= ":".($value['date_debut']?$value['date_debut']:'');
|
$ret .= ":";
|
||||||
$ret .= ":".($value['date_fin']?$value['date_fin']:'');
|
if (isset($value[$c]) && !is_empty($value[$c]))
|
||||||
|
$ret .= $value[$c];
|
||||||
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
return False;
|
return False;
|
||||||
|
|
Loading…
Reference in a new issue