Code

Fixed typo,
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jun 2006 07:27:41 +0000 (07:27 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jun 2006 07:27:41 +0000 (07:27 +0000)
Already used hotplug are now hiden in select list

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3845 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/class_hotplugDialog.inc

index bb4f7147ed2fe721fe6f5a3ac7afd44cb045a691..a2347964cd293988d39f64e5f4546291ee30eaba 100644 (file)
@@ -123,7 +123,7 @@ class environment extends plugin
           $tmp[4] = "";
         }
   
-        $tmp2['product']     = $tmp[3]; 
+        $tmp2['produkt']     = $tmp[3]; 
         $tmp2['vendor']      = $tmp[4];
  
         $this->gotoHotplugDevices[$tmp[0]]=$tmp2;
@@ -647,7 +647,11 @@ class environment extends plugin
 
     /* There are already defined hotplugs from other users we could use */
     if(isset($_POST['gotoHotplugDeviceUse'])){
-      $this->dialog = new hotplugDialog($this->config,$this->dn,true);
+      $tmp  =array();
+      foreach($this->gotoHotplugDevices as $plugs){
+        $tmp[] = $plugs['name'];
+      }
+      $this->dialog = new hotplugDialog($this->config,$this->dn,true,$tmp);
       $this->is_dialog = true;
     }
 
index 238bb9d2404ced79d8337bcea9081b57897557da..6adf308960bdd98941970712ea6cca90d85d4d76 100644 (file)
@@ -24,11 +24,12 @@ class hotplugDialog extends plugin
   var $regex                    = "*";
   var $depselect                = "/";
   var $deplist                  = "/";
+  var $skipThese                = array();
 
-
-  function hotplugDialog ($config, $dn= NULL,$use_existing=false )
+  function hotplugDialog ($config, $dn= NULL,$use_existing=false ,$skipThese = array())
   {
     $this->use_existing = $use_existing;
+    $this->skipThese    = $skipThese;
     plugin::plugin ($config, $dn);
     $this->depselect = $this->config->current['BASE'];
   }
@@ -179,6 +180,9 @@ class hotplugDialog extends plugin
           $tmp = split("\|",$device);
           
           if(preg_match("/^".str_replace("*","",$this->regex).".*/i",$tmp[0])){
+  
+            if(in_array($tmp[0],$this->skipThese)) continue;
+
             $a_return[$tmp[0]]= $tmp[0]." [".$tmp[1]."] ".$tmp[2];
             
             $tmp2['name']         = $tmp[0];