当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Dedupe_BAO_RuleGroup::find方法代码示例

本文整理汇总了PHP中CRM_Dedupe_BAO_RuleGroup::find方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Dedupe_BAO_RuleGroup::find方法的具体用法?PHP CRM_Dedupe_BAO_RuleGroup::find怎么用?PHP CRM_Dedupe_BAO_RuleGroup::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Dedupe_BAO_RuleGroup的用法示例。


在下文中一共展示了CRM_Dedupe_BAO_RuleGroup::find方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dedupeRuleFields

 /**
  * To find fields related to a rule group.
  *
  * @param array contains the rule group property to identify rule group
  *
  * @return rule fields array associated to rule group
  * @access public
  */
 static function dedupeRuleFields($params)
 {
     $rgBao = new CRM_Dedupe_BAO_RuleGroup();
     $rgBao->level = $params['level'];
     $rgBao->contact_type = $params['contact_type'];
     $rgBao->is_default = 1;
     $rgBao->find(TRUE);
     $ruleBao = new CRM_Dedupe_BAO_Rule();
     $ruleBao->dedupe_rule_group_id = $rgBao->id;
     $ruleBao->find();
     $ruleFields = array();
     while ($ruleBao->fetch()) {
         $ruleFields[] = $ruleBao->rule_field;
     }
     return $ruleFields;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:24,代码来源:Rule.php

示例2: formatContactIDSToLinks

    /**
     * Given an array of contact ids this function will return array with links to view contact page.
     *
     * @param array $contactIDs
     *   Associated contact id's.
     * @param bool $addViewLink
     * @param bool $addEditLink
     * @param int $originalId
     *   Associated with the contact which is edited.
     *
     *
     * @return array
     *   returns array with links to contact view
     */
    public static function formatContactIDSToLinks($contactIDs, $addViewLink = TRUE, $addEditLink = TRUE, $originalId = NULL)
    {
        $contactLinks = array();
        if (!is_array($contactIDs) || empty($contactIDs)) {
            return $contactLinks;
        }
        // does contact has sufficient permissions.
        $permissions = array('view' => 'view all contacts', 'edit' => 'edit all contacts', 'merge' => 'merge duplicate contacts');
        $permissionedContactIds = array();
        foreach ($permissions as $task => $permission) {
            // give permission.
            if (CRM_Core_Permission::check($permission)) {
                foreach ($contactIDs as $contactId) {
                    $permissionedContactIds[$contactId][$task] = TRUE;
                }
                continue;
            }
            // check permission on acl basis.
            if (in_array($task, array('view', 'edit'))) {
                $aclPermission = CRM_Core_Permission::VIEW;
                if ($task == 'edit') {
                    $aclPermission = CRM_Core_Permission::EDIT;
                }
                foreach ($contactIDs as $contactId) {
                    if (CRM_Contact_BAO_Contact_Permission::allow($contactId, $aclPermission)) {
                        $permissionedContactIds[$contactId][$task] = TRUE;
                    }
                }
            }
        }
        // retrieve display names for all contacts
        $query = '
   SELECT  c.id, c.display_name, c.contact_type, ce.email
     FROM  civicrm_contact c
LEFT JOIN  civicrm_email ce ON ( ce.contact_id=c.id AND ce.is_primary = 1 )
    WHERE  c.id IN  (' . implode(',', $contactIDs) . ' ) LIMIT 20';
        $dao = CRM_Core_DAO::executeQuery($query);
        $contactLinks['msg'] = NULL;
        $i = 0;
        while ($dao->fetch()) {
            $contactLinks['rows'][$i]['display_name'] = $dao->display_name;
            $contactLinks['rows'][$i]['primary_email'] = $dao->email;
            // get the permission for current contact id.
            $hasPermissions = CRM_Utils_Array::value($dao->id, $permissionedContactIds);
            if (!is_array($hasPermissions) || empty($hasPermissions)) {
                $i++;
                continue;
            }
            // do check for view.
            if (array_key_exists('view', $hasPermissions)) {
                $contactLinks['rows'][$i]['view'] = '<a class="action-item" href="' . CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $dao->id) . '" target="_blank">' . ts('View') . '</a>';
                if (!$contactLinks['msg']) {
                    $contactLinks['msg'] = 'view';
                }
            }
            if (array_key_exists('edit', $hasPermissions)) {
                $contactLinks['rows'][$i]['edit'] = '<a class="action-item" href="' . CRM_Utils_System::url('civicrm/contact/add', 'reset=1&action=update&cid=' . $dao->id) . '" target="_blank">' . ts('Edit') . '</a>';
                if (!$contactLinks['msg'] || $contactLinks['msg'] != 'merge') {
                    $contactLinks['msg'] = 'edit';
                }
            }
            if (!empty($originalId) && array_key_exists('merge', $hasPermissions)) {
                $rgBao = new CRM_Dedupe_BAO_RuleGroup();
                $rgBao->contact_type = $dao->contact_type;
                $rgBao->used = 'Supervised';
                if ($rgBao->find(TRUE)) {
                    $rgid = $rgBao->id;
                }
                if ($rgid && isset($dao->id)) {
                    //get an url to merge the contact
                    $contactLinks['rows'][$i]['merge'] = '<a class="action-item" href="' . CRM_Utils_System::url('civicrm/contact/merge', "reset=1&cid=" . $originalId . '&oid=' . $dao->id . '&action=update&rgid=' . $rgid) . '">' . ts('Merge') . '</a>';
                    $contactLinks['msg'] = 'merge';
                }
            }
            $i++;
        }
        return $contactLinks;
    }
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:92,代码来源:Utils.php

