Code

Updated item handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Apr 2011 07:26:39 +0000 (07:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Apr 2011 07:26:39 +0000 (07:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20727 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 3b9ccb04d64ac3da38bc6bcd3f928d9dda6955a5..58afd625ca95429184743be406ad7471fb5ee800 100644 (file)
@@ -497,18 +497,17 @@ class newConfigManagement extends plugin
     {
         // We've to add a config item
         $this->TemplateEngine->load($this->itemConfig);
-        if(isset($this->cfgItemMap[$type])){
+        if($this->cfgItemMap[$item['type']] != 'root'){
             $method = $this->cfgItemMap[$type];
             $this->TemplateEngine->setTemplate($method.".tpl");
             $this->TemplateEngine->setValues($type,array());
             $this->listing->setDialogObject($this->TemplateEngine);
             $this->currentObject = NULL;
-        }elseif($type == 'Distribution'){
+        }else{
             $this->TemplateEngine->setTemplate("root.tpl");
             $this->TemplateEngine->setValues($type,array());
             $this->listing->setDialogObject($this->TemplateEngine);
             $this->currentObject = NULL;
-        }elseif($type == 'Release'){
         }
     }
 
@@ -550,6 +549,12 @@ class newConfigManagement extends plugin
     function saveItemChanges()
     {
         $item = $this->currentObject;
+        $type = $this->TemplateEngine->getItemType();
+        if($this->cfgItemMap[$item['type']] == 'root'){
+            echo "{$type} Cannot be saved yet";
+            $this->listing->clearDialogObject();
+            return;
+        }
 
         // Null means a new  object has to be added.        
         if($item == NULL){
@@ -557,7 +562,6 @@ class newConfigManagement extends plugin
             // Save template engine modifications
             $this->TemplateEngine->save_object();
             $release = preg_replace("/^.*\//","", $this->getReleasePath($this->selectedContainer));
-            $type = $this->TemplateEngine->getItemType();
 
             // Collect modified values
             $values = array();