From a76a83fecdf7a5e0c63d53b68ec91110cb06b56b Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 16 May 2006 04:07:01 +0000 Subject: [PATCH] Fixed department subsearch git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3350 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_departmentManagement.inc | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index 5f9ed0d06..d77066f69 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -72,7 +72,6 @@ class departmentManagement extends plugin $smarty = get_smarty(); $display = ""; - $depfilter = get_global("depfilter"); $s_action = ""; // Will contain an action, like del or edit $s_entry = ""; // The entry name for edit delete -... @@ -340,18 +339,27 @@ class departmentManagement extends plugin if($this->DivListDepartment->SubSearch){ $res= get_list("(&(|(ou=$Regex)(description=$Regex))(objectClass=gosaDepartment))", - $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT | GL_SUBSEARCH); + $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); }else{ $res= get_list("(&(|(ou=$Regex)(description=$Regex))(objectClass=gosaDepartment))", - $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); + $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT ); } $this->departments= array(); - foreach ($res as $value){ + foreach ($res as $key => $value){ + + /* Don't display base as entry on subsearch */ + if(($value['dn'] == $base) && ($this->DivListDepartment->SubSearch)){ + continue; + } + + $cdn= convert_department_dn($value['dn']); + + /* Append to dep list */ if(isset($value["description"][0])){ - $this->departments[$value['dn']]= get_sub_department($value['dn'])." - [".$value["description"][0]."]"; + $this->departments[$cdn]= get_sub_department($cdn)." - [".$value["description"][0]."]"; }else{ - $this->departments[$value['dn']]= get_sub_department($value['dn']);//$value["description"][0]; + $this->departments[$cdn]= get_sub_department($cdn);//$value["description"][0]; } } natcasesort ($this->departments); -- 2.30.2