From 186e5c4424674e4e0b743edbd2ad6a7c9f64286c Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 10 Nov 2016 16:21:34 +1300 Subject: [PATCH] (towards CRM-19492) Minor variable simplification --- CRM/Contact/Form/Merge.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CRM/Contact/Form/Merge.php b/CRM/Contact/Form/Merge.php index ad9a8e6563..9711448dbe 100644 --- a/CRM/Contact/Form/Merge.php +++ b/CRM/Contact/Form/Merge.php @@ -87,15 +87,22 @@ 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; + + $browseUrl = CRM_Utils_System::url('civicrm/contact/dedupefind', $urlParams . '&action=browse'); + if (!$this->_rgid) { - $isFromDedupeScreen = FALSE; + // Unset browse URL as we have come from the search screen. + $browseUrl = ''; $this->_rgid = civicrm_api3('RuleGroup', 'getvalue', array( 'contact_type' => $this->_contactType, 'used' => 'Supervised', 'return' => 'id', )); } + $this->assign('browseUrl', $browseUrl); + if ($browseUrl) { + $session->pushUserContext($browseUrl); + } $cacheKey = CRM_Dedupe_Merger::getMergeCacheKeyString($this->_rgid, $gid); @@ -176,13 +183,6 @@ class CRM_Contact_Form_Merge extends CRM_Core_Form { $session = CRM_Core_Session::singleton(); - // context fixed. - if ($isFromDedupeScreen) { - $browseUrl = CRM_Utils_System::url('civicrm/contact/dedupefind', $urlParams . '&action=browse'); - $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) { $display_name = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $oid, 'display_name'); -- 2.25.1