From bc2ee0dd3b80990e28cb43cfc5030145eec65e57 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 25 Jun 2008 09:33:39 +0000 Subject: [PATCH] Updated multiselectList, to display correct department images git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11436 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_MultiSelectWindow.inc | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/gosa-core/include/class_MultiSelectWindow.inc b/gosa-core/include/class_MultiSelectWindow.inc index c77f07b64..b4a43dea7 100644 --- a/gosa-core/include/class_MultiSelectWindow.inc +++ b/gosa-core/include/class_MultiSelectWindow.inc @@ -663,25 +663,33 @@ class MultiSelectWindow{ /* Get all departments within this subtree */ $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, - array("ou", "description"), GL_SIZELIMIT ); + array("ou", "description","objectClass"), GL_SIZELIMIT ); /* Edit delete link for system types */ $linkopen = "%s"; /* Create an array with all visible (in the list) departments */ + $types = departmentManagement::get_support_departments(); + $departments = array(); foreach($deps as $value){ $name = $value['ou'][0]." -".$value['dn']; - $this->departments[$name]= $value; + foreach($types as $type){ + if(in_array($type['OC'],$value['objectClass'])){ + $value['type'] = $type; + break; + } + } + $this->departments[$name]= $value; } uksort($this->departments, 'strnatcasecmp'); - $this->departments = array_values($this->departments); $ui = get_userinfo(); $module_deps = $ui->get_module_departments($this->module); /* Add deps to this dialog object list */ + $this->departments = array_values($this->departments); foreach($this->departments as $key=> $val){ if(!in_array($val['dn'],$module_deps)) continue; @@ -689,13 +697,15 @@ class MultiSelectWindow{ /* Check if this department contains sub-departments Display different image in this case */ - $non_empty=""; + $img = $val['type']['IMG']; foreach($this->config->departments as $keyd){ if(preg_match("/,".normalizePreg($val['dn'])."$/",$keyd)){ - $non_empty="-full"; + $img = $val['type']['IMG_FULL']; } } + $img = ""; + /* Add spacer cols to divlist */ $row = array(); @@ -714,7 +724,6 @@ class MultiSelectWindow{ /* Add departments */ - $img = "department"; $row[]=$field1=array("string"=> $img,"attach"=>"style='text-align:center;width:20px;'"); $row[]=$field2=array("string"=>sprintf($linkopen,$key,$name), "attach" => "style=''"); -- 2.30.2