X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FSelectValues.php;h=c15c14f66283e3bbb3046c7f74efe8c246eab26b;hb=d8c1f86a82922cc8accf1b6e3f5d2b8f62efab3d;hp=4dbdc153c974e181b5fc868635819fe11c65f3dc;hpb=0094bba6164a4c7f93fe39fad6d9b3a40efc9e5c;p=civicrm-core.git diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 4dbdc153c9..c15c14f662 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -1037,7 +1037,7 @@ class CRM_Core_SelectValues { ]; $custom = civicrm_api3('CustomField', 'get', [ 'return' => ['name', 'label', 'custom_group_id.title'], - 'custom_group_id.extends' => ['IN' => ['Contact', 'Individual', 'Organization', 'Household']], + 'custom_group_id.extends' => ['IN' => array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes())], 'data_type' => ['NOT IN' => ['ContactReference', 'Date', 'File']], 'custom_group_id.is_active' => 1, 'is_active' => 1, @@ -1111,4 +1111,22 @@ class CRM_Core_SelectValues { ]; } + public static function timezone() { + $tzlist = &Civi::$statics[__CLASS__]['tzlist']; + + if (is_null($tzlist)) { + $tzlist = []; + foreach (timezone_identifiers_list() as $tz) { + // Actual timezone keys for PHP are mapped to human parts. + $tzlist[$tz] = str_replace('_', ' ', $tz); + } + + // Add 'Etc/UTC' specially, as timezone_identifiers_list() does + // not include it, but it is the IANA long name for 'UTC' + $tzlist['Etc/UTC'] = ts('Etc/UTC'); + } + + return $tzlist; + } + }