X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FPage%2FView%2FCustomData.php;h=6b0bdc7a58373046a878692cee687a07f43b4036;hb=e41f46600121c125cb19538abeca478c6944e0be;hp=46119438cb7a004a5a7492213b620b20c92f37a6;hpb=03a8c3dcf5d8c3fe76a0551cbdfea259fc40e101;p=civicrm-core.git diff --git a/CRM/Contact/Page/View/CustomData.php b/CRM/Contact/Page/View/CustomData.php index 46119438cb..6b0bdc7a58 100644 --- a/CRM/Contact/Page/View/CustomData.php +++ b/CRM/Contact/Page/View/CustomData.php @@ -75,6 +75,10 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page { $this->_groupId = CRM_Utils_Request::retrieve('gid', 'Positive', $this, TRUE); $this->assign('groupId', $this->_groupId); + + $this->_multiRecordDisplay = CRM_Utils_Request::retrieve('multiRecordDisplay', 'String', $this, FALSE); + $this->_cgcount = CRM_Utils_Request::retrieve('cgcount', 'Positive', $this, FALSE); + $this->_recId = CRM_Utils_Request::retrieve('recId', 'Positive', $this, FALSE); } /** @@ -87,7 +91,7 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page { * * @param object $page - the view page which created this one * - * @return none + * @return void * @static * */ @@ -119,7 +123,39 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page { $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $this->_contactId, $this->_groupId, $entitySubType ); - CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree); + + $displayStyle = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', + $this->_groupId, + 'style' + ); + + if ($displayStyle === 'Tab with table' && $this->_multiRecordDisplay != 'single') { + $ctype = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', + $this->_contactId, + 'contact_type' + ); + + $this->assign('displayStyle', 'tableOriented'); + // here the multi custom data listing code will go + $multiRecordFieldListing = TRUE; + $page = new CRM_Profile_Page_MultipleRecordFieldsListing(); + $page->set('contactId', $this->_contactId); + $page->set('customGroupId', $this->_groupId); + $page->set('action', CRM_Core_Action::BROWSE); + $page->set('multiRecordFieldListing', $multiRecordFieldListing); + $page->set('pageViewType', 'customDataView'); + $page->set('contactType', $ctype); + $page->run(); + } + else { + $recId = NULL; + if ($this->_multiRecordDisplay == 'single') { + $recId = $this->_recId; + $this->assign('multiRecordDisplay', $this->_multiRecordDisplay); + $this->assign('skipTitle', 1); + } + CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, NULL, $recId); + } } else { @@ -138,5 +174,4 @@ class CRM_Contact_Page_View_CustomData extends CRM_Core_Page { } return parent::run(); } -} - +} \ No newline at end of file