From d05ad7ebc427b1f66a7d5cd78b8e12a0254cf4b5 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 25 Jun 2007 06:11:27 +0000 Subject: [PATCH] Updated environment printer selection dialog git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6669 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../environment/class_selectPrinterDialog.inc | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/plugins/personal/environment/class_selectPrinterDialog.inc b/plugins/personal/environment/class_selectPrinterDialog.inc index 693e3425b..3e2935621 100644 --- a/plugins/personal/environment/class_selectPrinterDialog.inc +++ b/plugins/personal/environment/class_selectPrinterDialog.inc @@ -26,34 +26,34 @@ class selectPrinterDialog extends plugin /* 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); - $tmp =array(); - foreach($deps as $dep){ - $tmp[$dep['dn']] = $dep; + /* 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']; } - $deps = $tmp; - /* Load possible departments */ - $this->ui= get_userinfo(); - $department = array(); - foreach($this->module as $module){ - $d = $this->ui->get_module_departments($module); - foreach($d as $department){ - $departments[$department] = $department; - } - } + /* Load possible departments */ + $ui= get_userinfo(); + $this->ui = $ui; + $tdeps= $ui->get_module_departments("users"); $ids = $this->config->idepartments; - $this->deplist = array(); - foreach($deps as $dep){ - if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $departments)){ - $this->deplist[$dep['dn']] = $ids[$dep['dn']]; + $first = ""; + $found = FALSE; + $res = array(); + foreach($ids as $dep => $name){ + if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ + $res[$dep] = $ids[$dep]; //$tdeps[$dep]; } } - - $this->depselect = key($this->deplist); + $this->deplist = $res; + $this->depselect = key($res); } function execute() -- 2.30.2