From: Kurund Jalmi Date: Wed, 1 May 2013 20:17:36 +0000 (-0700) Subject: worked on CRM-12357, fixed redirecting back to correct page X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=01c22255e2ecdd68d922c8bc0113672b3870780d;p=civicrm-core.git worked on CRM-12357, fixed redirecting back to correct page --- diff --git a/CRM/Mailing/Page/Event.php b/CRM/Mailing/Page/Event.php index 749806db20..201924a3a4 100644 --- a/CRM/Mailing/Page/Event.php +++ b/CRM/Mailing/Page/Event.php @@ -65,6 +65,22 @@ class CRM_Mailing_Page_Event extends CRM_Core_Page { $mailing_id = CRM_Utils_Request::retrieve('mid', 'Positive', $this); + //assign backurl + $context = CRM_Utils_Request::retrieve('context', 'String', $this); + + if ($context == 'mailing') { + $cid = CRM_Utils_Request::retrieve('cid', 'Positive', $this); + $backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing"); + $backUrlTitle = ts('Back to Mailing'); + } + else { + $backUrl = CRM_Utils_System::url('civicrm/mailing', 'reset=1'); + $backUrlTitle = ts('Back to Report'); + } + + $this->assign('backUrl', $backUrl); + $this->assign('backUrlTitle', $backUrlTitle); + CRM_Utils_System::setTitle($selector->getTitle()); $this->assign('title', $selector->getTitle()); $this->assign('mailing_id', $mailing_id); diff --git a/templates/CRM/Mailing/Page/Event.tpl b/templates/CRM/Mailing/Page/Event.tpl index 7cee9f58e6..93d7a54b6b 100644 --- a/templates/CRM/Mailing/Page/Event.tpl +++ b/templates/CRM/Mailing/Page/Event.tpl @@ -62,7 +62,7 @@ {/if} {include file="CRM/common/pager.tpl" location="bottom"}