You are here

function crm_core_contact_ui_form_submit in CRM Core 7

Submit callback for crm_core_contact_ui_form().

1 string reference to 'crm_core_contact_ui_form_submit'
crm_core_contact_ui_form in modules/crm_core_contact_ui/
Form callback: create or edit a contact.


modules/crm_core_contact_ui/, line 115


function crm_core_contact_ui_form_submit($form, &$form_state) {
  global $user;
  $create = FALSE;
  $contact =& $form_state['crm_core_contact'];

  // Set the contact's uid if it's being created at this time.
  if (empty($contact->contact_id)) {
    $contact->uid = $user->uid;
    $create = TRUE;

  // Notify field widgets.
  field_attach_submit('crm_core_contact', $contact, $form, $form_state);

  // Save the contact

  // Redirect based on the button clicked.
  drupal_set_message(t('Contact saved.'));
  $form_state['redirect'] = $create ? 'crm-core/contact' : "crm-core/contact/{$contact->contact_id}";