X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FUFField.php;h=843e97c38f8ea421a9e07cf6b9f3d00e6f485f35;hb=f9d8a5d10a4641e646ea179406f2dc1dcbf80a63;hp=b03ea879181e9f39a9175c428baf65127df03161;hpb=79cffafae988e139ad14440c7502710a23ac15fa;p=civicrm-core.git diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index b03ea87918..843e97c38f 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -1,9 +1,9 @@ uf_group_id = CRM_Utils_Array::value('uf_group', $ids); $ufField->field_type = $params['field_name'][0]; $ufField->field_name = $params['field_name'][1]; - $ufField->location_type_id = (CRM_Utils_Array::value(2, $params['field_name'])) ? $params['field_name'][2] : 'NULL'; + 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'; + } $ufField->phone_type_id = CRM_Utils_Array::value(3, $params['field_name']); if (!empty($ids['uf_field'])) { @@ -211,7 +216,14 @@ WHERE cf.id IN (" . $customFieldIds . ") AND is_multiple = 1 LIMIT 0,1"; $ufField->field_name = $params['field_name'][1]; //should not set location type id for Primary - $locationTypeId = CRM_Utils_Array::value(2, $params['field_name']); + $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; + } if ($locationTypeId) { $ufField->location_type_id = $locationTypeId; } @@ -796,7 +808,11 @@ SELECT id $billing_id = CRM_Core_BAO_LocationType::getBilling(); list($prefixName, $index) = CRM_Utils_System::explode('-', $key, 2); - $profileFields = civicrm_api3('uf_field', 'get', array_merge($profileFilter, array('is_active' => 1, 'return' => 'field_name'))); + $profileFields = civicrm_api3('uf_field', 'get', array_merge($profileFilter, + array('is_active' => 1, 'return' => 'field_name', 'options' => array( + 'limit' => 0, + )) + )); //check for valid fields ( fields that are present in billing block ) $validBillingFields = array( 'first_name', @@ -917,12 +933,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()); } } @@ -968,6 +979,24 @@ SELECT id } } + if (CRM_Core_Permission::access('CiviCase')) { + $caseFields = CRM_Case_BAO_Query::getFields(TRUE); + $caseFields = array_merge($caseFields, CRM_Core_BAO_CustomField::getFieldsForImport('Case')); + if ($caseFields) { + // Remove fields not supported by profiles + CRM_Utils_Array::remove($caseFields, + 'case_id', + 'case_type', + 'case_start_date', + 'case_end_date', + 'case_role', + 'case_status', + 'case_deleted' + ); + } + $fields['Case'] = $caseFields; + } + $activityFields = CRM_Activity_BAO_Activity::getProfileFields(); if ($activityFields) { // campaign related fields. @@ -1064,6 +1093,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'),