mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-22 18:09:06 +01:00
- LSattr_html_select_object : Correction d'un bug dans la méthode getValue()
- Lattribute : Correction d'un bug dans la méthode getFormVal()
This commit is contained in:
parent
7560e44586
commit
596aa41434
2 changed files with 15 additions and 7 deletions
|
@ -91,7 +91,7 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
return;
|
||||
}
|
||||
|
||||
if (is_array($values)) {
|
||||
if ((is_array($values))&&(!empty($values))) {
|
||||
if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')) {
|
||||
$list=array();
|
||||
foreach($values as $dn) {
|
||||
|
@ -102,14 +102,21 @@ class LSattr_html_select_object extends LSattr_html{
|
|||
}
|
||||
}
|
||||
else {
|
||||
$filter='(|';
|
||||
$filter='';
|
||||
foreach($values as $val) {
|
||||
if (!empty($val)) {
|
||||
$filter.='('.$conf['value_attribute'].'='.$val.')';
|
||||
}
|
||||
$filter.=')';
|
||||
}
|
||||
if ($filter!='') {
|
||||
$filter='(|'.$filter.')';
|
||||
$obj = new $conf['object_type']();
|
||||
$list = $obj -> listObjects($filter);
|
||||
}
|
||||
else {
|
||||
$list=array();
|
||||
}
|
||||
}
|
||||
if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')) {
|
||||
for($i=0;$i<count($list);$i++) {
|
||||
$retInfos[$list[$i] -> dn]=$list[$i] -> getDisplayValue($conf['display_attribute']);
|
||||
|
|
|
@ -338,8 +338,9 @@ class LSattribute {
|
|||
*/
|
||||
function getFormVal() {
|
||||
$data=$this -> getDisplayValue();
|
||||
if(!is_array($data))
|
||||
if((!is_array($data))&&($data!=NULL)) {
|
||||
$data=array($data);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue