From a7ba493ce752fee7b05daa103bc1c956b7d05b0f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 24 Jul 2018 00:15:32 -0400 Subject: [PATCH] Handle 'Check for Matching Contact(s)' button with ajax --- CRM/Contact/Form/Contact.php | 4 +- templates/CRM/Contact/Form/Contact.tpl | 142 ++++++++++++++++++------- 2 files changed, 105 insertions(+), 41 deletions(-) diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php index 1b985e131f..1deb5ea20a 100644 --- a/CRM/Contact/Form/Contact.php +++ b/CRM/Contact/Form/Contact.php @@ -714,7 +714,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { } // Check for duplicate contact if it wasn't already handled by ajax or disabled - if (!Civi::settings()->get('contact_ajax_check_similar')) { + if (!Civi::settings()->get('contact_ajax_check_similar') || !empty($fields['_qf_Contact_refresh_dedupe'])) { self::checkDuplicateContacts($fields, $errors, $contactId, $contactType); } @@ -760,7 +760,7 @@ class CRM_Contact_Form_Contact extends CRM_Core_Form { $className::buildQuickForm($this); // Ajax duplicate checking - $checkSimilar = $this->_action == CRM_Core_Action::ADD && Civi::settings()->get('contact_ajax_check_similar'); + $checkSimilar = Civi::settings()->get('contact_ajax_check_similar'); $this->assign('checkSimilar', $checkSimilar); if ($checkSimilar == 1) { $ruleParams = array('used' => 'Supervised', 'contact_type' => $this->_contactType); diff --git a/templates/CRM/Contact/Form/Contact.tpl b/templates/CRM/Contact/Form/Contact.tpl index 7c0302360c..ddfb80ec7f 100644 --- a/templates/CRM/Contact/Form/Contact.tpl +++ b/templates/CRM/Contact/Form/Contact.tpl @@ -112,7 +112,7 @@ + {/literal} -- 2.25.1