From c79feb6ae9a3c1c32200d7c92ec23732c43fd424 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 14 Apr 2011 07:26:39 +0000 Subject: [PATCH] Updated item handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20727 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_newConfigManagement.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 3b9ccb04d..58afd625c 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -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(); -- 2.30.2