Skip to content

Commit

Permalink
Add participant to civicrm data en to webform menu
Browse files Browse the repository at this point in the history
  • Loading branch information
kainuk committed Jul 12, 2019
1 parent 793a018 commit 7d8c4a8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions includes/wf_crm_webform_postprocess.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,8 @@ class wf_crm_webform_postprocess extends wf_crm_webform_base {
unset($params['status_id']);
}
$result = wf_civicrm_api('participant', 'create', $params);
$this->ent['participant'][$n]['id'] = $result['id'];

// Update line-item
foreach ($this->line_items as &$item) {
if ($item['element'] == "civicrm_{$n}_participant_{$e}_participant_{$id_and_type}") {
Expand Down
7 changes: 7 additions & 0 deletions webform_civicrm.module
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,13 @@ function webform_civicrm_webform_submission_actions($node, $submission) {
'query' => array('action' => 'view', 'reset' => 1, 'cid' => $data['contact'][1]['id'], 'id' => $data['contribution'][1]['id']),
);
}
if (!empty($data['participant'][1]['id'])) {
$actions['civicrm_action participant_view'] = array(
'title' => t('View Participant'),
'href' => 'civicrm/contact/view/participant',
'query' => array('action' => 'view', 'reset' => 1, 'cid' => $data['contact'][1]['id'], 'id' => $data['participant'][1]['id']),
);
}
}
}
return $actions;
Expand Down

0 comments on commit 7d8c4a8

Please sign in to comment.