*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
*/
class CRM_Contact_Page_DedupeFind extends CRM_Core_Page_Basic {
protected $_cid = NULL;
/**
* Get action Links.
- *
- * @return void
- * (reference) of action links
*/
public function &links() {
}
/**
* Browse all rule groups.
- *
- * @return void
*/
public function run() {
$gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
elseif ($action & CRM_Core_Action::MAP) {
// do a batch merge if requested
$rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0);
- $result = CRM_Dedupe_Merger::batchMerge($rgid, $gid, 'safe', TRUE, TRUE);
+ $result = CRM_Dedupe_Merger::batchMerge($rgid, $gid, 'safe', TRUE, 75);
$skippedCount = CRM_Utils_Request::retrieve('skipped', 'Positive', $this, FALSE, 0);
$skippedCount = $skippedCount + count($result['skipped']);
if ($rgid) {
$sourceParams .= "&rgid={$rgid}";
}
+ if ($context == 'conflicts') {
+ $sourceParams .= "&selected=1";
+ }
$this->assign('sourceUrl', CRM_Utils_System::url('civicrm/ajax/dedupefind', $sourceParams, FALSE, NULL, FALSE));
$cacheKeyString .= $rgid ? "_{$rgid}" : '_0';
$cacheKeyString .= $gid ? "_{$gid}" : '_0';
+ $stats = CRM_Dedupe_Merger::getMergeStatsMsg($cacheKeyString);
+ if ($stats) {
+ CRM_Core_Session::setStatus($stats);
+ // reset so we not displaying same message again
+ CRM_Dedupe_Merger::resetMergeStats($cacheKeyString);
+ }
$join = "LEFT JOIN civicrm_dedupe_exception de ON ( pn.entity_id1 = de.contact_id1 AND
pn.entity_id2 = de.contact_id2 )";
$where = "de.id IS NULL";
+ if ($context == 'conflicts') {
+ $where .= " AND pn.is_selected = 1";
+ }
$this->_mainContacts = CRM_Core_BAO_PrevNextCache::retrieve($cacheKeyString, $join, $where);
if (empty($this->_mainContacts)) {
+ if ($context == 'conflicts') {
+ // if the current screen was intended to list only selected contacts, move back to full dupe list
+ $sourceParams = 'reset=1&action=update';
+ if ($gid) {
+ $sourceParams .= "&gid={$gid}";
+ }
+ if ($rgid) {
+ $sourceParams .= "&rgid={$rgid}";
+ }
+ CRM_Utils_System::redirect(CRM_Utils_System::url(CRM_Utils_System::currentPath(), $sourceParams));
+ }
if ($gid) {
$foundDupes = $this->get("dedupe_dupes_$gid");
if (!$foundDupes) {
/**
* Browse all rule groups.
- *
- * @return void
*/
public function browse() {
$this->assign('main_contacts', $this->_mainContacts);