From: Kurund Jalmi Date: Thu, 2 May 2013 00:47:21 +0000 (-0700) Subject: CRM-12357 fixed redirection to wrong contact record X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2678caac3ad409d7590bc4316fd2f34c2dcf6e59;p=civicrm-core.git CRM-12357 fixed redirection to wrong contact record --- diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 5867d148b3..b77628b9ef 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -844,14 +844,12 @@ INNER JOIN {$activityContactTempTable} on {$activityTempTable}.activity_id = {$a } else { $values[$activityID]['recipients'] = ts('(recipients)'); - $values[$activityID]['mailingId'] = ''; + $values[$activityID]['mailingId'] = false; if ( $accessCiviMail && ($mailingIDs === TRUE || in_array($dao->source_record_id, $mailingIDs)) ) { - $values[$activityID]['mailingId'] = CRM_Utils_System::url('civicrm/mailing/report', - "mid={$dao->source_record_id}&reset=1&cid={$dao->source_contact_id}&context=activitySelector" - ); + $values[$activityID]['mailingId'] = true; } } } @@ -2410,7 +2408,7 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n } if (isset($values['mailingId']) && !empty($values['mailingId'])) { - $contactActivities[$activityId]['target_contact'] = CRM_Utils_System::href($values['recipients'], 'civicrm/mailing/report', "mid={$values['source_record_id']}&reset=1&cid={$values['source_contact_id']}&context=activitySelector"); + $contactActivities[$activityId]['target_contact'] = CRM_Utils_System::href($values['recipients'], 'civicrm/mailing/report', "mid={$values['source_record_id']}&reset=1&cid={$params['contact_id']}&context=activitySelector"); } elseif (CRM_Utils_Array::value('recipients', $values)) { $contactActivities[$activityId]['target_contact'] = $values['recipients']; diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index cc3d38f62e..86ffa343ce 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -2767,7 +2767,7 @@ AND m.id = %1 $contactMailings[$mailingId]['subject'] = $values['subject']; $contactMailings[$mailingId]['start_date'] = CRM_Utils_Date::customFormat($values['start_date']); $contactMailings[$mailingId]['recipients'] = CRM_Utils_System::href(ts('(recipients)'), 'civicrm/mailing/report/event', - "mid={$values['mailing_id']}&reset=1&cid={$values['creator_id']}&event=delivered&context=mailing"); + "mid={$values['mailing_id']}&reset=1&cid={$params['contact_id']}&event=delivered&context=mailing"); $contactMailings[$mailingId]['mailing_creator'] = CRM_Utils_System::href( $values['creator_name'], 'civicrm/contact/view', @@ -2793,7 +2793,7 @@ AND m.id = %1 CRM_Core_Action::BROWSE => array( 'name' => ts('Mailing Report'), 'url' => 'civicrm/mailing/report', - 'qs' => "mid={$values['mailing_id']}&reset=1&cid={$values['creator_id']}&context=mailing", + 'qs' => "mid={$values['mailing_id']}&reset=1&cid={$params['contact_id']}&context=mailing", 'title' => ts('View Mailing Report'), ) );