CC-4850: Upgrade Scripts -> Add default timezone and locale for each user in cc_pref
-fallback to default settings if user setting is not set
This commit is contained in:
parent
4766c3fca8
commit
9cb4633823
1 changed files with 12 additions and 2 deletions
|
@ -457,7 +457,12 @@ class Application_Model_Preference
|
|||
|
||||
public static function GetUserTimezone($id)
|
||||
{
|
||||
return self::getValue("user_timezone", true);
|
||||
$timezone = self::getValue("user_timezone", true);
|
||||
if (!$timezone) {
|
||||
return self::GetDefaultTimezone();
|
||||
} else {
|
||||
return $timezone;
|
||||
}
|
||||
}
|
||||
|
||||
public static function GetTimezone()
|
||||
|
@ -484,7 +489,12 @@ class Application_Model_Preference
|
|||
|
||||
public static function GetUserLocale($id)
|
||||
{
|
||||
return self::getValue("user_locale", true);
|
||||
$locale = self::getValue("user_locale", true);
|
||||
if (!$locale) {
|
||||
return self::GetDefaultLocale();
|
||||
} else {
|
||||
return $locale;
|
||||
}
|
||||
}
|
||||
|
||||
public static function SetUserLocale($userId, $locale = null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue