forked from Wavyzz/dolibarr
Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -997,7 +997,7 @@ function dol_getdate($timestamp,$fast=false)
|
||||
* @param int $month Month (1 to 12)
|
||||
* @param int $day Day (1 to 31)
|
||||
* @param int $year Year
|
||||
* @param int $gm 1=Input informations are GMT values, otherwise local to server TZ
|
||||
* @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ
|
||||
* @param int $check 0=No check on parameters (Can use day 32, etc...)
|
||||
* @return int Date as a timestamp, '' if error
|
||||
* @see dol_print_date, dol_stringtotime, dol_getdate
|
||||
@@ -1023,17 +1023,28 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
if ($second< 0 || $second > 60) return '';
|
||||
}
|
||||
|
||||
if (method_exists('DateTime','getTimestamp') && empty($conf->global->MAIN_OLD_DATE))
|
||||
if (method_exists('DateTime','getTimestamp'))
|
||||
{
|
||||
if (empty($gm)) $localtz = new DateTimeZone(date_default_timezone_get());
|
||||
if (empty($gm) || $gm === 'server')
|
||||
{
|
||||
$default_timezone=@date_default_timezone_get();
|
||||
$localtz = new DateTimeZone($default_timezone);
|
||||
}
|
||||
else if ($gm === 'user')
|
||||
{
|
||||
$default_timezone=(empty($_SESSION["dol_tz_string"])?'UTC':$_SESSION["dol_tz_string"]);
|
||||
$localtz = new DateTimeZone($default_timezone);
|
||||
}
|
||||
else $localtz = new DateTimeZone('UTC');
|
||||
$dt = new DateTime(null,$localtz);
|
||||
$dt->setDate($year,$month,$day);
|
||||
$dt->setTime((int) $hour, (int) $minute, (int) $second);
|
||||
$date=$dt->getTimestamp();
|
||||
$date=$dt->getTimestamp(); // should include daylight saving time
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error('','PHP version must be 5.3+');
|
||||
/*
|
||||
$usealternatemethod=false;
|
||||
if ($year <= 1970) $usealternatemethod=true; // <= 1970
|
||||
if ($year >= 2038) $usealternatemethod=true; // >= 2038
|
||||
@@ -1045,7 +1056,7 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
else
|
||||
{
|
||||
$date=mktime($hour,$minute,$second,$month,$day,$year);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
return $date;
|
||||
}
|
||||
@@ -2223,10 +2234,10 @@ function info_admin($text, $infoonimgalt = 0, $nodiv=0)
|
||||
|
||||
if ($infoonimgalt)
|
||||
{
|
||||
return img_picto($text, 'star', 'class="hideonsmartphone"');
|
||||
return img_picto($text, 'info', 'class="hideonsmartphone"');
|
||||
}
|
||||
|
||||
return ($nodiv?'':'<div class="info hideonsmartphone">').img_picto($langs->trans('InfoAdmin'), 'star', 'class="hideonsmartphone"').' '.$text.($nodiv?'':'</div>');
|
||||
return ($nodiv?'':'<div class="info hideonsmartphone">').img_picto($langs->trans('InfoAdmin'), 'info', 'class="hideonsmartphone"').' '.$text.($nodiv?'':'</div>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user