Code

Fixed default release selection.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Aug 2008 07:35:55 +0000 (07:35 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Aug 2008 07:35:55 +0000 (07:35 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12201 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/goto/admin/applications/class_applicationManagement.inc
gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc

index e1bea00f682d2c537ed9cbb0a4f9ea0489655df9..a80b4b93cd52b9c617ee2eef290e4418371257e5 100644 (file)
@@ -75,11 +75,15 @@ class faiManagement extends plugin
 
     /* Set default release */
     $this->fai_base = get_ou("faiou").$this->config->current['BASE'];
+
     if(!session::is_set("fai_filter")){
 
       /* Set intial release */
       $rel = $config->search("faiManagement","DEFAULT_RELEASE",array("menu"));
-      if(empty($rel)){
+      $rels = array_flip($this->getBranches());
+      if(isset($rels[$rel])){
+        $rel = $rels[$rel];
+      }else{
         $rel = $this->fai_base;
       }
 
@@ -95,6 +99,7 @@ class faiManagement extends plugin
     /* Call parent execute */
     plugin::execute();
 
+
     /* Initialise vars and smarty */
                $smarty         = get_smarty();
                $smarty->assign("BranchName","");
index 7d028102d40e309c9d6b6af8b32af2c3cfce9266..b3cce2714d6758782a92f3142bbd75291551ec11 100644 (file)
@@ -77,20 +77,23 @@ class applicationManagement extends plugin
     if(!$this->IsReleaseManagementActivated()){
       $this->app_base = get_ou("applicationou").$this->config->current['BASE'];
       if(!session::is_set("app_filter")){
-
-        /* Set intial release */
-        $rel = $config->search("faiManagement","DEFAULT_RELEASE",array("menu"));
-        if(empty($rel)){
-          $rel = $this->app_base;
-        }
-        session::set("app_filter",array("app_base" => $rel));
+        session::set("app_filter",array("app_base" => $this->app_base));
       }
       $app_filter     = session::get("app_filter");
-      $this->app_base = $app_filter['app_base'];
     }else{
+
+      /* Set intial release */
       $this->app_base = get_ou("applicationou").$this->config->current['BASE'];
+      $rel = $config->search("faiManagement","DEFAULT_RELEASE",array("menu"));
+      $rels = array_flip($this->getReleases());
+      if(isset($rels[$rel])){
+        $rel = $rels[$rel];
+      }else{
+        $rel = $this->app_base;
+      }
+
       if(!session::is_set("app_filter")){
-        session::set("app_filter",array("app_base" => $this->app_base,"app_release" => $this->app_base));
+        session::set("app_filter",array("app_base" => $this->app_base,"app_release" => $rel));
       }
       $app_filter         = session::get("app_filter");
       $this->app_base     = $app_filter['app_base'];
index b9d583b90ce0a4107218786ec5ba3365b638225e..989e276a00757540f38b0c2c804796d9bbbc46c7 100644 (file)
@@ -89,8 +89,18 @@ class mimetypeManagement extends plugin
       $this->mime_base = $mime_filter['mime_base'];
     }else{
       $this->mime_base = get_ou("mimetypeou").$this->config->current['BASE'];
+
+      /* Set intial release */
+      $rel = $config->search("faiManagement","DEFAULT_RELEASE",array("menu"));
+      $rels = array_flip($this->getReleases());
+      if(isset($rels[$rel])){
+        $rel = $rels[$rel];
+      }else{
+        $rel = $this->mime_base;
+      }
+
       if(!session::is_set("mime_filter")){
-        session::set("mime_filter",array("mime_base" => $this->mime_base,"mime_release" => $this->mime_base));
+        session::set("mime_filter",array("mime_base" => $this->mime_base,"mime_release" => $rel));
       }
       $mime_filter         = session::get("mime_filter");
       $this->mime_base     = $mime_filter['mime_base'];