You are here

function webform_civicrm_civicrm_post in Webform CiviCRM Integration 7.2

Same name and namespace in other branches
  1. 8.5 webform_civicrm.module \webform_civicrm_civicrm_post()
  2. 6.2 webform_civicrm.module \webform_civicrm_civicrm_post()
  3. 7.5 webform_civicrm.module \webform_civicrm_civicrm_post()
  4. 7.3 webform_civicrm.module \webform_civicrm_civicrm_post()
  5. 7.4 webform_civicrm.module \webform_civicrm_civicrm_post()

Implements hook_civicrm_post(). Update submission data when civicrm data is deleted.

File

./webform_civicrm.module, line 280
Webform CiviCRM Integration Module: Links webform submissions to contacts in a CiviCRM database. @author Coleman Watts

Code

function webform_civicrm_civicrm_post($op, $type, $id, $obj) {
  if ($type === 'Activity' && $op === 'delete') {
    db_update('webform_civicrm_submissions')
      ->fields(array(
      'activity_id' => 0,
    ))
      ->condition('activity_id', $id)
      ->execute();
  }
}