From: hickert Date: Thu, 12 Jan 2006 10:19:51 +0000 (+0000) Subject: Added auto field for H-v sync X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ca057fbf14acc2fc649d95aba2ab1438739e6c20;p=gosa.git Added auto field for H-v sync git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2457 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_workstationService.inc b/plugins/admin/systems/class_workstationService.inc index dd41f8bc3..c80b799fb 100644 --- a/plugins/admin/systems/class_workstationService.inc +++ b/plugins/admin/systems/class_workstationService.inc @@ -15,6 +15,7 @@ class workservice extends plugin var $gotoXColordepth= ""; var $gotoXHsync= ""; var $gotoXVsync= ""; + var $AutoSync = false; var $gotoXKbModel= ""; var $gotoXKbLayout= ""; var $gotoXKbVariant= ""; @@ -104,6 +105,12 @@ class workservice extends plugin } } + if(preg_match("/\+/",$this->gotoXHsync)){ + $this->AutoSync = true; + $this->gotoXHsync = preg_replace("/\+/","-",$this->gotoXHsync); + $this->gotoXVsync = preg_replace("/\+/","-",$this->gotoXVsync); + } + $this->hardware_list["automatic"]= _("automatic"); ksort($this->hardware_list); } @@ -186,6 +193,13 @@ class workservice extends plugin $hl.= "\n"; $smarty->assign ("hardware_list", $hl); $smarty->assign ("gotoXMonitor", $this->gotoXMonitor); + $smarty->assign("AutoSyncACL",chkacl($this->acl,"AutoSync")); + + if($this->AutoSync){ + $smarty->assign("AutoSyncCHK"," checked "); + }else{ + $smarty->assign("AutoSyncCHK"," "); + } /* Show main page */ return($smarty->fetch (get_template_path('workstationService.tpl',TRUE,dirname(__FILE__)))); @@ -196,15 +210,20 @@ class workservice extends plugin $this->handle_post_events("remove"); } - /* Save data to object */ function save_object() { plugin::save_object(); + if(isset($_POST['gotoXHsync'])){ + if(isset($_POST['AutoSync'])){ + $this->AutoSync = true; + }else{ + $this->AutoSync = false; + } + } } - /* Check supplied data */ function check() { @@ -215,7 +234,7 @@ class workservice extends plugin /* Check vsync for correct usage */ $val= preg_replace ("/\s/", "", $this->gotoXVsync); - if (!preg_match ("/^\d+(\.\d+)?([-+]\d+(\.\d+)?)?$/", $val) + if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) && chkacl ($this->acl, "gotoXVsync") == ""){ $message[]= _("Please specify a valid VSync range."); @@ -230,7 +249,7 @@ class workservice extends plugin /* Check hsync for correct usage */ $val= preg_replace ("/\s/", "", $this->gotoXHsync); - if (!preg_match ("/^\d+(\.\d+)?([-+]\d+(\.\d+)?)?$/", $val) + if (!preg_match ("/^\d+(\.\d+)?([-]\d+(\.\d+)?)?$/", $val) && chkacl ($this->acl, "gotoXHsync") == ""){ $message[]= _("Please specify a valid HSync range."); @@ -263,6 +282,11 @@ class workservice extends plugin } } + if($this->AutoSync){ + $this->attrs['gotoXHsync'] = preg_replace("/-/","+",$this->attrs['gotoXHsync']) ; + $this->attrs['gotoXVsync'] = preg_replace("/-/","+",$this->attrs['gotoXVsync']) ; + } + /* Write back to ldap */ $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); diff --git a/plugins/admin/systems/workstationService.tpl b/plugins/admin/systems/workstationService.tpl index 1cde8e980..3346fca5f 100644 --- a/plugins/admin/systems/workstationService.tpl +++ b/plugins/admin/systems/workstationService.tpl @@ -118,7 +118,13 @@ - + + + + +
{t}Type{/t}{$gotoXMonitor}{if $gotoXMonitor==""}{t}unknown{/t}{/if}{$gotoXMonitor}
+ {t}Automatic modelines{/t} +