From 3e667d16f34b93bc2655bf62d38f7ad36d6bf037 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 5 Apr 2011 06:35:23 +0000 Subject: [PATCH] Updated config management git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20649 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_ConfigManagementListing.inc | 5 ++- .../class_newConfigManagement.inc | 32 +++++++++---------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc index 762353f43..de47f981e 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc @@ -202,10 +202,13 @@ class ConfigManagementListing extends management function editEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") { + // Update the template engine to use another type of item and + // some other values. + $item = $this->parent->dataModel->getItemById($target[0]); + $this->parent->TemplateEngine->setValues($item['type'],array('data' => array())); $this->dialogObject = $this->parent->TemplateEngine; $this->skipFooter = TRUE; $this->dialog = TRUE; - } } diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index f3d169819..a5bcdd1dc 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -13,6 +13,7 @@ class newConfigManagement extends plugin var $dataModel = NULL; var $listing = NULL; + var $cfgTypeMap = NULL; /*! \brief Initialize the plugin and finally update the data model. */ @@ -205,8 +206,12 @@ class newConfigManagement extends plugin $this->listing->setContainers($this->getContainerList()); $this->listing->setContainer($cont); - $this->setInstallMethod('puppet'); - + // Set the correct installation method for the selected item + $item = $this->dataModel->getItemByPath($cont); + if($this->cfgTypeMap[$item['type']]){ + $method = $this->cfgTypeMap[$item['type']]; + $this->setInstallMethod($method); + } } @@ -220,7 +225,6 @@ class newConfigManagement extends plugin // packages and items. $res = $this->listing->execute(); $this->listing->setListingTypes($this->getListingTypes()); - return($res); } @@ -300,6 +304,15 @@ class newConfigManagement extends plugin msg_dialog::display(_("Setup"), $this->errorMessage , ERROR_DIALOG); $this->initFailed = TRUE; return; + }else{ + + $this->cfgTypeMap = array(); + foreach($this->installationMethods as $methodName => $data){ + foreach($data['items'] as $itemName => $itemData){ + $this->cfgTypeMap[$itemName] = $methodName; + } + } + } } @@ -343,19 +356,6 @@ class newConfigManagement extends plugin } - /*! \brief Acts on edit requests and opens an edit dialog for the received item-id. - * (This action is received from the ConfigManagementListing class.) - * @param Array The items ids. (May contain multiple ids) - * @return - */ - function editEntry($ids) - { - // Update the template engine to use another type of item and - // some other values. - $this->TemplateEngine->setValues('PuppetTemplate',array('data' => array())); - } - - /*! \brief The plugins ACL and plugin-property definition. * @return */ -- 2.30.2