Code

Updated saving of additional types
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Apr 2011 08:06:26 +0000 (08:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 14 Apr 2011 08:06:26 +0000 (08:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20728 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc
gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/puppet.tpl

index 58afd625ca95429184743be406ad7471fb5ee800..faa9f1e93829406b1279cf377b88553e2817a3a1 100644 (file)
@@ -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;
index 8b8d95b5672d2e23c35bd5dcd25c28125440bc9e..ffa27f73caa585724953c07a03ab57feec2743b0 100644 (file)
         </tr>
     </table>
 {/if}
+{if $type == 'PuppetManifest'}
+    <table>
+        <tr>
+            <td>{$nameName}</td>
+            <td>{$name}</td>
+        </tr>
+        <tr>
+            <td>{$dataName}</td>
+            <td>{$data}</td>
+        </tr>
+    </table>
+{/if}
+{if $type == 'PuppetFile'}
+    <table>
+        <tr>
+            <td>{$nameName}</td>
+            <td>{$name}</td>
+        </tr>
+        <tr>
+            <td>{$dataName}</td>
+            <td>{$data}</td>
+        </tr>
+    </table>
+{/if}
 {if $type == 'PuppetTemplate'}
     <table>
         <tr>
@@ -35,5 +59,4 @@
             <td>{$data}</td>
         </tr>
     </table>
-    <input type='submit'>    
 {/if}