From: hickert Date: Tue, 11 Apr 2006 05:54:31 +0000 (+0000) Subject: Added global base X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=10898e750787e1687024db5abcab7137f053ea66;p=gosa.git Added global base git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3027 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index 9d0c5d652..e3b181577 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -63,8 +63,8 @@ class department extends plugin /* Set base */ if ($this->dn == "new"){ $ui= get_userinfo(); - if(isset($_SESSION['depfilter']['depselect'])){ - $this->base = $_SESSION['depfilter']['depselect']; + if(isset($_SESSION['CurrentMainBase'])){ + $this->base = $_SESSION['CurrentMainBase']; }else{ $this->base= dn2base($ui->dn); } diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index bca4a4534..b1e1d7b93 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -47,11 +47,11 @@ class departmentManagement extends plugin /* Get global filter config */ if (!is_global("depfilter")){ - $base= get_base_from_people($ui->dn); - $depfilter= array("depselect" => $base, - "regex" => "*"); + $depfilter= array("regex" => "*"); register_global("depfilter", $depfilter); } + $base= get_base_from_people($ui->dn); + $_SESSION['CurrentMainBase'] = $_SESSION['CurrentMainBase']; } function execute() @@ -102,34 +102,34 @@ class departmentManagement extends plugin } - if(isset($_POST['depselect']) && $_POST['depselect']){ - $depfilter['depselect']= $_POST['depselect']; + if(isset($_POST['CurrentMainBase']) && $_POST['CurrentMainBase']){ + $_SESSION['CurrentMainBase'] = $_POST['CurrentMainBase']; } if($s_action=="root"){ - $depfilter['depselect']=($this->config->current['BASE']); + $_SESSION['CurrentMainBase'] = ($this->config->current['BASE']); } if($s_action=="home"){ - $depfilter['depselect']=(preg_replace("/^[^,]+,/","",$this->ui->dn)); - $depfilter['depselect']=(preg_replace("/^[^,]+,/","",$depfilter['depselect'])); + $_SESSION['CurrentMainBase'] =(preg_replace("/^[^,]+,/","",$this->ui->dn)); + $_SESSION['CurrentMainBase'] =(preg_replace("/^[^,]+,/","", $_SESSION['CurrentMainBase'] )); } if($s_action=="back"){ - $base_back = preg_replace("/^[^,]+,/","",$depfilter['depselect']); + $base_back = preg_replace("/^[^,]+,/","", $_SESSION['CurrentMainBase']); $base_back = convert_department_dn($base_back); if(isset($this->config->departments[trim($base_back)])){ - $depfilter['depselect']= $this->config->departments[trim($base_back)]; + $_SESSION['CurrentMainBase'] = $this->config->departments[trim($base_back)]; }else{ - $depfilter['depselect']= $this->config->departments["/"]; + $_SESSION['CurrentMainBase'] = $this->config->departments["/"]; } } if(isset($_GET['act'])&&($_GET['act']=="dep_open")){ $s_action="open"; $s_entry = base64_decode($_GET['dep_id']); - $depfilter['depselect']= $this->config->departments[trim($s_entry)]; + $_SESSION['CurrentMainBase'] = $this->config->departments[trim($s_entry)]; } if (isset($_GET['search'])){ @@ -284,7 +284,7 @@ class departmentManagement extends plugin /* Prepare departments */ $options= ""; foreach ($this->config->idepartments as $key => $value){ - if ($depfilter['depselect'] == $key){ + if ($_SESSION['CurrentMainBase'] == $key){ $options.= ""; } else { $options.= ""; @@ -300,7 +300,7 @@ class departmentManagement extends plugin "  ". "  ". "  ". - _("Base")." ". + _("Base")." ". "  ". ""; @@ -347,10 +347,12 @@ class departmentManagement extends plugin $smarty->assign("launchimage", get_template_path('images/launch.png')); $smarty->assign("deplist", $this->config->idepartments); - foreach( array("depselect", "regex") as $type){ + foreach( array("regex") as $type){ $smarty->assign("$type", $depfilter[$type]); } + $smarty->assign("CurrentMainBase", $_SESSION['CurrentMainBase']); + /* Extend if we are not using javascript */ $smarty->assign("apply", apply_filter()); $smarty->assign("alphabet", generate_alphabet()); @@ -381,12 +383,12 @@ class departmentManagement extends plugin if(isset($_POST['deplist'])){ $depfilter= get_global("depfilter"); - $depfilter['depselect']= $this->config->departments[trim($_POST['deplist'])]; + $_SESSION['CurrentMainBase']= $this->config->departments[trim($_POST['deplist'])]; register_global("depfilter", $depfilter); } /* Set base for all searches */ - $base= $depfilter['depselect']; + $base= $_SESSION['CurrentMainBase']; /* Regex filter? */ if ($depfilter['regex'] != ""){