You are here

function acquia_lift_campaign_start_form_submit in Acquia Lift Connector 7

Form submit handler for acquia_lift_campaign_start_form().

File

./acquia_lift.admin.unibar.inc, line 1591
acquia_lift.admin.unibar.inc

Code

function acquia_lift_campaign_start_form_submit($form, &$form_state) {

  // Set the decision style.
  $agent_data = $form_state['values']['agent'];
  $agent_data->data['decision_style'] = empty($form_state['values']['adaptive']) ? 'random' : 'adaptive';
  personalize_agent_save($agent_data);

  // Set the end date.
  module_load_include('inc', 'personalize', 'personalize.admin');
  personalize_agent_date_form_submit($agent_data->machine_name, $form_state['values']);

  // Start the campaign.
  $form_state['acquia_lift']['started'] = FALSE;
  if ($form_state['values']['campaign_start'] == 'none') {
    $form_state['acquia_lift']['started'] = personalize_agent_set_status($agent_data->machine_name, PERSONALIZE_STATUS_RUNNING);
  }
}