X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FForm%2FContact.php;h=4c23815e3c66e6a6eda8426ef15b13a526f16a95;hb=907d4bb55b3f5f208e05d993d3d54aacc89770e0;hp=375d18a66522bbde61652b8869c2b0f5afa7e4b3;hpb=e4636fa7912cc7a53ceaf61d4d0edb868a998f54;p=civicrm-core.git diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 375d18a665..4c23815e3c 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -1,7 +1,7 @@ get('contact_ajax_check_similar')) { + self::checkDuplicateContacts($fields, $errors, $contactId, $contactType); + } + return $primaryID; } @@ -754,6 +759,14 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $className = 'CRM_Contact_Form_Edit_' . $this->_contactType; $className::buildQuickForm($this); + // Ajax duplicate checking + $checkSimilar = $this->_action == CRM_Core_Action::ADD && Civi::settings()->get('contact_ajax_check_similar'); + $this->assign('checkSimilar', $checkSimilar); + if ($checkSimilar == 1) { + $ruleParams = array('used' => 'Supervised', 'contact_type' => $this->_contactType); + $this->assign('ruleFields', CRM_Dedupe_BAO_Rule::dedupeRuleFields($ruleParams)); + } + // build Custom data if Custom data present in edit option $buildCustomData = 'noCustomDataPresent'; if (array_key_exists('CustomData', $this->_editOptions)) { @@ -1448,7 +1461,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { 'max_related' => $dao->max_related, ); - CRM_Member_BAO_MembershipLog::add($membershipLog, CRM_Core_DAO::$_nullArray); + CRM_Member_BAO_MembershipLog::add($membershipLog); //create activity when membership status is changed $activityParam = array(