Code

Updated release creation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Apr 2011 10:32:44 +0000 (10:32 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Apr 2011 10:32:44 +0000 (10:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20747 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc

index 2b92346270e932a952ff6b6fead2b49751747f86..79b0d2e6c72caf4178246ceb6603d9e5aaa24057 100644 (file)
@@ -667,6 +667,35 @@ class newConfigManagement extends plugin
 
                 $this->listing->clearDialogObject();
 
+            }elseif($type == 'Release'){
+            
+                // We've to create a new release 
+
+                // Build up the new release path.
+                $name = $values['name'];
+                $rPath = $this->getReleasePart($this->selectedContainer);
+                $newPath = trim($rPath."/".$name, '/');
+    
+                // Detect the parent distribution
+                $dist = $this->getDistributionPath($this->selectedContainer);
+                $dist = preg_replace("#^/root/#", "", $dist);
+
+                // Initiate the rpc request.
+                $rpc = $this->config->getRpcHandle();
+                $res = $rpc->createRelease($dist, $newPath);
+                if(!$rpc->success()){
+                    msg_dialog::display(_("Error"), sprintf(_("Failed to save release: %s"), $rpc->get_error()),ERROR_DIALOG);
+                    return(NULL);
+                }else{
+
+                    // We've successfully added the item, now add it to the tree.
+                    $this->dataModel->addItem($type, $this->selectedContainer, $values['name'],array(), '-' );
+
+                    // Finally - close the dialog. 
+                    $this->listing->clearDialogObject();
+                }
+                
+                $this->listing->clearDialogObject();
             }else{
 
                 echo "{$type} Cannot be saved yet";