From 752ddf3548fdf07dd3abe33628e01ad7eaa77784 Mon Sep 17 00:00:00 2001 From: Nileema Date: Fri, 9 May 2014 10:41:34 +0530 Subject: [PATCH] HR-345 Fix for profile selector edit link --- CRM/Core/BAO/UFField.php | 15 +++++++-------- CRM/Event/Form/ManageEvent/Registration.php | 4 ++-- js/model/crm.uf.js | 7 ++++++- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index 5baa73671e..cf288ec0a0 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -142,7 +142,7 @@ class CRM_Core_BAO_UFField extends CRM_Core_DAO_UFField { $ufField->field_name = $params['field_name'][1]; if ($params['field_name'][1] == 'url') { $ufField->website_type_id = CRM_Utils_Array::value(2, $params['field_name'], NULL); - } + } else { $ufField->location_type_id = (CRM_Utils_Array::value(2, $params['field_name'])) ? $params['field_name'][2] : 'NULL'; } @@ -219,7 +219,7 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; $locationTypeId = NULL; if ($params['field_name'][1] == 'url') { $ufField->website_type_id = CRM_Utils_Array::value(2, $params['field_name']); - } + } else { $locationTypeId = CRM_Utils_Array::value(2, $params['field_name']); $ufField->website_type_id = NULL; @@ -929,12 +929,7 @@ SELECT id 'name' => 'contribution_note', 'title' => ts('Contribution Note'), ); - if ($gid && CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $gid, 'name') == 'contribution_batch_entry') { - $fields['Contribution'] = array_merge($contribFields, self::getContribBatchEntryFields()); - } - else { - $fields['Contribution'] = $contribFields; - } + $fields['Contribution'] = array_merge($contribFields, self::getContribBatchEntryFields()); } } @@ -1094,6 +1089,10 @@ SELECT id 'name' => 'soft_credit', 'title' => ts('Soft Credit'), ), + 'soft_credit_type' => array( + 'name' => 'soft_credit_type', + 'title' => ts('Soft Credit Type'), + ), 'product_name' => array( 'name' => 'product_name', 'title' => ts('Premiums'), diff --git a/CRM/Event/Form/ManageEvent/Registration.php b/CRM/Event/Form/ManageEvent/Registration.php index 0f64759f46..036b1d58db 100644 --- a/CRM/Event/Form/ManageEvent/Registration.php +++ b/CRM/Event/Form/ManageEvent/Registration.php @@ -374,8 +374,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent $configs['allowCoreTypes'][] = 'Individual'; $configs['allowCoreTypes'][] = 'Participant'; - $configs['profileEntities'][] = array('entity_name' => 'individual_entity', 'entity_type' => 'IndividualModel'); - $configs['profileEntities'][] = array('entity_name' => 'participant_entity', 'entity_type' => 'ParticipantModel'); + $configs['profileEntities'][] = array('entity_name' => 'individual_1', 'entity_type' => 'IndividualModel'); + $configs['profileEntities'][] = array('entity_name' => 'participant_1', 'entity_type' => 'ParticipantModel'); return $configs; } diff --git a/js/model/crm.uf.js b/js/model/crm.uf.js index 3579334123..e72c8383c5 100644 --- a/js/model/crm.uf.js +++ b/js/model/crm.uf.js @@ -689,6 +689,11 @@ // set proper entity model based on selected profile var contactTypes = ['Individual', 'Household', 'Organization']; var profileType = ufGroupModel.get('group_type') || ''; + + // check if selected profile have subtype defined eg: ["Individual,Contact,Case", "caseType:7"] + if (_.isArray(profileType) && profileType[0]) { + profileType = profileType[0]; + } profileType = profileType.split(','); var ufEntityModel; @@ -706,7 +711,7 @@ var newUfEntityModels = []; _.each(allEntityModels, function (values) { - if (values.entity_name == 'contact_1') { + if (entityType && values.entity_name == 'contact_1') { values.entity_type = entityType; } newUfEntityModels.push(new CRM.UF.UFEntityModel(values)); -- 2.25.1