示例3: dupesOfContact

 /**
  * Return dupes of a given contact, using the default rule group (of a provided level).
  *
  * @param int    $cid    contact id of the given contact
  * @param string $level  dedupe rule group level ('Fuzzy' or 'Strict')
  * @param string $ctype  contact type of the given contact
  *
  * @return array  array of dupe contact_ids
  */
 static function dupesOfContact($cid, $level = 'Strict', $ctype = NULL)
 {
     // if not provided, fetch the contact type from the database
     if (!$ctype) {
         $dao = new CRM_Contact_DAO_Contact();
         $dao->id = $cid;
         if (!$dao->find(TRUE)) {
             CRM_Core_Error::fatal("contact id of {$cid} does not exist");
         }
         $ctype = $dao->contact_type;
     }
     $rgBao = new CRM_Dedupe_BAO_RuleGroup();
     $rgBao->level = $level;
     $rgBao->contact_type = $ctype;
     $rgBao->is_default = 1;
     if (!$rgBao->find(TRUE)) {
         CRM_Core_Error::fatal("{$level} rule for {$ctype} does not exist");
     }
     $dupes = self::dupes($rgBao->id, array($cid));
     // get the dupes for this cid
     $result = array();
     foreach ($dupes as $dupe) {
         if ($dupe[0] == $cid) {
             $result[] = $dupe[1];
         } elseif ($dupe[1] == $cid) {
             $result[] = $dupe[0];
         }
     }
     return $result;
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:39,代码来源:Finder.php

示例4: dedupeRuleFieldsWeight

 /**
  * find fields related to a rule group.
  *
  * @param array $params
  *
  * @return array
  *   (rule field => weight) array and threshold associated to rule group
  */
 public static function dedupeRuleFieldsWeight($params)
 {
     $rgBao = new CRM_Dedupe_BAO_RuleGroup();
     $rgBao->contact_type = $params['contact_type'];
     if (!empty($params['id'])) {
         // accept an ID if provided
         $rgBao->id = $params['id'];
     } else {
         $rgBao->used = $params['used'];
     }
     $rgBao->find(TRUE);
     $ruleBao = new CRM_Dedupe_BAO_Rule();
     $ruleBao->dedupe_rule_group_id = $rgBao->id;
     $ruleBao->find();
     $ruleFields = array();
     while ($ruleBao->fetch()) {
         $ruleFields[$ruleBao->rule_field] = $ruleBao->rule_weight;
     }
     return array($ruleFields, $rgBao->threshold);
 }
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:28,代码来源:RuleGroup.php

示例5: run

 /**
  * Browse all rule groups.
  */
 public function run()
 {
     $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
     $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $session = CRM_Core_Session::singleton();
     $contactIds = $session->get('selectedSearchContactIds');
     if ($context == 'search' || !empty($contactIds)) {
         $context = 'search';
         $this->assign('backURL', $session->readUserContext());
     }
     if ($action & CRM_Core_Action::RENEW) {
         // empty cache
         $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0);
         if ($rgid) {
             $contactType = CRM_Core_DAO::getFieldValue('CRM_Dedupe_DAO_RuleGroup', $rgid, 'contact_type');
             $cacheKeyString = "merge {$contactType}";
             $cacheKeyString .= $rgid ? "_{$rgid}" : '_0';
             $cacheKeyString .= $gid ? "_{$gid}" : '_0';
             CRM_Core_BAO_PrevNextCache::deleteItem(NULL, $cacheKeyString);
         }
         $urlQry = "reset=1&action=update&rgid={$rgid}";
         if ($gid) {
             $urlQry .= "&gid={$gid}";
         }
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlQry));
     } 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, 75);
         $skippedCount = CRM_Utils_Request::retrieve('skipped', 'Positive', $this, FALSE, 0);
         $skippedCount = $skippedCount + count($result['skipped']);
         $mergedCount = CRM_Utils_Request::retrieve('merged', 'Positive', $this, FALSE, 0);
         $mergedCount = $mergedCount + count($result['merged']);
         if (empty($result['merged']) && empty($result['skipped'])) {
             $message = '';
             if ($mergedCount >= 1) {
                 $message = ts("%1 pairs of duplicates were merged", array(1 => $mergedCount));
             }
             if ($skippedCount >= 1) {
                 $message = $message ? "{$message} and " : '';
                 $message .= ts("%1 pairs of duplicates were skipped due to conflict", array(1 => $skippedCount));
             }
             $message .= ts(" during the batch merge process with safe mode.");
             CRM_Core_Session::setStatus($message, ts('Merge Complete'), 'success');
             $urlQry = "reset=1&action=update&rgid={$rgid}";
             if ($gid) {
                 $urlQry .= "&gid={$gid}";
             }
             CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlQry));
         } else {
             $urlQry = "reset=1&action=map&rgid={$rgid}";
             if ($gid) {
                 $urlQry .= "&gid={$gid}";
             }
             $urlQry .= "&skipped={$skippedCount}&merged={$mergedCount}";
             CRM_Utils_System::jsRedirect(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlQry), ts('Batch Merge Task in progress'), ts('The batch merge task is still in progress. This page will be refreshed automatically.'));
         }
     }
     if ($action & CRM_Core_Action::UPDATE || $action & CRM_Core_Action::BROWSE) {
         $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, 0);
         $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, FALSE, 0);
         $this->action = CRM_Core_Action::UPDATE;
         //calculate the $contactType
         if ($rgid) {
             $contactType = CRM_Core_DAO::getFieldValue('CRM_Dedupe_DAO_RuleGroup', $rgid, 'contact_type');
         }
         $sourceParams = 'snippet=4';
         if ($gid) {
             $sourceParams .= "&gid={$gid}";
         }
         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));
         //reload from cache table
         $cacheKeyString = "merge {$contactType}";
         $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\n                                                                 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
