Skip to content
Snippets Groups Projects
Commit 5234b466 authored by Jared Hancock's avatar Jared Hancock
Browse files

i18n: Cascade to system default timezone

parent b86013b4
No related branches found
No related tags found
No related merge requests found
......@@ -258,18 +258,23 @@ class OsticketConfig extends Config {
return $this->get('default_timezone');
}
function getTimezone() {
function getTimezone($user=false) {
global $thisstaff, $thisclient;
if ($thisstaff)
$zone = $thisstaff->getTimezone();
#elseif ($thisclient)
# $zone = $thisclient->getTimezone();
else
$user = $user ?: $thisstaff;
if (!$user && $thisclient)
$user = $thisclient->getAccount();
if ($user)
$zone = $user->getTimezone();
if (!$zone)
$zone = $this->get('default_timezone');
if (!$zone)
$zone = ini_get('date.timezone');
return $zone;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment