X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FSelectValues.php;h=c15c14f66283e3bbb3046c7f74efe8c246eab26b;hb=d8c1f86a82922cc8accf1b6e3f5d2b8f62efab3d;hp=7d4522cebb4a2071d243ff91bb8a7c2350ce4695;hpb=98c65eb08b189d74d23e80ab9749431e6aaf7118;p=civicrm-core.git diff --git a/CRM/Core/SelectValues.php b/CRM/Core/SelectValues.php index 7d4522cebb..c15c14f662 100644 --- a/CRM/Core/SelectValues.php +++ b/CRM/Core/SelectValues.php @@ -595,7 +595,7 @@ class CRM_Core_SelectValues { $tokenProcessor = new TokenProcessor(Civi::dispatcher(), ['schema' => ['participantId']]); $allTokens = $tokenProcessor->listTokens(); foreach (array_keys($allTokens) as $token) { - if (strpos($token, '{domain.') === 0) { + if (strpos($token, '{domain.') === 0 || strpos($token, '{event.') === 0) { unset($allTokens[$token]); } } @@ -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, @@ -1101,4 +1101,32 @@ class CRM_Core_SelectValues { ]; } + /** + * @return array + */ + public static function andOr() { + return [ + 'AND' => ts('And'), + 'OR' => ts('Or'), + ]; + } + + 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; + } + }