//.........这里部分代码省略.........
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:101,代码来源:DedupeFind.php

示例6: run

 /**
  * Browse all rule groups
  *  
  * @return void
  * @access public
  */
 function run()
 {
     $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, false, 0);
     $action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 0);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $session = CRM_Core_Session::singleton();
     $contactIds = $session->get('selectedSearchContactIds');
     if ($context == 'search' || !empty($contactIds)) {
         $context = 'search';
         $this->assign('backURL', $session->readUserContext());
     }
     if ($action & CRM_Core_Action::UPDATE || $action & CRM_Core_Action::BROWSE) {
         $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, false, 0);
         $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive', $this, false, 0);
         $this->action = CRM_Core_Action::UPDATE;
         if ($gid) {
             $foundDupes = $this->get("dedupe_dupes_{$gid}");
             if (!$foundDupes) {
                 $foundDupes = CRM_Dedupe_Finder::dupesInGroup($rgid, $gid);
             }
             $this->set("dedupe_dupes_{$gid}", $foundDupes);
         } else {
             if (!empty($contactIds)) {
                 $foundDupes = $this->get("search_dedupe_dupes_{$gid}");
                 if (!$foundDupes) {
                     $foundDupes = CRM_Dedupe_Finder::dupes($rgid, $contactIds);
                 }
                 $this->get("search_dedupe_dupes_{$gid}", $foundDupes);
             } else {
                 $foundDupes = $this->get("dedupe_dupes");
                 if (!$foundDupes) {
                     $foundDupes = CRM_Dedupe_Finder::dupes($rgid);
                 }
                 $this->set("dedupe_dupes", $foundDupes);
             }
         }
         if (!$foundDupes) {
             $ruleGroup = new CRM_Dedupe_BAO_RuleGroup();
             $ruleGroup->id = $rgid;
             $ruleGroup->find(true);
             $session = CRM_Core_Session::singleton();
             $session->setStatus("No possible duplicates were found using {$ruleGroup->name} rule.");
             $url = CRM_Utils_System::url('civicrm/contact/deduperules', "reset=1");
             if ($context == 'search') {
                 $url = $session->readUserContext();
             }
             CRM_Utils_System::redirect($url);
         } else {
             $cids = array();
             foreach ($foundDupes as $dupe) {
                 $cids[$dupe[0]] = 1;
                 $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);
             $displayNames = array();
             while ($dao->fetch()) {
                 $displayNames[$dao->id] = $dao->display_name;
             }
             // FIXME: sort the contacts; $displayName
             // is already sort_name-sorted, so use that
             // (also, consider sorting by dupe count first)
             // lobo - change the sort to by threshold value
             // so the more likely dupes are sorted first
             $session = CRM_Core_Session::singleton();
             $userId = $session->get('userID');
             $mainContacts = array();
             foreach ($foundDupes as $dupes) {
                 $srcID = $dupes[0];
                 $dstID = $dupes[1];
                 if ($dstID == $userId) {
                     $srcID = $dupes[1];
                     $dstID = $dupes[0];
                 }
                 $canMerge = CRM_Contact_BAO_Contact_Permission::allow($dstID, CRM_Core_Permission::EDIT) && CRM_Contact_BAO_Contact_Permission::allow($srcID, CRM_Core_Permission::EDIT);
                 $mainContacts[] = array('srcID' => $srcID, 'srcName' => $displayNames[$srcID], 'dstID' => $dstID, 'dstName' => $displayNames[$dstID], 'weight' => $dupes[2], 'canMerge' => $canMerge);
             }
             if ($cid) {
                 $this->_cid = $cid;
             }
             if ($gid) {
                 $this->_gid = $gid;
             }
             $this->_rgid = $rgid;
             $this->_mainContacts = $mainContacts;
             $session = CRM_Core_Session::singleton();
             if ($this->_cid) {
                 $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/deduperules', "action=update&rgid={$this->_rgid}&gid={$this->_gid}&cid={$this->_cid}"));
             } else {
                 $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/dedupefind', "reset=1&action=update&rgid={$this->_rgid}"));
             }
         }
