$backUrl = CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing");
$backUrlTitle = ts('Back to Mailing');
}
+ elseif ($context == 'angPage') {
+ $angPage = CRM_Utils_Request::retrieve('angPage', 'String', $this);
+ if (!preg_match(':^[a-zA-Z0-9\-_/]+$:', $angPage)) {
+ CRM_Core_Error::fatal('Malformed return URL');
+ }
+ $backUrl = CRM_Utils_System::url('civicrm/a/#/' . $angPage);
+ $backUrlTitle = ts('Back to Report');
+ }
else {
$backUrl = CRM_Utils_System::url('civicrm/mailing/report', "reset=1&mid={$mailing_id}");
$backUrlTitle = ts('Back to Report');
* @param mailing object
* @param statType object (see statTypes above)
* @param view string ('search', 'event', 'report')
+ * @param returnPath string|null Return path (relative to Angular base)
* @return string|null
*/
- getUrl: function getUrl(mailing, statType, view) {
+ getUrl: function getUrl(mailing, statType, view, returnPath) {
switch (view) {
case 'events':
+ var retParams = returnPath ? '&context=angPage&angPage=' + returnPath : '';
return crmLegacy.url('civicrm/mailing/report/event',
- 'reset=1&mid=' + mailing.id + statType.eventsFilter);
+ 'reset=1&mid=' + mailing.id + statType.eventsFilter + retParams);
case 'search':
return crmLegacy.url('civicrm/contact/search/advanced',
$scope.statTypes = crmMailingStats.getStatTypes();
$scope.statUrl = function statUrl(mailing, statType, view) {
- return crmMailingStats.getUrl(mailing, statType, view);
+ return crmMailingStats.getUrl(mailing, statType, view, 'abtest/' + $scope.abtest.ab.id);
};
$scope.checkPerm = CRM.checkPerm;