3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.3 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2013 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2013
37 * Page to display / edit the header / footer of a mailing
40 class CRM_Mailing_Page_Report
extends CRM_Core_Page_Basic
{
46 * @return string Classname of BAO
48 function getBAOName() {
49 return 'CRM_Mailing_BAO_Mailing';
53 return CRM_Core_DAO
::$_nullObject;
61 return 'CiviMail Report';
67 * @return string user context.
69 function userContext($mode = NULL) {
70 return 'civicrm/mailing/report';
73 function userContextParams($mode = NULL) {
74 return 'reset=1&mid=' . $this->_mailing_id
;
78 $this->_mailing_id
= CRM_Utils_Request
::retrieve('mid', 'Positive', $this);
80 // check that the user has permission to access mailing id
81 CRM_Mailing_BAO_Mailing
::checkPermission($this->_mailing_id
);
83 $report = CRM_Mailing_BAO_Mailing
::report($this->_mailing_id
);
85 //get contents of mailing
86 CRM_Mailing_BAO_Mailing
::getMailingContent($report, $this);
89 $context = CRM_Utils_Request
::retrieve('context', 'String', $this);
90 $cid = CRM_Utils_Request
::retrieve('cid', 'Positive', $this);
92 if ($context == 'activitySelector') {
93 $backUrl = CRM_Utils_System
::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
94 $backUrlTitle = ts('Back to Activities');
96 elseif ($context == 'activity') {
97 $atype = CRM_Utils_Request
::retrieve('atype', 'Positive', $this);
98 $aid = CRM_Utils_Request
::retrieve('aid', 'Positive', $this);
100 $backUrl = CRM_Utils_System
::url('civicrm/activity/view',
101 "atype={$atype}&action=view&reset=1&id={$aid}&cid={$cid}&context=activity"
103 $backUrlTitle = ts('Back to Activity');
105 elseif ($context == 'mailing') {
106 $backUrl = CRM_Utils_System
::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing");
107 $backUrlTitle = ts('Back to Mailing');
110 $backUrl = CRM_Utils_System
::url('civicrm/mailing', 'reset=1');
111 $backUrlTitle = ts('Back to CiviMail');
113 $this->assign('backUrl', $backUrl);
114 $this->assign('backUrlTitle', $backUrlTitle);
116 $this->assign('report', $report);
117 CRM_Utils_System
::setTitle(ts('CiviMail Report: %1',
118 array(1 => $report['mailing']['name'])
121 return CRM_Core_Page
::run();