//.........这里部分代码省略.........
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:101,代码来源:DedupeFind.php

示例7: dedupeRuleFieldsWeight

 /**
  * To find fields related to a rule group.
  *
  * @param array contains the rule group property to identify rule group
  *
  * @return (rule field => weight) array and threshold associated to rule group
  * @access public
  */
 function dedupeRuleFieldsWeight($params)
 {
     $rgBao = new CRM_Dedupe_BAO_RuleGroup();
     $rgBao->level = $params['level'];
     $rgBao->contact_type = $params['contact_type'];
     $rgBao->is_default = 1;
     $rgBao->find(TRUE);
     $ruleBao = new CRM_Dedupe_BAO_Rule();
     $ruleBao->dedupe_rule_group_id = $rgBao->id;
     $ruleBao->find();
     $ruleFields = array();
     while ($ruleBao->fetch()) {
         $ruleFields[$ruleBao->rule_field] = $ruleBao->rule_weight;
     }
     return array($ruleFields, $rgBao->threshold);
 }
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:24,代码来源:RuleGroup.php

示例8: dedupeRuleFields

 /**
  * To find fields related to a rule group.
  * @param array contains the rule group property to identify rule group
  *
  * @return rule fields array associated to rule group
  * @access public
  */
 function dedupeRuleFields($params)
 {
     require_once 'CRM/Dedupe/BAO/RuleGroup.php';
     $rgBao = new CRM_Dedupe_BAO_RuleGroup();
     $rgBao->level = $params['level'];
     $rgBao->contact_type = $params['contact_type'];
     $rgBao->is_default = 1;
     $rgBao->find(true);
     $ruleBao = new CRM_Dedupe_BAO_Rule();
     $ruleBao->dedupe_rule_group_id = $rgBao->id;
     $ruleBao->find();
     $ruleFields = array();
     while ($ruleBao->fetch()) {
         $ruleFields[] = $ruleBao->rule_field;
     }
     return $ruleFields;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:24,代码来源:Rule.php

示例9: run

 /**
  * Browse all rule groups.
  */
 public function run()
 {
     $gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
     $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 0);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $limit = CRM_Utils_Request::retrieve('limit', 'Integer', $this);
     $rgid = CRM_Utils_Request::retrieve('rgid', 'Positive');
     $urlQry = "reset=1&rgid={$rgid}&gid={$gid}&limit={$limit}";
     $this->assign('urlQuery', $urlQry);
     $session = CRM_Core_Session::singleton();
     $contactIds = $session->get('selectedSearchContactIds');
     if ($context == 'search' || !empty($contactIds)) {
         $context = 'search';
         $this->assign('backURL', $session->readUserContext());
     }
     if ($action & CRM_Core_Action::RENEW) {
         // empty cache
         if ($rgid) {
             CRM_Core_BAO_PrevNextCache::deleteItem(NULL, CRM_Dedupe_Merger::getMergeCacheKeyString($rgid, $gid));
         }
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlQry . "&action=update"));
     } elseif ($action & CRM_Core_Action::MAP) {
         // do a batch merge if requested
         $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']);
         $mergedCount = CRM_Utils_Request::retrieve('merged', 'Positive', $this, FALSE, 0);
         $mergedCount = $mergedCount + count($result['merged']);
         if (empty($result['merged']) && empty($result['skipped'])) {
             $message = '';
             if ($mergedCount >= 1) {
                 $message = ts("%1 pairs of duplicates were merged", array(1 => $mergedCount));
             }
             if ($skippedCount >= 1) {
                 $message = $message ? "{$message} and " : '';
                 $message .= ts("%1 pairs of duplicates were skipped due to conflict", array(1 => $skippedCount));
             }
             $message .= ts(" during the batch merge process with safe mode.");
             CRM_Core_Session::setStatus($message, ts('Merge Complete'), 'success');
             CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlQry . "&action=update"));
         } else {
             $urlQry .= "&action=map&skipped={$skippedCount}&merged={$mergedCount}";
             CRM_Utils_System::jsRedirect(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlQry), ts('Batch Merge Task in progress'), ts('The batch merge task is still in progress. This page will be refreshed automatically.'));
         }
     }
     if ($action & CRM_Core_Action::UPDATE || $action & CRM_Core_Action::BROWSE) {
         $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, 0);
         $this->action = CRM_Core_Action::UPDATE;
         $urlQry .= '&snippet=4';
         if ($context == 'conflicts') {
             $urlQry .= "&selected=1";
         }
         $this->assign('sourceUrl', CRM_Utils_System::url('civicrm/ajax/dedupefind', $urlQry, FALSE, NULL, FALSE));
         //reload from cache table
         $cacheKeyString = CRM_Dedupe_Merger::getMergeCacheKeyString($rgid, $gid);
         $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 = CRM_Dedupe_Merger::getJoinOnDedupeTable();
         $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
                 CRM_Utils_System::redirect(CRM_Utils_System::url(CRM_Utils_System::currentPath(), $urlQry . '&action=update'));
             }
             if ($gid) {
                 $foundDupes = $this->get("dedupe_dupes_{$gid}");
                 if (!$foundDupes) {
                     $foundDupes = CRM_Dedupe_Finder::dupesInGroup($rgid, $gid, $limit);
                 }
                 $this->set("dedupe_dupes_{$gid}", $foundDupes);
             } elseif (!empty($contactIds)) {
                 $foundDupes = $this->get("search_dedupe_dupes_{$gid}");
                 if (!$foundDupes) {
                     $foundDupes = CRM_Dedupe_Finder::dupes($rgid, $contactIds);
                 }
                 $this->set("search_dedupe_dupes_{$gid}", $foundDupes);
             } else {
                 $foundDupes = $this->get('dedupe_dupes');
                 if (!$foundDupes) {
                     $foundDupes = CRM_Dedupe_Finder::dupes($rgid, array(), TRUE, $limit);
                 }
                 $this->set('dedupe_dupes', $foundDupes);
             }
             if (!$foundDupes) {
                 $ruleGroup = new CRM_Dedupe_BAO_RuleGroup();
                 $ruleGroup->id = $rgid;
                 $ruleGroup->find(TRUE);
                 $session = CRM_Core_Session::singleton();
                 $session->setStatus(ts('No possible duplicates were found using %1 rule.', array(1 => $ruleGroup->name)), ts('None Found'), 'info');
//.........这里部分代码省略.........
开发者ID:nielosz,项目名称:civicrm-core,代码行数:101,代码来源:DedupeFind.php


注:本文中的CRM_Dedupe_BAO_RuleGroup::find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。