Code

Updated modification of config items
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Apr 2011 12:56:05 +0000 (12:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 Apr 2011 12:56:05 +0000 (12:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20658 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 06ddce55ff5568ca276953f22328ca3c4ea0fd90..f0b75b544f8176a86f735c1f2e0cfb71770c81cd 100644 (file)
@@ -444,13 +444,26 @@ class newConfigManagement extends plugin
 
     function saveItemChanges()
     {
-        $this->listing->clearDialogObject();
         $item = $this->currentObject;
+        $this->listing->clearDialogObject();
         $this->TemplateEngine->save_object();
+        $values = array();
         foreach($this->TemplateEngine->getWidgets() as $w){
-            $item['values']['itemValues'][$w->getName()] = $w->getValue();
+            $values[$w->getName()] = $w->getValue();
+        }
+        $release = preg_replace("/^.*\//","",$item['values']['__release']);
+        $path = $item['values']['__path'];
+        $method = $this->cfgItemMap[$item['type']];
+
+        $rpc = $this->config->getRpcHandle();
+        $res = $rpc->setConfigItem($release, $path, $item['type'], $values);
+        if(!$rpc->success()){
+            msg_dialog::display(_("Error"), sprintf(_("Failed to load distributions: %s"), $rpc->get_error()),ERROR_DIALOG);
+            return(NULL);
+        }else{
+            $item['values']['itemValues'] = $values;
+            $this->dataModel->setItemValues($item['path'], $item['values']);
         }
-        $this->dataModel->setItemValues($item['path'], $item['values']);
     }
 }
 ?>