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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($values)) {
|
if ((is_array($values))&&(!empty($values))) {
|
||||||
if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')) {
|
if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')) {
|
||||||
$list=array();
|
$list=array();
|
||||||
foreach($values as $dn) {
|
foreach($values as $dn) {
|
||||||
|
@ -102,13 +102,20 @@ class LSattr_html_select_object extends LSattr_html{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$filter='(|';
|
$filter='';
|
||||||
foreach($values as $val) {
|
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}')) {
|
if(($conf['value_attribute']=='dn')||($conf['value_attribute']=='%{dn}')) {
|
||||||
for($i=0;$i<count($list);$i++) {
|
for($i=0;$i<count($list);$i++) {
|
||||||
|
|
|
@ -338,8 +338,9 @@ class LSattribute {
|
||||||
*/
|
*/
|
||||||
function getFormVal() {
|
function getFormVal() {
|
||||||
$data=$this -> getDisplayValue();
|
$data=$this -> getDisplayValue();
|
||||||
if(!is_array($data))
|
if((!is_array($data))&&($data!=NULL)) {
|
||||||
$data=array($data);
|
$data=array($data);
|
||||||
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue