Code

Updated removeItem method
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 11 Apr 2011 06:38:36 +0000 (06:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 11 Apr 2011 06:38:36 +0000 (06:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20670 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 062d4681879094968d2d41a611cc6232e9cba6cd..16dd8fcc072272903fbacfae5867892d091f4aaa 100644 (file)
@@ -19,6 +19,13 @@ class ConfigManagementDataModel
         return($this->data);
     }
 
+    function removeItem($path)
+    {
+        $item = &$this->data['linear'][$path];
+        $parent = &$this->data['linear'][$item['parentPath']];
+        unset($parent['children'][$path]);
+        unset($this->data['linear'][$path]);
+    }
 
     function addItem($type, $path, $name, $values = array(), $status = "")
     {
index e146ea10d7c12d72913fc55aadc28fe6b7e7dd9a..5812db35ec426d46ef626063ec17b9e992e52d1c 100644 (file)
@@ -432,10 +432,11 @@ class newConfigManagement extends plugin
         $path = $item['values']['__path'];
         $rpc = $this->config->getRpcHandle();
         $rpc->removeConfigItem($release, $path);
-
         if(!$rpc->success()){
             msg_dialog::display(_("Error"), sprintf(_("Failed to remove: %s"), $rpc->get_error()),ERROR_DIALOG);
             return(NULL);
+        }else{
+            $this->dataModel->removeItem($item['path']);
         }
     }