<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
$ufField->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 (CRM_Utils_Array::value('uf_field', $ids)) {
+ if (!empty($ids['uf_field'])) {
$ufField->whereAdd("id <> " . CRM_Utils_Array::value('uf_field', $ids));
}
$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;
}
// fix for CRM-316
$oldWeight = NULL;
- if (CRM_Utils_Array::value('field_id', $params)) {
+ if (!empty($params['field_id'])) {
$oldWeight = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFField', $params['field_id'], 'weight', 'id');
}
$fieldValues = array('uf_group_id' => $params['group_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',
'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());
}
}
}
}
+ 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.
'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'),