Fix: Add information to help debug pb with TZ.

This commit is contained in:
Laurent Destailleur 2014-07-04 11:58:41 +02:00
parent 57b546650a
commit 11abba30b3
2 changed files with 16 additions and 7 deletions

View File

@ -177,13 +177,20 @@ $var=!$var;
print '<tr '.$bc[$var].'><td width="300">&nbsp; => dol_get_first_day(1970,1,false)</td><td>'.dol_get_first_day(1970,1,false).' &nbsp; &nbsp; (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,false),'dayhour').')</td>';
$var=!$var;
print '<tr '.$bc[$var].'><td width="300">&nbsp; => dol_get_first_day(1970,1,true)</td><td>'.dol_get_first_day(1970,1,true).' &nbsp; &nbsp; (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970,1,true),'dayhour').')</td>';
// Parent company
/*
$var=!$var;
print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("CompanyTZ").'</td><td>'.$langs->trans("FeatureNotYetAvailable").'</td></tr>'."\n";
$var=!$var;
print '<tr '.$bc[$var].'><td width="300">&nbsp; => '.$langs->trans("CompanyHour").'</td><td>'.$langs->trans("FeatureNotYetAvailable").'</td></tr>'."\n";
*/
// Database timezone
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
{
$var=!$var;
print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
$sql="SHOW VARIABLES where variable_name = 'system_time_zone'";
$resql = $db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
print $form->textwithtooltip($obj->Value,$langs->trans('TZHasNoEffect'),2,1,img_info(''));
}
print '</td></tr>'."\n";
}
// Client
$var=!$var;
$tz=(int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];

View File

@ -63,6 +63,8 @@ ShowPreview=Show preview
PreviewNotAvailable=Preview not available
ThemeCurrentlyActive=Theme currently active
CurrentTimeZone=TimeZone PHP (server)
MySQLTimeZone=TimeZone MySql (database)
TZHasNoEffect=Dates are stored and returned by database server as if they were kept as submited string. The timezone has effect only when using UNIX_TIMESTAMP function (that should not be used by Dolibarr, so database TZ should have no effect, even if changed after data was entered).
Space=Space
Table=Table
Fields=Fields