From 4e052b22ae0756c25444f8e63736fc3bb4d3d937 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 21 Jun 2016 14:58:49 +1200 Subject: [PATCH] CRM-18547 keep group context when marking dupes --- CRM/Contact/Form/Merge.php | 8 ++++++-- templates/CRM/Contact/Form/Merge.tpl | 2 +- templates/CRM/common/dedupe.tpl | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index 5d3a6b2ff5..1bf9a44d2f 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -73,7 +73,9 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { CRM_Core_Error::statusBounce(ts('The selected pair of contacts are marked as non duplicates. If these records should be merged, you can remove this exception on the Dedupe Exceptions page.', array(1 => CRM_Utils_System::url('civicrm/dedupe/exception', 'reset=1')))); } $this->_contactType = civicrm_api3('Contact', 'getvalue', array('id' => $cid, 'return' => 'contact_type')); + $isFromDedupeScreen = TRUE; if (!$this->_rgid) { + $isFromDedupeScreen = FALSE; $this->_rgid = civicrm_api3('RuleGroup', 'getvalue', array( 'contact_type' => $this->_contactType, 'used' => 'Supervised', @@ -169,13 +171,15 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { $session = CRM_Core_Session::singleton(); // context fixed. - if ($this->_rgid) { + if ($isFromDedupeScreen) { $urlParam = "reset=1&action=browse&rgid={$this->_rgid}"; if ($gid) { $urlParam .= "&gid={$gid}"; } - $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/dedupefind', $urlParam)); + $browseUrl = CRM_Utils_System::url('civicrm/contact/dedupefind', $urlParam); + $session->pushUserContext($browseUrl); } + $this->assign('browseUrl', empty($browseUrl) ? '' : $browseUrl); // ensure that oid is not the current user, if so refuse to do the merge if ($session->get('userID') == $oid) { diff --git a/templates/CRM/Contact/Form/Merge.tpl b/templates/CRM/Contact/Form/Merge.tpl index a718aa1037..618d69196b 100644 --- a/templates/CRM/Contact/Form/Merge.tpl +++ b/templates/CRM/Contact/Form/Merge.tpl @@ -56,7 +56,7 @@