summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e8d418)
raw | patch | inline | side by side (parent: 4e8d418)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 24 Oct 2006 06:53:41 +0000 (06:53 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 24 Oct 2006 06:53:41 +0000 (06:53 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4921 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/fai/class_divListFai.inc | patch | blob | history |
index 9dea993f8e0a207b37a2d8bd35c7b0a19c383ec7..7707658b3dd53e4295310951b155e5977ab084ef 100644 (file)
function GenHeader()
{
- $ui = get_userinfo();
/* Prepare departments,
which are shown in the listbox on top of the listbox
*/
$options= "";
- foreach ($this->config->idepartments as $key => $value){
- if ($this->selectedBase == $key){
- $options.= "<option selected='selected' value='$key'>$value</option>";
- } else {
- $options.= "<option value='$key'>$value</option>";
+
+ /* Get all departments within this subtree */
+ $base = $this->config->current['BASE'];
+ $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
+ array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH);
+
+ /* Load possible departments */
+ $ui= get_userinfo();
+ $tdeps= $ui->get_module_departments("fai");
+
+ $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->selectedBase == $dep['dn']){
+ $options.= "<option selected='selected' value='".$dep['dn']."'>$value</option>";
+ } else {
+ $options.= "<option value='".$dep['dn']."'>$value</option>";
+ }
}
}
- /* Create listhead, it will be shown on top of the divlist.
+ /* Create listhead, it will be shown on top of the divlist.
* It provides general navigation and object creation
*/
$listhead =