Code

Updated Device Config
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2011 13:46:02 +0000 (13:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 17 May 2011 13:46:02 +0000 (13:46 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20852 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Device/class_DeviceConfig.inc

index 9ef1819447486d5a7ad0625c0847ac6c8b5f11ea..a9a706c2cc0133bacf5ee7b7f9b6ccf1b13cc6e9 100644 (file)
@@ -39,7 +39,7 @@ class DeviceConfig extends plugin
         $this->assignableElementsList->setEditable(TRUE);
         $this->assignableElementsList->setWidth("100%");
         $this->assignableElementsList->setHeight("200px");
-        $this->assignableElementsList->setHeader(array(_("Name")));
+        $this->assignableElementsList->setHeader(array(_("Name"),_("Description"),_("Add")));
         $this->assignableElementsList->setColspecs(array('*','*','20'));
         $this->assignableElementsList->setAcl('rwcdm');
 
@@ -50,7 +50,7 @@ class DeviceConfig extends plugin
         $this->usedElementsList->setEditable(FALSE);
         $this->usedElementsList->setWidth("100%");
         $this->usedElementsList->setHeight("200px");
-        $this->usedElementsList->setHeader(array(_("Name")));
+        $this->usedElementsList->setHeader(array(_("Name"), _("Description"), _("Remove")));
         $this->usedElementsList->setColspecs(array('*','*','20'));
         $this->usedElementsList->setAcl('rwcdm');
 
@@ -251,13 +251,25 @@ class DeviceConfig extends plugin
      */
     function save()
     {
+        // Load assignable elements.
+        $rpc = $this->config->getRpcHandle();
+        $release = $this->parent->by_object['InstallRecipe']->installRelease;
+        $release = preg_replace("/^[^\/]+\//","", $release);
+        $assignableElements = $rpc->listAssignableElements($release);
+        if(!$rpc->success()){
+            msg_dialog::display(_("Error"), msgPool::rpcError($rpc->get_error()), ERROR_DIALOG);
+            return(NULL);
+        }else{
+            $this->assignableElements = $assignableElements;
+        }
+
         // Collect paramter list.
         $params = array();
         foreach($this->usedElements as $name){
             if(isset($this->assignableElements[$name]['parameter'])){
-                $params = array_merge($this->assignableElements[$name]['parameter']);
+                $params = array_merge($params, $this->assignableElements[$name]['parameter']);
             }
-        }    
+        }  
 
         // Decide whoch parameter has to be saved and which has to be removed.
         $save = array();