diff --git a/gosa-core/include/class_MultiSelectWindow.inc b/gosa-core/include/class_MultiSelectWindow.inc
index f088cc189351693b1baaf3fd0c4c014b5bb86a93..c77f07b6497d1a9e1619e30b16b17430bd96ee3c 100644 (file)
function ClearElementsList()
{
function ClearElementsList()
{
+ $ui =get_userinfo();
+ $deps = $ui->get_module_departments($this->module);
+ if(!in_array($this->selectedBase, $deps)){
+ $this->selectedBase = array_shift($deps);
+ }
$this->array_Elements = array();
}
$this->array_Elements = array();
}
}
uksort($this->departments, 'strnatcasecmp');
$this->departments = array_values($this->departments);
}
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 */
foreach($this->departments as $key=> $val){
/* Add deps to this dialog object list */
foreach($this->departments as $key=> $val){
+ if(!in_array($val['dn'],$module_deps)) continue;
+
/* Check if this department contains sub-departments
Display different image in this case
*/
/* Check if this department contains sub-departments
Display different image in this case
*/
$ids = $this->config->idepartments;
foreach($modules as $module){
$d = $ui->get_module_departments($module);
$ids = $this->config->idepartments;
foreach($modules as $module){
$d = $ui->get_module_departments($module);
- foreach($d as $department){
- $departments[$department] = $department;
+
+ foreach($ids as $department => $desc){
+ if(in_array($department,$d)){
+ $departments[$department] = $department;
+ }
}
}
}
}