X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fmimetypes%2Fclass_divListMimeTypes.inc;h=87b7bbaa4524b4e7c499c026164720767303b1b7;hb=6ae7a3503964fb97587cf21b9c1b4276b9db23fc;hp=8fbd5c22519b90192f73c0e97d19b037b01ad610;hpb=14908293a8e81f42e97cf72832fb29ef499efea2;p=gosa.git diff --git a/plugins/admin/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc index 8fbd5c225..87b7bbaa4 100755 --- a/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -50,8 +50,6 @@ class divListMimeTypes extends MultiSelectWindow $action_col_size += 38; } - - /* Toggle all selected / deselected */ $chk = ""; @@ -94,28 +92,55 @@ class divListMimeTypes extends MultiSelectWindow $options= ""; /* Get all departments within this subtree */ + $ui= get_userinfo(); + $first = ""; + $found = FALSE; $base = $this->config->current['BASE']; - $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, - array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); + + /* Add base */ + $tmp = array(); + $tmp[] = array("dn"=>$this->config->current['BASE']); + $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); + + $deps = array(); + foreach($tmp as $tm){ + $deps[$tm['dn']] = $tm['dn']; + } /* Load possible departments */ - $ui = get_userinfo(); + $ui= get_userinfo(); $tdeps= $ui->get_module_departments($this->module); - $ids = $this->config->idepartments; + $first = ""; + $found = FALSE; + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ + + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $dep['dn']; + } - 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.= ""; + $value = $ids[$dep]; + if ($this->selectedBase == $dep){ + $found = TRUE; + $options.= ""; } else { - $options.= ""; + $options.= ""; } } } + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + /* Get acls */ $ui = get_userinfo(); $acl = $ui->get_permissions("cn=dummy,ou=mimetypes,".$this->selectedBase,"mimetypes/mimetype"); @@ -165,6 +190,14 @@ class divListMimeTypes extends MultiSelectWindow $listhead .= "  "; + /* Add multiple copy & cut icons */ + if(is_object($this->parent->CopyPasteHandler)){ + $listhead .= "  "; + $listhead .= "  "; + } + $listhead .="";; $this->SetListHeader($listhead);