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 page displays custom data during inline edit.
21 class CRM_Contact_Page_Inline_CustomData
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);
31 $cgId = CRM_Utils_Request
::retrieve('groupID', 'Positive', CRM_Core_DAO
::$_nullObject, TRUE);
32 $customRecId = CRM_Utils_Request
::retrieve('customRecId', 'Positive', CRM_Core_DAO
::$_nullObject, FALSE, 1);
33 $cgcount = CRM_Utils_Request
::retrieve('cgcount', 'Positive', CRM_Core_DAO
::$_nullObject, FALSE, 1);
35 //custom groups Inline
36 $entityType = CRM_Contact_BAO_Contact
::getContactType($contactId);
37 $entitySubType = CRM_Contact_BAO_Contact
::getContactSubType($contactId);
38 $groupTree = CRM_Core_BAO_CustomGroup
::getTree($entityType, NULL, $contactId,
41 $details = CRM_Core_BAO_CustomGroup
::buildCustomDataView($this, $groupTree, FALSE, NULL, NULL, NULL, $contactId);
42 //get the fields of single custom group record
43 if ($customRecId == 1) {
44 $fields = reset($details[$cgId]);
47 $fields = $details[$cgId][$customRecId] ??
NULL;
49 $this->assign('cgcount', $cgcount);
50 $this->assign('customRecId', $customRecId);
51 $this->assign('contactId', $contactId);
52 $this->assign('customGroupId', $cgId);
53 $this->assign_by_ref('cd_edit', $fields);
55 // check logged in user permission
56 CRM_Contact_Page_View
::checkUserPermission($this, $contactId);
58 // finally call parent