Code

Fix for #4146
[gosa.git] / trunk / gosa-plugins / goto / admin / systems / goto / class_workstationService.inc
index 1ff57a860b139071e16e74a58377fbc6da81beb9..4e122d898bf859c892051095fa47f56c8ae8bc56 100644 (file)
@@ -84,8 +84,13 @@ class workservice extends plugin
       $this->XDrivers[$xdriver] = $xdriver;
     }
 
-    array_unshift($this->XDrivers, "["._("manual/auto")."]");
+    if (isset($this->attrs['gosaGroupObjects'])) {
+      array_unshift($this->XDrivers, "["._("manual/auto")."]");
+    }
+    else {
+      array_unshift($this->XDrivers, "["._("unknown")."]");
+    }
+     
     $this->XColordepths= array( 
         "8"        => "8 " ._("bit"), 
         "15"       => "15 "._("bit"),      
@@ -196,7 +201,10 @@ class workservice extends plugin
         
         switch ($name){
           case 'gotoXDriver':
-            $this->XDrivers = array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XDrivers;
+            $ogroup_driver = $attrs['gotoXDriver'][0];
+            if (in_array($ogroup_driver, $this->XDrivers) && (empty($this->attrs['gotoXDriver']))) {
+                $this->XDrivers = array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XDrivers;
+            }
             break;
           case 'gotoXResolution':
             $this->XResolutions= array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XResolutions;