LSattr_html :: select_object : Fix handling filter parameter

This commit is contained in:
Benjamin Renard 2017-03-23 16:30:14 +01:00
parent 7aa96ae60c
commit 8f037d8421
2 changed files with 2 additions and 0 deletions

View file

@ -12,6 +12,7 @@
'object_type' => '[Type d'LSobject selectionnable]',
'display_name_format' => '[LSformat du nom d'affichage des LSobjects]',
'value_attribute' => '[Nom de l'attribut clé des LSobjects]',
'filter' => '[Filtre de recherche]',
'onlyAccessible' => '[Booléen]'
),
'ordered' => [Booléen],

View file

@ -165,6 +165,7 @@ class LSattr_html_select_object extends LSattr_html{
foreach($values as $val) {
if (!empty($val)) {
$filter=Net_LDAP2_Filter::create($conf['value_attribute'],'equals',$val);
if (isset($conf['filter'])) $filter = LSldap::combineFilters('and',array($filter,$conf['filter']));
$sparams=array();
$sparams['onlyAccessible'] = (isset($conf['onlyAccessible'])?$conf['onlyAccessible']:False);
$listobj = $obj -> listObjectsName($filter,NULL,$sparams,$conf['display_name_format']);