Code

Updated Release handling in fai Management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Mar 2010 06:41:32 +0000 (06:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 Mar 2010 06:41:32 +0000 (06:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17372 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/fai/admin/fai/class_faiManagement.inc
gosa-plugins/fai/admin/fai/fai-list.xml

index 6ed3e961e9bd063be5c0a461b174c8469d2e6392..caae4b9a9c88770c194d2610130ae8c8616307a0 100644 (file)
@@ -643,14 +643,24 @@ class faiManagement extends management
           }
 
           /* Post remove */
-          $this->fai_release = $this->fai_base;
+          $this->fai_release = preg_replace("/^[^,]*+,/","", $this->fai_release);
+
           $this->lock_name   = $name;
           $this->lock_dn     = $bb;
           $this->handle_post_events('remove');
 
-          $fai_filter = session::get("fai_filter");
-          $fai_filter['fai_release'] = $this->fai_release;
-          session::set("fai_filter",$fai_filter);
+          // Update list and release selector to point to a valid release again.
+          $releases = $this->getReleaseList();
+          if(!isset($releases[$this->fai_releaes])){
+            $this->fai_release = $this->fai_base;
+          }
+
+          $headpage = $this->getHeadpage();
+          $headpage->setBase($this->fai_release);
+          $headpage->update();
+
+          $this->releaseSelector->setBases($releases);
+          $this->releaseSelector->setBase($this->fai_release);
 
           new log("remove","fai/".get_class($this),$br[$bb],array(),"Release removed");
         }
@@ -856,10 +866,16 @@ class faiManagement extends management
             "Daemon events called but classes where not accessible, DaemonEvent gosaSupportDaemon",
             FATAL_ERROR_DIALOG);
       }
-      
+    
+      // Update list and release selector to point to the newly created release 
+      $headpage = $this->getHeadpage();
+      $this->fai_release = $targetReleaseDN;
+      $headpage->setBase($this->fai_release);
+      $headpage->update();
       $releases = $this->getReleaseList();
       $this->releaseSelector->setBases($releases);
-      $this->releaseSelector->setBase($targetReleaseDN);
+      $this->releaseSelector->setBase($this->fai_release);
       exit();
     }
   }
index db32326a5216c509fa383bc51152c110f7169dd6..792cb4d28dbd064395582cca0aebb0d186a749ee 100644 (file)
       <name>remove_multiple</name>
       <type>entry</type>
       <image>images/lists/trash.png</image>
-      <label>Remove</label>
+      <label>Remove entries</label>
+    </action>
+
+    <action>
+      <type>separator</type>
     </action>
 
     <action>
      <name>createBranch</name>
      <type>entry</type>
-     <image>images/lists/element.png[new]</image>
+     <image>plugins/fai/images/branch_small.png[new]</image>
      <label>Create branch</label>
     </action>
 
     <action>
      <name>createFreeze</name>
      <type>entry</type>
-     <image>images/lists/element.png[new]</image>
+     <image>plugins/fai/images/freeze.png[new]</image>
      <label>Create freeze</label>
     </action>
 
+    <action>
+     <name>removeBranch</name>
+     <type>entry</type>
+     <image>images/lists/trash.png</image>
+     <label>Remove release</label>
+    </action>
+
+    <action>
+      <type>separator</type>
+    </action>
+
     <action>
       <type>exporter</type>
     </action>