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 * Dummy page for details of Email.
21 class CRM_Contact_Page_Inline_Email
extends CRM_Core_Page
{
26 * This method is called after the page is created.
28 public function run() {
29 // get the emails for this contact
30 $contactId = CRM_Utils_Request
::retrieve('cid', 'Positive', CRM_Core_DAO
::$_nullObject, TRUE, NULL, $_REQUEST);
32 $locationTypes = CRM_Core_PseudoConstant
::get('CRM_Core_DAO_Address', 'location_type_id', ['labelColumn' => 'display_name']);
34 $entityBlock = ['contact_id' => $contactId];
35 $emails = CRM_Core_BAO_Email
::getValues($entityBlock);
36 if (!empty($emails)) {
37 foreach ($emails as &$value) {
38 $value['location_type'] = $locationTypes[$value['location_type_id']];
42 $contact = new CRM_Contact_BAO_Contact();
43 $contact->id
= $contactId;
46 foreach (CRM_Contact_BAO_Contact
::$_commPrefs as $name) {
47 if (isset($contact->$name)) {
48 $privacy[$name] = $contact->$name;
52 $this->assign('contactId', $contactId);
53 $this->assign('email', $emails);
54 $this->assign('privacy', $privacy);
56 // check logged in user permission
57 CRM_Contact_Page_View
::checkUserPermission($this, $contactId);
59 // finally call parent