3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This implements the profile page for all contacts.
21 * It uses a selector object to do the actual display. The fields displayed are controlled by
24 class CRM_Mailing_Page_Event
extends CRM_Core_Page
{
27 * All the fields that are listings related.
34 * Run this page (figure out the action needed and perform it).
36 public function run() {
37 $selector = new CRM_Mailing_Selector_Event(
38 CRM_Utils_Request
::retrieve('event', 'String', $this),
39 CRM_Utils_Request
::retrieve('distinct', 'Boolean', $this),
40 CRM_Utils_Request
::retrieve('mid', 'Positive', $this),
41 CRM_Utils_Request
::retrieve('jid', 'Positive', $this),
42 CRM_Utils_Request
::retrieve('uid', 'Positive', $this)
45 $mailing_id = CRM_Utils_Request
::retrieve('mid', 'Positive', $this);
47 // check that the user has permission to access mailing id
48 CRM_Mailing_BAO_Mailing
::checkPermission($mailing_id);
50 $context = CRM_Utils_Request
::retrieve('context', 'Alphanumeric', $this);
52 if ($context == 'activitySelector') {
53 $cid = CRM_Utils_Request
::retrieve('cid', 'Positive', $this);
54 $backUrl = CRM_Utils_System
::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=activity");
55 $backUrlTitle = ts('Back to Activities');
57 elseif ($context == 'mailing') {
58 $cid = CRM_Utils_Request
::retrieve('cid', 'Positive', $this);
59 $backUrl = CRM_Utils_System
::url('civicrm/contact/view', "reset=1&cid={$cid}&selectedChild=mailing");
60 $backUrlTitle = ts('Back to Mailing');
62 elseif ($context == 'angPage') {
63 $angPage = CRM_Utils_Request
::retrieve('angPage', 'String', $this);
64 if (!preg_match(':^[a-zA-Z0-9\-_/]+$:', $angPage)) {
65 throw new CRM_Core_Exception('Malformed return URL');
67 $backUrl = CRM_Utils_System
::url('civicrm/a/#/' . $angPage);
68 $backUrlTitle = ts('Back to Report');
71 $backUrl = CRM_Utils_System
::url('civicrm/mailing/report', "reset=1&mid={$mailing_id}");
72 $backUrlTitle = ts('Back to Report');
75 $this->assign('backUrl', $backUrl);
76 $this->assign('backUrlTitle', $backUrlTitle);
78 CRM_Utils_System
::setTitle($selector->getTitle());
79 $this->assign('title', $selector->getTitle());
80 $this->assign('mailing_id', $mailing_id);
83 if ($this->get(CRM_Utils_Sort
::SORT_ID
)) {
84 $sortID = CRM_Utils_Sort
::sortIDValue($this->get(CRM_Utils_Sort
::SORT_ID
),
85 $this->get(CRM_Utils_Sort
::SORT_DIRECTION
)
89 $controller = new CRM_Core_Selector_Controller(
91 $this->get(CRM_Utils_Pager
::PAGE_ID
),
93 CRM_Core_Action
::VIEW
,
95 CRM_Core_Selector_Controller
::TEMPLATE
98 $controller->setEmbedded(TRUE);
101 return parent
::run();