'profileEntities' => array(),
);
- $configs['allowCoreTypes'][] = 'Contact';
- $configs['allowCoreTypes'][] = 'Individual';
+ $configs['allowCoreTypes'] = array_merge(array('Contact', 'Individual'), CRM_Contact_BAO_ContactType::subTypes('Individual'));
$configs['allowCoreTypes'][] = 'Participant';
//CRM-15427
$id = CRM_Utils_Request::retrieve( 'id' , 'Integer' );
'is_active' => 1,
'rowCount' => 1000, // FIXME
)),
+ 'contactSubTypes' => CRM_Contact_BAO_ContactType::subTypes(),
'profilePreviewKey' => CRM_Core_Key::get('CRM_UF_Form_Inline_Preview', TRUE),
);
})
case 'Individual':
case 'Organization':
case 'Household':
- if ($field['field_type'] != $extends && $field['field_type'] != 'Contact') {
+ if ($field['field_type'] != $extends && $field['field_type'] != 'Contact'
+ //CRM-15595 check if subtype
+ && !in_array($field['field_type'], CRM_Contact_BAO_ContactType::subTypes($extends))) {
continue 2;
}
break;
else {
civiComponent = 'Contribution';
}
- CRM.alert(ts('The selected profile is using a custom field which is not assigned to the '+civiComponent+' being configured.'),ts('Warning'));
+ CRM.alert(
+ ts('The selected profile is using a custom field which is not assigned to the "%1" being configured.', {
+ 1: civiComponent
+ }),
+ ts('Warning')
+ );
}
var view = new CRM.ProfileSelector.View({
ufGroupId: $select.val(),
case 'Case':
return 'case_1';
default:
- throw "Cannot guess entity name for field_type=" + field_type;
+ if (!$.isEmptyObject(CRM.contactSubTypes) &&
+ ($.inArray(field_type,CRM.contactSubTypes) > -1)) {
+ return 'contact_1';
+ }
+ else {
+ throw "Cannot guess entity name for field_type=" + field_type;
+ }
}
}