From 92cd64ac99c40c4a815eff8752d78cabe2553e57 Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 27 Jun 2006 13:13:54 +0000 Subject: [PATCH] Moved from automatic to DDC git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3946 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_workstationService.inc | 59 +++++++++++-------- plugins/admin/systems/workstationService.tpl | 10 ++-- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index dabcaa033..c61b38e95 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -310,8 +310,10 @@ class workservice extends plugin if($this->AutoSync){ $smarty->assign("AutoSyncCHK"," checked "); + $smarty->assign("hiddenState"," disabled "); }else{ $smarty->assign("AutoSyncCHK"," "); + $smarty->assign("hiddenState",""); } /* Show main page */ @@ -328,7 +330,7 @@ class workservice extends plugin { plugin::save_object(); - if(isset($_POST['gotoXHsync'])){ + if(isset($_POST['gotoXDriver'])){ if(isset($_POST['AutoSync'])){ $this->AutoSync = true; }else{ @@ -346,36 +348,41 @@ class workservice extends plugin /* Default entries can use blank hsync/vsync entries */ if ($this->dn != "" && $this->cn != "default" && $this->cn != "wdefault"){ - /* Check vsync for correct usage */ - $val= preg_replace ("/\s/", "", $this->gotoXVsync); - if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) - && chkacl ($this->acl, "gotoXVsync") == ""){ - - $message[]= _("Please specify a valid VSync range."); - } elseif (chkacl ($this->acl, "gotoXVsync") == ""){ - list($v1,$v2)= preg_split ("/[-+]/", $val); - if ($v2 != ""){ - if ($v1 > $v2){ - $message[]= _("Please specify a valid VSync range."); + /* But only if no auto sync is enabled... */ + if (!$this->AutoSync){ + + /* Check vsync for correct usage */ + $val= preg_replace ("/\s/", "", $this->gotoXVsync); + if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) + && chkacl ($this->acl, "gotoXVsync") == ""){ + + $message[]= _("Please specify a valid VSync range."); + } elseif (chkacl ($this->acl, "gotoXVsync") == ""){ + list($v1,$v2)= preg_split ("/[-+]/", $val); + if ($v2 != ""){ + if ($v1 > $v2){ + $message[]= _("Please specify a valid VSync range."); + } } } - } - /* Check hsync for correct usage */ - $val= preg_replace ("/\s/", "", $this->gotoXHsync); - if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) - && chkacl ($this->acl, "gotoXHsync") == ""){ - - $message[]= _("Please specify a valid HSync range."); - } elseif (chkacl ($this->acl, "gotoXHsync") == ""){ - list($v1,$v2)= preg_split ("/[-+]/", $val); - if ($v2 != ""){ - if ($v1 > $v2){ - $message[]= _("Please specify a valid HSync range."); + /* Check hsync for correct usage */ + $val= preg_replace ("/\s/", "", $this->gotoXHsync); + if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) + && chkacl ($this->acl, "gotoXHsync") == ""){ + + $message[]= _("Please specify a valid HSync range."); + } elseif (chkacl ($this->acl, "gotoXHsync") == ""){ + list($v1,$v2)= preg_split ("/[-+]/", $val); + if ($v2 != ""){ + if ($v1 > $v2){ + $message[]= _("Please specify a valid HSync range."); + } } } } } + return ($message); } @@ -402,8 +409,8 @@ class workservice extends plugin } if($this->AutoSync){ - $this->attrs['gotoXHsync'] = preg_replace("/-/","+",$this->attrs['gotoXHsync']) ; - $this->attrs['gotoXVsync'] = preg_replace("/-/","+",$this->attrs['gotoXVsync']) ; + $this->attrs['gotoXHsync'] = "30+55"; + $this->attrs['gotoXVsync'] = "50+70"; } /* Write back to ldap */ diff --git a/plugins/admin/systems/workstationService.tpl b/plugins/admin/systems/workstationService.tpl index 54ddff5ee..b91d824fa 100644 --- a/plugins/admin/systems/workstationService.tpl +++ b/plugins/admin/systems/workstationService.tpl @@ -121,19 +121,17 @@ {if $gotoXMonitor==""}{t}unknown{/t}{/if}{$gotoXMonitor} - - - {t}Automatic modelines{/t} - + + {t}Use DDC for automatic detection{/t} - kHz - Hz -- 2.30.2