From 7418bd6251aaf4f6fb5da61dc3d16b52043b81a4 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 19 Jun 2008 11:23:19 +0000 Subject: [PATCH] Updated Listing for serveral Management lists. -Departments were only listed if we have full access. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11375 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_MultiSelectWindow.inc | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/gosa-core/include/class_MultiSelectWindow.inc b/gosa-core/include/class_MultiSelectWindow.inc index 08e47a82f..f088cc189 100644 --- a/gosa-core/include/class_MultiSelectWindow.inc +++ b/gosa-core/include/class_MultiSelectWindow.inc @@ -724,6 +724,58 @@ class MultiSelectWindow{ } } + + function create_department_list($modules) + { + /* Load possible departments */ + $ui= get_userinfo(); + $first = ""; + $found = FALSE; + + if(!is_array($modules)){ + $modules = array($modules); + } + + $department = $departments = array(); + $ids = $this->config->idepartments; + foreach($modules as $module){ + $d = $ui->get_module_departments($module); + foreach($d as $department){ + $departments[$department] = $department; + } + } + + $first = ""; + $found = FALSE; + $options =""; + foreach($departments as $dep => $name){ + + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } + + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ + $found = TRUE; + $options.= ""; + } else { + $options.= ""; + } + } + + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + + return($options); + } + function set_List_Bottom_Info($str) { $this->List_Bottom_Info = $str; -- 2.30.2