<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
$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);
}
/**
*
* @param object $page - the view page which created this one
*
- * @return none
+ * @return void
* @static
*
*/
$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 {
}
return parent::run();
}
-}
-
+}
\ No newline at end of file