From 596aa414340e67ee0f13d8223f5aee2d4b068682 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 6 Oct 2008 14:53:32 +0000 Subject: [PATCH] =?UTF-8?q?-=20LSattr=5Fhtml=5Fselect=5Fobject=20:=20Corre?= =?UTF-8?q?ction=20d'un=20bug=20dans=20la=20m=C3=A9thode=20getValue()=20-?= =?UTF-8?q?=20Lattribute=20:=20Correction=20d'un=20bug=20dans=20la=20m?= =?UTF-8?q?=C3=A9thode=20getFormVal()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../class/class.LSattr_html_select_object.php | 19 +++++++++++++------ trunk/includes/class/class.LSattribute.php | 3 ++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/trunk/includes/class/class.LSattr_html_select_object.php b/trunk/includes/class/class.LSattr_html_select_object.php index 30bed0a9..7ce6c5a7 100644 --- a/trunk/includes/class/class.LSattr_html_select_object.php +++ b/trunk/includes/class/class.LSattr_html_select_object.php @@ -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,13 +102,20 @@ class LSattr_html_select_object extends LSattr_html{ } } else { - $filter='(|'; + $filter=''; foreach($values as $val) { - $filter.='('.$conf['value_attribute'].'='.$val.')'; + if (!empty($val)) { + $filter.='('.$conf['value_attribute'].'='.$val.')'; + } + } + if ($filter!='') { + $filter='(|'.$filter.')'; + $obj = new $conf['object_type'](); + $list = $obj -> listObjects($filter); + } + else { + $list=array(); } - $filter.=')'; - $obj = new $conf['object_type'](); - $list = $obj -> listObjects($filter); } if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')) { for($i=0;$i getDisplayValue(); - if(!is_array($data)) + if((!is_array($data))&&($data!=NULL)) { $data=array($data); + } return $data; }