3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.4 |
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 * Dummy page for details of Email
40 class CRM_Contact_Page_View_Email
extends CRM_Core_Page
{
45 * This method is called after the page is created.
52 // get the callback, module and activity id
53 $action = CRM_Utils_Request
::retrieve('action', 'String', $this, FALSE, 'browse' );
54 $id = CRM_Utils_Request
::retrieve('id', 'Positive', $this );
56 $dao = new CRM_Core_DAO_ActivityHistory();
57 $dao->activity_id
= $id;
58 $dao->activity_type
= ts('Email Sent');
59 if ($dao->find(TRUE)) {
60 $cid = $dao->entity_id
;
63 $dao = new CRM_Core_DAO_EmailHistory();
66 if ($dao->find(TRUE)) {
67 // get the display name and email for the contact
68 list($toContactName, $toContactEmail, $toDoNotEmail) = CRM_Contact_BAO_Contact
::getContactDetails($cid);
70 if (!trim($toContactName)) {
71 $toContactName = $toContactEmail;
74 if (trim($toContactEmail)) {
75 $toContactName = "\"$toContactName\" <$toContactEmail>";
78 $this->assign('toName', $toContactName);
80 // get the display name and email for the contact
81 list($fromContactName, $fromContactEmail, $toDoNotEmail) = CRM_Contact_BAO_Contact
::getContactDetails($dao->contact_id
);
83 if (!trim($fromContactEmail)) {
84 CRM_Core_Error
::statusBounce(ts('Your user record does not have a valid email address'));
87 if (!trim($fromContactName)) {
88 $fromContactName = $fromContactEmail;
91 $this->assign('fromName', "\"$fromContactName\" <$fromContactEmail>");
93 $this->assign('sentDate', $dao->sent_date
);
94 $this->assign('subject', $dao->subject
);
95 $this->assign('message', $dao->message
);
97 // get the display name and images for the contact
98 list($displayName, $contactImage) = CRM_Contact_BAO_Contact
::getDisplayAndImage($dao->contact_id
);
100 CRM_Utils_System
::setTitle($contactImage . ' ' . $displayName);
101 // also add the cid params to the Menu array
102 CRM_Core_Menu
::addParam('cid', $cid);
104 return parent
::run();