From 1fe557c22468db643ba14ead3a0e35ba86e8385e Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 12 Jul 2016 16:33:34 +1200 Subject: [PATCH] CRM-19035 clean up references to srcID & dstID --- CRM/Dedupe/Finder.php | 17 ++++++++--------- CRM/Dedupe/Merger.php | 2 +- templates/CRM/Contact/Page/DedupeFind.tpl | 18 +++++++++--------- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php index 77e36cd1e9..e41e73955a 100644 --- a/CRM/Dedupe/Finder.php +++ b/CRM/Dedupe/Finder.php @@ -372,9 +372,8 @@ class CRM_Dedupe_Finder { $cids[$dupe[1]] = 1; } $cidString = implode(', ', array_keys($cids)); - $sql = "SELECT id, display_name FROM civicrm_contact WHERE id IN ($cidString) ORDER BY sort_name"; - $dao = new CRM_Core_DAO(); - $dao->query($sql); + + $dao = CRM_Core_DAO::executeQuery("SELECT id, display_name FROM civicrm_contact WHERE id IN ($cidString) ORDER BY sort_name"); $displayNames = array(); while ($dao->fetch()) { $displayNames[$dao->id] = $dao->display_name; @@ -382,11 +381,11 @@ class CRM_Dedupe_Finder { $userId = CRM_Core_Session::singleton()->getLoggedInContactID(); foreach ($foundDupes as $dupes) { - $srcID = $dupes[0]; - $dstID = $dupes[1]; - if ($dstID == $userId) { - $srcID = $dupes[1]; - $dstID = $dupes[0]; + $srcID = $dupes[1]; + $dstID = $dupes[0]; + if ($srcID == $userId) { + $srcID = $dstID; + $dstID = $userId; } $mainContacts[] = $row = array( @@ -399,7 +398,7 @@ class CRM_Dedupe_Finder { ); $data = CRM_Core_DAO::escapeString(serialize($row)); - $values[] = " ( 'civicrm_contact', $srcID, $dstID, '$cacheKeyString', '$data' ) "; + $values[] = " ( 'civicrm_contact', $dstID, $srcID, '$cacheKeyString', '$data' ) "; } CRM_Core_BAO_PrevNextCache::setItem($values); return $mainContacts; diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 44a7553372..fb6a4eee8b 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -706,7 +706,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $msg = "{$stats['merged']} " . ts('Contact(s) were merged.'); } if (!empty($stats['skipped'])) { - $msg .= $stats['skipped'] . ts('Contact(s) were skipped.'); + $msg .= $stats['skipped'] . ts(' Contact(s) were skipped.'); } return $msg; } diff --git a/templates/CRM/Contact/Page/DedupeFind.tpl b/templates/CRM/Contact/Page/DedupeFind.tpl index 5742b30b02..034efb3b99 100644 --- a/templates/CRM/Contact/Page/DedupeFind.tpl +++ b/templates/CRM/Contact/Page/DedupeFind.tpl @@ -98,16 +98,16 @@ -   - {ts}Contact{/ts} 1   - {ts}Contact{/ts} 2 ({ts}Duplicate{/ts}) - {ts}Email{/ts} 1 - {ts}Email{/ts} 2 ({ts}Duplicate{/ts}) - {ts}Street Address{/ts} 1 - {ts}Street Address{/ts} 2 ({ts}Duplicate{/ts}) - {ts}Postcode{/ts} 1 - {ts}Postcode{/ts} 2 ({ts}Duplicate{/ts}) + {ts}Contact{/ts} 1 +   + {ts}Contact{/ts} 2 ({ts}Duplicate{/ts}) + {ts}Email{/ts} 1 + {ts}Email{/ts} 2 ({ts}Duplicate{/ts}) + {ts}Street Address{/ts} 1 + {ts}Street Address{/ts} 2 ({ts}Duplicate{/ts}) + {ts}Postcode{/ts} 1 + {ts}Postcode{/ts} 2 ({ts}Duplicate{/ts}) {ts}Conflicts{/ts} {ts}Threshold{/ts}   -- 2.25.1