Code

Updated environment hotplug selection
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jan 2010 13:08:51 +0000 (13:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Jan 2010 13:08:51 +0000 (13:08 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15372 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/personal/environment/class_environment.inc
gosa-plugins/goto/personal/environment/hotplugSelect/selectHotplug-list.xml

index b87b3907126fd5e55967e32d5d26320158ce65bf..49a15dbc5b74541f5cdaeac4ea1bd660df668889 100644 (file)
@@ -821,41 +821,33 @@ class environment extends plugin
       foreach($this->gotoHotplugDevices as $plugs){
         $tmp[] = $plugs['name'];
       }
-      $this->dialog = new hotplugDialog($this->config,$tmp);
+      $this->dialog = new hotplugSelect($this->config, get_userinfo());
       $this->is_dialog = true;
     }
 
     /* Dialog Aborted */
-    if(isset($_POST['HotPlugCancel'])){
-      unset($this->dialog);
+    if(isset($_POST['hotplugSelect_cancel'])){
       $this->dialog= FALSE;
       $this->is_dialog = false;
     }
 
     /* Dialod saved */
-    if(isset($_POST['HotPlugSave'])){
+    if(isset($_POST['hotplugSelect_save'])){
 
-      $this->dialog->save_object();
-      if(count($this->dialog->check())!=0){
-        foreach($this->dialog->check() as $msg){
-          msg_dialog::display(_("Error"), $msg, ERROR_DIALOG);
-        }
-      }else{
-        $this->dialog->save_object();
-        $a_tmp = $this->dialog->save();
-
-        if(is_array($a_tmp)){
-          foreach($a_tmp as $name => $hotplug){
-            if($this->multiple_support_active){
-              $hotplug['UsedByAllUsers'] = TRUE;
-            }
-            $this->gotoHotplugDevices[$name]= $hotplug; 
-          }
+      $res = $this->dialog->save();
+      foreach($res as $hotplug){
+        $name = $hotplug['cn'][0];
+        if($this->multiple_support_active){
+          $hotplug['UsedByAllUsers'] = TRUE;
         }
-        unset($this->dialog);
-        $this->dialog= FALSE;
-        $this->is_dialog = false;
+        $this->gotoHotplugDevices[$name]= $hotplug; 
       }
+      $this->dialog= FALSE;
+      $this->is_dialog = false;
+    }
+
+    if($this->dialog instanceOf hotplugSelect){
+      return($this->dialog->execute());
     }
 
     if($this->multiple_support_active){
index 080ea4bd81983b17ce3ed769495ea2376eb4878d..1241d5a9f9f5bfac9b94fc369720f4bf4af20574 100644 (file)
@@ -20,9 +20,6 @@
 
   </definition>
 
-
-  </definition>
-
   <table>
     <layout>|20px;c|||</layout>