diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index e6c2f1f88f7..3af2b62f24b 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -164,7 +164,7 @@ $daylight=(is_numeric($c) && is_numeric($b))?round($c-$b):'unknown'; //print $a." ".$b." ".$c." ".$daylight; $val=($a>=0?'+':'').$a; $val.=' ('.($a==='unknown'?'unknown':($a>=0?'+':'').($a*3600)).')'; -$val.='       '.getServerTimeZoneString().' '.($b>=0?'+':'').$b.' ('.($b>=0?'+':'').($b*3600).')'; +$val.='       '.getServerTimeZoneString(); $val.='       '.$langs->trans("DaylingSavingTime").': '.($daylight==='unknown'?'unknown':yn($daylight)); print $form->textwithtooltip($val,$txt,2,1,img_info('')); print ''."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php @@ -185,6 +185,7 @@ print '  => '.$langs->trans("CompanyHour" $var=!$var; $tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst']; print ''.$langs->trans("ClientTZ").''.($tz?($tz>=0?'+':'').$tz:'').' ('.($tz>=0?'+':'').($tz*60*60).')'; +print '       '.$_SESSION['dol_tz_string']; print '       '.$langs->trans("DaylingSavingTime").': '; if ($_SESSION['dol_dst']>0) print yn(1); else print yn(0); diff --git a/htdocs/core/js/dst.js b/htdocs/core/js/dst.js index b28c500e2c4..da74cc3b857 100644 --- a/htdocs/core/js/dst.js +++ b/htdocs/core/js/dst.js @@ -38,10 +38,12 @@ $(document).ready(function () { } else { dst = "1"; // daylight savings time is observed } + var tz=new Date().toTimeString().match(/\(.*\)/); var dst_first=DisplayDstSwitchDates('first'); var dst_second=DisplayDstSwitchDates('second'); //alert(dst); $('#tz').val(std_time_offset); // returns TZ + $('#tz_string').val(tz[0].replace('(','').replace(')','')); // returns TZ string $('#dst_observed').val(dst); // returns if DST is observed on summer $('#dst_first').val(dst_first); // returns DST first switch in year $('#dst_second').val(dst_second); // returns DST second switch in year diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index cf837db996a..827bd96ff0d 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -63,6 +63,7 @@ $(document).ready(function () { + diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e1705991b30..cdfbf27cc7d 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -383,6 +383,7 @@ if (! defined('NOLOGIN')) { $dol_authmode=$conf->authmode; // This properties is defined only when logged to say what mode was successfully used $dol_tz=$_POST["tz"]; + $dol_tz_string=$_POST["tz_string"]; $dol_dst=0; if (isset($_POST["dst_first"]) && isset($_POST["dst_second"])) { @@ -536,6 +537,7 @@ if (! defined('NOLOGIN')) $_SESSION["dol_login"]=$user->login; $_SESSION["dol_authmode"]=isset($dol_authmode)?$dol_authmode:''; $_SESSION["dol_tz"]=isset($dol_tz)?$dol_tz:''; + $_SESSION["dol_tz_string"]=isset($dol_tz_string)?$dol_tz_string:''; $_SESSION["dol_dst"]=isset($dol_dst)?$dol_dst:''; $_SESSION["dol_dst_observed"]=isset($dol_dst_observed)?$dol_dst_observed:''; $_SESSION["dol_dst_first"]=isset($dol_dst_first)?$dol_dst_first:'';