Skip to content
Snippets Groups Projects
Commit 74527c55 authored by colemanw's avatar colemanw
Browse files

Merge pull request #439 from kurund/CRM-12235

worked on CRM-12235, added missing feature of inline edit for multi-valu...
parents d046cbc6 fa6bfe1b
No related branches found
No related tags found
No related merge requests found
...@@ -61,9 +61,9 @@ class CRM_Contact_Form_Inline_CustomData extends CRM_Contact_Form_Inline { ...@@ -61,9 +61,9 @@ class CRM_Contact_Form_Inline_CustomData extends CRM_Contact_Form_Inline {
$this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $this, TRUE, NULL, $_REQUEST); $this->_groupID = CRM_Utils_Request::retrieve('groupID', 'Positive', $this, TRUE, NULL, $_REQUEST);
$this->assign('customGroupId', $this->_groupID); $this->assign('customGroupId', $this->_groupID);
$customRecId = CRM_Utils_Request::retrieve('customRecId', 'Positive', $this, FALSE, 1, $_REQUEST);
$subType = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId, ','); $subType = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId, ',');
CRM_Custom_Form_CustomData::preProcess($this, null, $subType, 1, CRM_Custom_Form_CustomData::preProcess($this, null, $subType, $customRecId,
$this->_contactType, $this->_contactId); $this->_contactType, $this->_contactId);
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
*/ */
/** /**
* This page displays custom data during inline edit * This page displays custom data during inline edit
* *
*/ */
class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page { class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page {
...@@ -52,17 +52,19 @@ class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page { ...@@ -52,17 +52,19 @@ class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page {
// get the emails for this contact // get the emails for this contact
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST); $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); $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);
//custom groups Inline //custom groups Inline
$entityType = CRM_Contact_BAO_Contact::getContactType($contactId); $entityType = CRM_Contact_BAO_Contact::getContactType($contactId);
$entitySubType = CRM_Contact_BAO_Contact::getContactSubType($contactId); $entitySubType = CRM_Contact_BAO_Contact::getContactSubType($contactId);
$groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId, $groupTree = &CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $contactId,
$cgId, $entitySubType $cgId, $entitySubType
); );
$details = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree); $details = CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
$fields = array_pop($details[$cgId]); //get the fields of single custom group record
$fields = CRM_Utils_Array::value($customRecId, $details[$cgId]);
$this->assign('customRecId', $customRecId);
$this->assign('contactId', $contactId); $this->assign('contactId', $contactId);
$this->assign('customGroupId', $cgId); $this->assign('customGroupId', $cgId);
$this->assign_by_ref('cd_edit', $fields); $this->assign_by_ref('cd_edit', $fields);
...@@ -70,8 +72,7 @@ class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page { ...@@ -70,8 +72,7 @@ class CRM_Contact_Page_Inline_CustomData extends CRM_Core_Page {
// check logged in user permission // check logged in user permission
CRM_Contact_Page_View::checkUserPermission($this, $contactId); CRM_Contact_Page_View::checkUserPermission($this, $contactId);
// finally call parent // finally call parent
parent::run(); parent::run();
} }
} }
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing | | 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}"{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}"{rdelim}'{/if}>
<div class="crm-clear crm-inline-block-content" {if $permission EQ 'edit'}title="{ts}Edit{/ts}"{/if}> <div class="crm-clear crm-inline-block-content" {if $permission EQ 'edit'}title="{ts}Edit{/ts}"{/if}>
{if $permission EQ 'edit'} {if $permission EQ 'edit'}
<div class="crm-edit-help"> <div class="crm-edit-help">
......
...@@ -33,8 +33,11 @@ ...@@ -33,8 +33,11 @@
<div class="collapsible-title"> <div class="collapsible-title">
{$cd_edit.title} {$cd_edit.title}
</div> </div>
<div class="crm-summary-block" id="custom-set-block-{$customGroupId}"> {if $cvID eq 0}
{include file="CRM/Contact/Page/View/CustomDataFieldView.tpl" customGroupId=$customGroupId} {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}
</div> </div>
</div> </div>
{/foreach} {/foreach}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment