From 876223e30b09faf279b45dca2937a34300a588c7 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 19 May 2011 07:06:09 +0000 Subject: [PATCH] Updated Config management data model git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20871 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/newConfigManagement/class_ConfigManagement.inc | 5 +---- .../class_ConfigManagementDataModel.inc | 9 ++++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagement.inc index b474d4ece..3f9a52595 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagement.inc @@ -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']]; diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc index d73e35f06..b76c17465 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc @@ -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); -- 2.30.2