<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2018
*/
/**
* @return bool
* email/openId
*/
- public static function formRule($fields, &$errors, $contactId = NULL) {
+ public static function formRule($fields, &$errors, $contactId, $contactType) {
$config = CRM_Core_Config::singleton();
// validations.
}
}
+ // Check for duplicate contact if it wasn't already handled by ajax or disabled
+ if (!Civi::settings()->get('contact_ajax_check_similar')) {
+ self::checkDuplicateContacts($fields, $errors, $contactId, $contactType);
+ }
+
return $primaryID;
}
$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)) {
'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(