Code

Updated Config management data model
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 May 2011 07:06:09 +0000 (07:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 May 2011 07:06:09 +0000 (07:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20871 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index b474d4ece18718c502f6ab782426b34543e8d8fe..3f9a525955a9577d5fc5f2dc334c15e360273c92 100644 (file)
@@ -148,8 +148,7 @@ class ConfigManagement extends plugin
     function updateDataModel()
     {
         // Recreate the data model, to have a clean and fresh instance.
-        $this->dataModel = new ConfigManagementDataModel();
-
+        $this->dataModel = new ConfigManagementDataModel($this->config);
 
         // Load templates from the backend and append them on the base 
         $rpc = $this->config->getRpcHandle();
@@ -614,8 +613,6 @@ class ConfigManagement extends plugin
     {
         $item = $this->dataModel->getItemByDn($ids[0]);
 
-        if(!$item) return;
-
         $release = $this->getReleasePart($item['path']);
         $path = $this->getItemPath($item['path']);
         $method = $this->cfgItemMap[$item['type']];
index d73e35f06d0227c2b6ff655294e20fe0d6d9ac9e..b76c1746546196267432b5d387aa57fc3c037b7a 100644 (file)
@@ -6,9 +6,11 @@ class ConfigManagementDataModel
     public $typeToPath = array();
     public $idToPath = array();
     public $dnToPath = array();
+    public $config = NULL;
 
-    function __construct()
+    function __construct($config)
     {
+        $this->config = &$config;
         $this->data = array();
         $this->data['linear'] = array();
         $this->data['recursive'] = array();
@@ -66,7 +68,7 @@ class ConfigManagementDataModel
         if($path == ""){
             $parentItem = &$this->data['recursive'];
             $parentId = NULL;
-            $parentDn = "";
+            $parentDn = $this->config->current['BASE'];
         }elseif(isset($this->data['linear'][$path])){
             $parentItem = &$this->data['linear'][$path]['children'];
             $parentId = $this->data['linear'][$path]['id'];
@@ -97,7 +99,8 @@ class ConfigManagementDataModel
         $this->data['linear'][$entryPath] = &$parentItem[$entryPath];
 
         $this->idToPath[$entryId] = $entryPath;
-        $this->idToPath[$entryDn] = $entryPath;
+        $this->dnToPath[$entryDn] = $entryPath;
+
         $this->typeToPath[$type][$name] = $entryPath;
     
         return($entryId);