From: hickert Date: Thu, 14 Apr 2011 08:06:26 +0000 (+0000) Subject: Updated saving of additional types X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=75a8fe0478caf079202d47f68b45fbd6e79d75e5;p=gosa.git Updated saving of additional types git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20728 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 58afd625c..faa9f1e93 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -442,24 +442,25 @@ class newConfigManagement extends plugin */ function removeEntry($ids) { + foreach($ids as $id){ + $item = $this->dataModel->getItemById($id); - $item = $this->dataModel->getItemById($ids[0]); + // Is an config item. + if($this->cfgItemMap[$item['type']] != 'root'){ + $release = preg_replace("/^.*\//","", $this->getReleasePath($item['path'])); + $path = $this->getItemPath($item['path']); - // Is an config item. - if($this->cfgItemMap[$item['type']] != 'root'){ - $release = preg_replace("/^.*\//","", $this->getReleasePath($item['path'])); - $path = $this->getItemPath($item['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); + $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']); + } }else{ - $this->dataModel->removeItem($item['path']); + echo $item['type']." - are not handled yet!"; } - }else{ - echo $item['type']." - are not handled yet!"; } } @@ -497,7 +498,7 @@ class newConfigManagement extends plugin { // We've to add a config item $this->TemplateEngine->load($this->itemConfig); - if($this->cfgItemMap[$item['type']] != 'root'){ + if($this->cfgItemMap[$type] != 'root'){ $method = $this->cfgItemMap[$type]; $this->TemplateEngine->setTemplate($method.".tpl"); $this->TemplateEngine->setValues($type,array()); @@ -550,7 +551,7 @@ class newConfigManagement extends plugin { $item = $this->currentObject; $type = $this->TemplateEngine->getItemType(); - if($this->cfgItemMap[$item['type']] == 'root'){ + if($this->cfgItemMap[$type] == 'root'){ echo "{$type} Cannot be saved yet"; $this->listing->clearDialogObject(); return; diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/puppet.tpl b/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/puppet.tpl index 8b8d95b56..ffa27f73c 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/puppet.tpl +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/puppet.tpl @@ -24,6 +24,30 @@ {/if} +{if $type == 'PuppetManifest'} + + + + + + + + + +
{$nameName}{$name}
{$dataName}{$data}
+{/if} +{if $type == 'PuppetFile'} + + + + + + + + + +
{$nameName}{$name}
{$dataName}{$data}
+{/if} {if $type == 'PuppetTemplate'} @@ -35,5 +59,4 @@
{$data}
- {/if}