Code

Added remove method
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Apr 2011 10:06:11 +0000 (10:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 8 Apr 2011 10:06:11 +0000 (10:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20666 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc
gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc

index 7879644482067350a6c3c50295f6cef97b9a6e21..1b19ef7571c07f357a17e3ccafbafcd5e0ffe1ac 100644 (file)
@@ -240,7 +240,7 @@ class ConfigManagementListing extends management
 
     function removeEntryRequested($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
     {
-//        $this->parent->removeEntry($target);
+        $this->parent->removeEntry($target);
     }
 
     function newEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
index 5f56ac0bb7f655dafdb673fc6000bc7433a7f79e..08ad944334c86a1a7508a4018a8df3436496de05 100644 (file)
@@ -425,6 +425,20 @@ class newConfigManagement extends plugin
     {
     }
 
+    function removeEntry($ids)
+    {
+        $item = $this->dataModel->getItemById($ids[0]);
+
+        $release = preg_replace("/^.*\//","",$item['values']['__release']);
+        $path = $item['values']['__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);
+        }
+    }
 
     function editEntry($ids)
     {