on prend en compte si la cle options est presente
This commit is contained in:
parent
de77a13cb2
commit
064789956c
1 changed files with 9 additions and 2 deletions
|
@ -89,11 +89,17 @@ function gamuform_recup_tableau_objet(string $objet, bool $all = true):array {
|
|||
$T = array_filter($T, function($d){
|
||||
return !empty($d);
|
||||
});
|
||||
$options = [];
|
||||
if (!empty($T['options'])) {
|
||||
$options = $T['options'];
|
||||
unset($T['options']);
|
||||
}
|
||||
|
||||
if (!$all) {
|
||||
$T = array_filter($T, function($d){
|
||||
return !empty($d['saisie']);
|
||||
});
|
||||
$T = array_merge(['options' => $options], $T);
|
||||
}
|
||||
return $T;
|
||||
}
|
||||
|
@ -154,16 +160,17 @@ function gamuform_recup_champs_gamutable(string $objet):array {
|
|||
*/
|
||||
function gamuform_recup_champs_saisies(string $objet):array {
|
||||
$c = [];
|
||||
|
||||
if (gamuform_objet_autoriser($objet)) {
|
||||
$T = gamuform_recup_tableau_objet($objet, false);
|
||||
if (array_key_exists('options', $T)) {
|
||||
unset($T['options']);
|
||||
}
|
||||
if (!empty($T)) {
|
||||
foreach ($T as $s) {
|
||||
$c[] = $s['options']['nom'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $c;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue