Merge pull request #19943 from civicrm/5.36
[civicrm-core.git] / CRM / Contact / Page / Inline / ContactName.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
bc77d7c0
TO
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 |
6a488035
TO
9 +--------------------------------------------------------------------+
10 */
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
5709ac86 19 * Page to display contact name on top of the summary.
6a488035
TO
20 */
21class CRM_Contact_Page_Inline_ContactName extends CRM_Core_Page {
22
23 /**
24 * Run the page.
25 *
26 * This method is called after the page is created.
6a488035 27 */
00be9182 28 public function run() {
6a488035 29 // get the emails for this contact
1be22cfb 30 $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
8ef12e64 31
6a488035
TO
32 $isDeleted = (bool) CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'is_deleted');
33
34 $this->assign('contactId', $contactId);
8ef12e64 35
36 $title = CRM_Contact_Page_View::setTitle($contactId, $isDeleted);
6a488035
TO
37 $this->assign('title', $title);
38
39 // Check if this is default domain contact CRM-10482
e2046b33 40 $this->assign('domainContact', CRM_Contact_BAO_Contact::checkDomainContact($contactId));
6a488035
TO
41
42 // check logged in user permission
43 CRM_Contact_Page_View::checkUserPermission($this, $contactId);
8ef12e64 44
45 // finally call parent
6a488035
TO
46 parent::run();
47 }
96025800 48
6a488035 49}