$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);
{/if}
<div class="action-link">
- <a href="{crmURL p='civicrm/mailing/report' q="mid=`$mailing_id`&reset=1"}">» {ts}Back to Report{/ts}</a>
+ <a href="{$backUrl}">» {$backUrlTitle}</a>
</div>
{include file="CRM/common/pager.tpl" location="bottom"}