From: hickert Date: Thu, 1 Sep 2005 06:25:11 +0000 (+0000) Subject: Filtered department list. Hide all subtrees in base selection, which are subtrees... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c1e278e85a5ff75ebc17b49a33392db4535491a9;p=gosa.git Filtered department list. Hide all subtrees in base selection, which are subtrees of the edited entry. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1278 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index d7f709f80..3b50131db 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -70,15 +70,22 @@ class department extends plugin $this->config->make_idepartments(); $smarty= get_smarty(); - - /* Show main page */ - $smarty->assign("bases", $this->config->idepartments); + /* Hide all departments, that are subtrees of this department */ + $bases = $this->config->idepartments; + $tmp = array(); + foreach($bases as $dn=>$base){ + + /* Only attach departments which are not a subtree of this one */ + if(!preg_match("/".$this->dn."/",$dn)){ + $tmp[$dn]=$base; + } + } + $smarty->assign("bases", $tmp); foreach ($this->attributes as $val){ $smarty->assign("$val", $this->$val); $smarty->assign("$val"."ACL", chkacl($this->acl, "$val")); } - $smarty->assign("bases", $this->config->idepartments); $smarty->assign("base_select", $this->base); return($smarty->fetch (get_template_path('generic.tpl', TRUE))); }