'household_name',
];
- $contactTypes = ['Contact', 'Individual', 'Household', 'Organization'];
+ $contactTypes = array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes(TRUE));
$contactReturnProperties = [];
for ($rowNumber = 1; $rowNumber <= $this->_batchInfo['item_count']; $rowNumber++) {
];
//check if there are any custom data searchable fields
- $extends = array_merge(['Contact', 'Individual', 'Household', 'Organization'],
+ $extends = array_merge(['Contact'],
+ CRM_Contact_BAO_ContactType::basicTypes(),
CRM_Contact_BAO_ContactType::subTypes()
);
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE,
*/
public static function custom(&$form) {
$form->add('hidden', 'hidden_custom', 1);
- $extends = array_merge(['Contact', 'Individual', 'Household', 'Organization'],
+ $extends = array_merge(['Contact'],
+ CRM_Contact_BAO_ContactType::basicTypes(),
CRM_Contact_BAO_ContactType::subTypes()
);
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE,
$checkPermission = CRM_Core_Permission::EDIT;
}
if (empty($customDataType)) {
- $customDataType = ['Contact', 'Individual', 'Organization', 'Household'];
+ $customDataType = array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes());
}
if ($customDataType === 'ANY') {
// NULL should have been respected but the line above broke that.
}
// Do we have access to the target record?
- if (in_array($extends, ['Contact', 'Individual', 'Organization', 'Household'])) {
+ if ($extends === 'Contact' || in_array($extends, CRM_Contact_BAO_ContactType::basicTypes(TRUE), TRUE)) {
return \Civi\Api4\Utils\CoreUtil::checkAccessDelegated('Contact', 'update', ['id' => $eid], $userID);
}
elseif (\Civi\Api4\Utils\CoreUtil::getApiClass($extends)) {
* Empty array if no custom values found.
* @throws CRM_Core_Exception
*/
- public static function &getEntityValues($entityID, $entityType = NULL, $fieldIDs = NULL, $formatMultiRecordField = FALSE, $DTparams = NULL) {
+ public static function getEntityValues($entityID, $entityType = NULL, $fieldIDs = NULL, $formatMultiRecordField = FALSE, $DTparams = NULL) {
if (!$entityID) {
// adding this here since an empty contact id could have serious repurcussions
// like looping forever
$cond[] = "cf.id IN ( $fieldIDList )";
}
if (empty($cond)) {
- $cond[] = "cg.extends IN ( 'Contact', 'Individual', 'Household', 'Organization' )";
+ $contactTypes = array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes(TRUE));
+ $cond[] = "cg.extends IN ( '" . implode("', '", $contactTypes) . "' )";
}
$cond = implode(' AND ', $cond);
* @throws Exception
* @return array
*/
- public static function &getValues(&$params) {
+ public static function getValues($params) {
if (empty($params)) {
return NULL;
}
[1 => $idx]
));
}
- $fieldIDs[] = (int ) $idx;
+ $fieldIDs[] = (int) $idx;
}
}
- $default = ['Contact', 'Individual', 'Household', 'Organization'];
+ $default = array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes(TRUE));
if (!($type = CRM_Utils_Array::value('entityType', $params)) ||
in_array($params['entityType'], $default)
) {
// suppress any subtypes if present
CRM_Contact_BAO_ContactType::suppressSubTypes($profileTypes);
- $contactTypes = ['Contact', 'Individual', 'Household', 'Organization'];
+ $contactTypes = array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes(TRUE));
$components = ['Contribution', 'Participant', 'Membership', 'Activity'];
- $fields = [];
// check for mix profile condition
if (count($profileTypes) > 1) {
*/
public static function calculateProfileType($ufGroupType, $returnMixType = TRUE, $onlyPure = FALSE, $skipComponentType = FALSE) {
// profile types
- $contactTypes = ['Contact', 'Individual', 'Household', 'Organization'];
+ $contactTypes = array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes(TRUE));
$subTypes = CRM_Contact_BAO_ContactType::subTypes();
$components = ['Contribution', 'Participant', 'Membership', 'Activity'];
];
$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,
$this->add('text', 'title', ts('Set Name'), $attributes['title'], TRUE);
//Fix for code alignment, CRM-3058
- $contactTypes = ['Contact', 'Individual', 'Household', 'Organization'];
+ $contactTypes = array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes());
$this->assign('contactTypes', json_encode($contactTypes));
$sel1 = ["" => ts("- select -")] + CRM_Core_SelectValues::customGroupExtends();
* @param $entity
*/
function _civicrm_api3_format_params_for_create(&$params, $entity) {
- $nonGenericEntities = ['Contact', 'Individual', 'Household', 'Organization'];
+ $nonGenericEntities = array_merge(['Contact'], CRM_Contact_BAO_ContactType::basicTypes(TRUE));
$customFieldEntities = array_diff_key(CRM_Core_SelectValues::customGroupExtends(), array_fill_keys($nonGenericEntities, 1));
if (!array_key_exists($entity, $customFieldEntities)) {