'create' => "Options are filtered appropriately for the object being created/updated. Labels are translated.",
'search' => "Searchable options are returned. Labels are translated.",
'validate' => "All options are returned, even if they are disabled. Machine names are used in place of labels.",
+ 'abbreviate' => "Active options are returned, and labels are replaced with abbreviations.",
);
// Validation: enforce uniformity of this param
if ($context !== NULL && !isset($contexts[$context])) {
'labelColumn' => CRM_Utils_Array::value('labelColumn', $pseudoconstant),
);
+ if ($context == 'abbreviate') {
+ switch ($fieldName) {
+ case 'state_province_id':
+ $params['labelColumn'] = 'abbreviation';
+ break;
+ case 'country_id':
+ $params['labelColumn'] = 'iso_code';
+ break;
+ default:
+ }
+ }
+
// Fetch option group from option_value table
if (!empty($pseudoconstant['optionGroupName'])) {
if ($context == 'validate') {