You are here

function wf_crm_required_contact_fields in Webform CiviCRM Integration 7.4

Same name and namespace in other branches
  1. 7.5 includes/utils.inc \wf_crm_required_contact_fields()
  2. 7.3 webform_civicrm_utils.inc \wf_crm_required_contact_fields()

At least one of these fields is required to create a contact

Parameters

string $contact_type:

Return value

array of fields

2 calls to wf_crm_required_contact_fields()
wf_crm_name_field_exists in includes/utils.inc
Check if a name or email field exists for this contact. This determines whether a new contact can be created on the webform.
wf_crm_webform_postprocess::isContactEmpty in includes/wf_crm_webform_postprocess.inc
Check if at least one required field was filled for a contact

File

includes/utils.inc, line 1660
Webform CiviCRM module's common utility functions.

Code

function wf_crm_required_contact_fields($contact_type) {
  if ($contact_type == 'individual') {
    return array(
      array(
        'table' => 'email',
        'name' => 'email',
      ),
      array(
        'table' => 'contact',
        'name' => 'first_name',
      ),
      array(
        'table' => 'contact',
        'name' => 'last_name',
      ),
      array(
        'table' => 'contact',
        'name' => 'nick_name',
      ),
    );
  }
  return array(
    array(
      'table' => 'contact',
      'name' => $contact_type . '_name',
    ),
  );
}