You are here

function signup_webform_signup_insert in Signup 6.2

Implementation of hook_signup_insert().

Carries on from signup_webform_signup_data_alter(). Saves the relationship between the signup and the webform submission into {signup_webform_submission}, which we couldn't do earlier in signup_webform_signup_data_alter() because at that point there is no signup id.

File

modules/signup_webform/signup_webform.module, line 231
signup_webform.module

Code

function signup_webform_signup_insert($signup) {
  foreach (_signup_webform_pane_ids($signup->form_data) as $pane_id) {

    // Retrieve the Submission id where we put it in the form data.
    $submission_sid = $signup->form_data[$pane_id]['sid'];
    $webform_nid = substr($pane_id, 8);
    db_query("INSERT INTO {signup_webform_submission} (signup_sid, webform_nid, submission_sid) VALUES (%d, %d, %d)", $signup->sid, $webform_nid, $submission_sid);
  }
}