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 communication preferences.
21 class CRM_Contact_Page_Inline_CommunicationPreferences
extends CRM_Core_Page
{
26 * This method is called after the page is created.
28 * @throws \CRM_Core_Exception
30 public function run() {
31 // get the emails for this contact
32 $contactId = CRM_Utils_Request
::retrieve('cid', 'Positive', CRM_Core_DAO
::$_nullObject, TRUE);
34 $params = ['id' => $contactId];
37 CRM_Contact_BAO_Contact
::getValues($params, $defaults);
38 $defaults['privacy_values'] = CRM_Core_SelectValues
::privacy();
40 $communicationStyle = CRM_Core_PseudoConstant
::get('CRM_Contact_DAO_Contact', 'communication_style_id');
41 if (!empty($communicationStyle)) {
42 if (!empty($defaults['communication_style_id'])) {
43 $defaults['communication_style_display'] = $communicationStyle[CRM_Utils_Array
::value('communication_style_id', $defaults)];
46 // Make sure the field is displayed as long as it is active, even if it is unset for this contact.
47 $defaults['communication_style_display'] = '';
51 $this->assign('contactId', $contactId);
52 $this->assign($defaults);
54 // check logged in user permission
55 CRM_Contact_Page_View
::checkUserPermission($this, $contactId);
57 // finally call parent