$membershipIDs = CRM_Utils_Array::collect('id',
CRM_Utils_Array::value('values',
civicrm_api3("Membership", "get", [
- "contact_id" => $otherID,
- "return" => "id",
- ]
- )
- ));
+ "contact_id" => $otherID,
+ "return" => "id",
+ ])
+ )
+ );
if (!empty($membershipIDs)) {
civicrm_api3("Membership", "get", [
$msg = '';
if (!empty($stats['merged'])) {
$msg = '<p>' . ts('One contact merged.', [
- 'count' => $stats['merged'],
- 'plural' => '%count contacts merged.',
- ]) . '</p>';
+ 'count' => $stats['merged'],
+ 'plural' => '%count contacts merged.',
+ ]) . '</p>';
}
if (!empty($stats['skipped'])) {
$msg .= '<p>' . ts('One contact was skipped.', [
- 'count' => $stats['skipped'],
- 'plural' => '%count contacts were skipped.',
- ]) . '</p>';
+ 'count' => $stats['skipped'],
+ 'plural' => '%count contacts were skipped.',
+ ]) . '</p>';
}
return $msg;
}
*
* @return bool
*/
- static public function locationIsSame($mainAddress, $comparisonAddress) {
+ public static function locationIsSame($mainAddress, $comparisonAddress) {
$keysToIgnore = [
'id',
'is_primary',
// Set this value as the default against the 'other' contact value
$rows["move_location_{$blockName}_{$count}"]['main'] = $mainValueCheck[$blockInfo['displayField']];
$rows["move_location_{$blockName}_{$count}"]['main_is_primary'] = $mainValueCheck['is_primary'];
+ $rows["move_location_{$blockName}_{$count}"]['location_entity'] = $blockName;
$mainContactBlockId = $mainValueCheck['id'];
break;
}
CRM_Core_BAO_File::deleteFileReferences($fileIds[$mainId], $mainId, $customId);
}
}
- $dao->free();
// move the other contact's file to main contact
//NYSS need to INSERT or UPDATE depending on whether main contact has an existing record
];
$activity = civicrm_api3('activity', 'create', [
'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
- $mainId,
+ $mainId,
'subject' => ts('Contact ID %1 has been merged and deleted.', $params),
'target_contact_id' => $mainId,
'activity_type_id' => 'Contact Merged',
])) {
civicrm_api3('activity', 'create', [
'source_contact_id' => CRM_Core_Session::getLoggedInContactID() ? CRM_Core_Session::getLoggedInContactID() :
- $otherId,
+ $otherId,
'subject' => ts('Contact ID %1 has been merged into Contact ID %2 and deleted.', $params),
'target_contact_id' => $otherId,
'activity_type_id' => 'Contact Deleted by Merge',
* Limit to searching for matches against this many contacts.
*
* @return array
- * Array of matches meeting the criteria.
+ * Array of matches meeting the criteria.
*/
public static function getDuplicatePairs($rule_group_id, $group_id, $reloadCacheIfEmpty, $batchLimit, $isSelected, $orderByClause = '', $includeConflicts = TRUE, $criteria = [], $checkPermissions = TRUE, $searchLimit = 0) {
$where = self::getWhereString($isSelected);