$this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $this, TRUE, NULL, $_REQUEST);
$this->assign('customGroupId', $this->_groupID);
$customRecId = CRM_Utils_Request::retrieve('customRecId', 'Positive', $this, FALSE, 1, $_REQUEST);
+ $cgcount = CRM_Utils_Request::retrieve('cgcount', 'Positive', $this, FALSE, 1, $_REQUEST);
$subType = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId, ',');
- CRM_Custom_Form_CustomData::preProcess($this, null, $subType, $customRecId,
+ CRM_Custom_Form_CustomData::preProcess($this, null, $subType, $cgcount,
$this->_contactType, $this->_contactId);
}
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$cgId = CRM_Utils_Request::retrieve('groupID', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
$customRecId = CRM_Utils_Request::retrieve('customRecId', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1, $_REQUEST);
+ $cgcount = CRM_Utils_Request::retrieve('cgcount', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, 1, $_REQUEST);
//custom groups Inline
$entityType = CRM_Contact_BAO_Contact::getContactType($contactId);
);
$details = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
//get the fields of single custom group record
- $fields = CRM_Utils_Array::value($customRecId, $details[$cgId]);
-
+ if ($customRecId == 1) {
+ $fields = reset($details[$cgId]);
+ }
+ else {
+ $fields = CRM_Utils_Array::value($customRecId, $details[$cgId]);
+ }
+ $this->assign('cgcount', $cgcount);
$this->assign('customRecId', $customRecId);
$this->assign('contactId', $contactId);
$this->assign('customGroupId', $cgId);
// check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId);
-
+
// finally call parent
parent::run();
}
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
-<div id="custom-set-content-{$customGroupId}" {if $permission EQ 'edit'} class="crm-inline-edit" data-edit-params='{ldelim}"cid": "{$contactId}", "class_name": "CRM_Contact_Form_Inline_CustomData", "groupID": "{$customGroupId}", "customRecId": "{$customRecId}"{rdelim}'{/if}>
+<div id="custom-set-content-{$customGroupId}" {if $permission EQ 'edit'} class="crm-inline-edit" data-edit-params='{ldelim}"cid": "{$contactId}", "class_name": "CRM_Contact_Form_Inline_CustomData", "groupID": "{$customGroupId}", "customRecId": "{$customRecId}", "cgcount" : "{$cgcount}"{rdelim}'{/if}>
<div class="crm-clear crm-inline-block-content" {if $permission EQ 'edit'}title="{ts}Edit{/ts}"{/if}>
{if $permission EQ 'edit'}
<div class="crm-edit-help">
{* Custom Data view mode*}
{assign var="customGroupCount" value = 1}
{foreach from=$viewCustomData item=customValues key=customGroupId}
+ {assign var="cgcount" value=1}
{assign var="count" value=$customGroupCount%2}
{if ($count eq $side) or $skipTitle }
{foreach from=$customValues item=cd_edit key=cvID}
{assign var='cvID' value='-1'}
{/if}
<div class="crm-summary-block" id="custom-set-block-{$customGroupId}-{$cvID}">
- {include file="CRM/Contact/Page/View/CustomDataFieldView.tpl" customGroupId=$customGroupId customRecId=$cvID}
+ {include file="CRM/Contact/Page/View/CustomDataFieldView.tpl" customGroupId=$customGroupId customRecId=$cvID cgcount=$cgcount}
</div>
</div>
+ {assign var="cgcount" value=$cgcount+1}
{/foreach}
{/if}
{assign var="customGroupCount" value = $customGroupCount+1}