Ejegg has submitted this change and it was merged.

Change subject: Add a setting to disable the dedupe on edit
......................................................................


Add a setting to disable the dedupe on edit

Bug: T117172
Change-Id: Icd97abd744ae44efaf8ed43ce1e14b609be5d2cb
---
M CRM/Admin/Form/Preferences/Display.php
M CRM/Contact/Form/Contact.php
M templates/CRM/Admin/Form/Preferences/Display.tpl
3 files changed, 17 insertions(+), 0 deletions(-)

Approvals:
  Ejegg: Verified; Looks good to me, approved



diff --git a/CRM/Admin/Form/Preferences/Display.php 
b/CRM/Admin/Form/Preferences/Display.php
index 5fde514..bada956 100644
--- a/CRM/Admin/Form/Preferences/Display.php
+++ b/CRM/Admin/Form/Preferences/Display.php
@@ -101,6 +101,11 @@
           'title' => ts('Enable Popup Forms'),
           'weight' => 12,
         ),
+        'isDedupeOnSave' => array(
+          'html_type' => 'checkbox',
+          'title' => ts('Dedupe contacts during save'),
+          'weight' => 13,
+        ),
       ),
     );
 
diff --git a/CRM/Contact/Form/Contact.php b/CRM/Contact/Form/Contact.php
index 3902f0f..085ffa8 100644
--- a/CRM/Contact/Form/Contact.php
+++ b/CRM/Contact/Form/Contact.php
@@ -1129,6 +1129,14 @@
    *   Contact type.
    */
   public static function checkDuplicateContacts(&$fields, &$errors, 
$contactID, $contactType) {
+    // If this site is not configured to check for duplicates during save, 
return without doing anything.
+    $isDedupeOnSave = (bool) CRM_Core_BAO_Setting::getItem(
+      CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'isDedupeOnSave', NULL, 
TRUE
+    );
+    if (!$isDedupeOnSave) {
+      return;
+    }
+
     // if this is a forced save, ignore find duplicate rule
     if (empty($fields['_qf_Contact_upload_duplicate'])) {
 
diff --git a/templates/CRM/Admin/Form/Preferences/Display.tpl 
b/templates/CRM/Admin/Form/Preferences/Display.tpl
index 28131fb..16db5de 100644
--- a/templates/CRM/Admin/Form/Preferences/Display.tpl
+++ b/templates/CRM/Admin/Form/Preferences/Display.tpl
@@ -103,6 +103,10 @@
         {ts}Select the sections that should be included when adding or editing 
a contact record. EXAMPLE: If your organization does not record Gender and 
Birth Date for individuals, then simplify the form by un-checking this option. 
Drag interface allows you to change the order of the panes displayed on contact 
add/edit screen.{/ts}
       </td>
     </tr>
+    <tr>
+      <td class="label"></td>
+      <td>{$form.isDedupeOnSave.html} {$form.isDedupeOnSave.label}</td>
+    </tr>
     <tr class="crm-preferences-display-form-block-advanced_search_options">
       <td class="label">{$form.advanced_search_options.label}</td>
       <td>{$form.advanced_search_options.html}</td>

-- 
To view, visit https://gerrit.wikimedia.org/r/249972
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icd97abd744ae44efaf8ed43ce1e14b609be5d2cb
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm/civicrm
Gerrit-Branch: civi-4.6.9-deployment
Gerrit-Owner: Awight <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Eileen <[email protected]>
Gerrit-Reviewer: Ejegg <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: Pcoombe <[email protected]>
Gerrit-Reviewer: XenoRyet <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to