From: hickert Date: Wed, 29 Nov 2006 07:40:59 +0000 (+0000) Subject: Fixed glpi contact/technical person selection X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b8230e390e15547688a1fcd6635017c96adb8aba;p=gosa.git Fixed glpi contact/technical person selection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5240 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index 435f8291f..bb233f226 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -159,7 +159,7 @@ class divListSystem extends MultiSelectWindow name='newsystem_server' alt='"._("New Server")."' title='"._("New Server")."'> "; } - if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgenric"))){ + if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){ $listhead .= " "; } diff --git a/plugins/admin/systems/class_glpiSelectUser.inc b/plugins/admin/systems/class_glpiSelectUser.inc index ff7c0a4ac..208dca553 100644 --- a/plugins/admin/systems/class_glpiSelectUser.inc +++ b/plugins/admin/systems/class_glpiSelectUser.inc @@ -146,13 +146,27 @@ class glpiSelectUser extends plugin /* Prepare departments, which are shown in the listbox on top of the listbox */ - $options= ""; + + + /* Get all departments within this subtree */ $this->base = $_SESSION['glpi_user_filter']['base']; - foreach ($this->get_allowed_bases("users/user") as $key => $value){ - if ($_SESSION['glpi_user_filter']['base'] == $key){ - $options.= ""; - } else { - $options.= ""; + $options =""; + $base = $this->config->current['BASE']; + $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", "users", $base, + array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); + + /* Load possible departments */ + $ui= get_userinfo(); + $tdeps= $ui->get_module_departments("users"); + $ids = $this->config->idepartments; + foreach($deps as $dep){ + if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + $value = $ids[$dep['dn']]; + if ($this->base == $dep['dn']){ + $options.= ""; + } else { + $options.= ""; + } } } @@ -209,7 +223,7 @@ class glpiSelectUser extends plugin * So we are able to navigate like in konquerer */ - $res3= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))",preg_replace("/\//","",$this->acl_category), + $res3= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))","users", $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); $this->departments= array(); @@ -230,7 +244,7 @@ class glpiSelectUser extends plugin */ $ou = get_people_ou(); - $res2= get_list("(&(|(cn=$regex)(sn=$regex))(objectClass=person))", preg_replace("/\//","",$this->acl_category), + $res2= get_list("(&(|(cn=$regex)(sn=$regex))(objectClass=person))", "users", $ou.$base, array("cn", "sn", "uid", "givenName", "description"), GL_SUBSEARCH | GL_SIZELIMIT);