X-Git-Url: http://git.cyclocoop.org/?p=lhc%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fprive%2Fformulaires%2Fselecteur%2Fgenerique_fonctions.php;h=a39cf7873275b95622248ce47bbc52ffd85a43fb;hp=1b3d5326a3ffb8ec96bb05fa2a8ae437984e577b;hb=122c920eb07e3f665789f8734965b576e6c25515;hpb=226942065cd4f604eb464addf45a065c9e5bc916 diff --git a/www/prive/formulaires/selecteur/generique_fonctions.php b/www/prive/formulaires/selecteur/generique_fonctions.php index 1b3d5326..a39cf787 100644 --- a/www/prive/formulaires/selecteur/generique_fonctions.php +++ b/www/prive/formulaires/selecteur/generique_fonctions.php @@ -87,10 +87,10 @@ function picker_selected($selected, $type=''){ $id_objet = intval($captures[2]); // Si on cherche un type et que c'est le bon, on renvoit un tableau que d'identifiants - if (is_string($type) and $type == $objet and $id_objet){ + if (is_string($type) AND $type == $objet AND ($id_objet OR $objet=="rubrique")){ $select[] = $id_objet; } - elseif(!$type){ + elseif(!$type AND ($id_objet OR $objet=="rubrique")){ $select[] = array('objet' => $objet, 'id_objet' => $id_objet); } } @@ -169,7 +169,8 @@ function test_enfants_rubrique($id_rubrique,$types=array()){ while (count($fratrie) AND is_array($types) AND count($types)){ $type = array_shift($types); $h = sql_allfetsel("DISTINCT id_rubrique",table_objet_sql($type),sql_in('id_rubrique',$fratrie)); - $has = array_merge($has,array_map('reset',$h)); + $h = array_map('reset',$h); + $has = array_merge($has,$h); $fratrie = array_diff($fratrie,$h); } if (count($has)) @@ -181,4 +182,4 @@ function test_enfants_rubrique($id_rubrique,$types=array()){ return $has_child[$id_rubrique]?' ':''; } -?> \ No newline at end of file +?>