start a case for event initiator

This commit is contained in:
Marc Michalsky forumZFD 2020-11-13 17:17:33 +01:00
parent cc4f4e85bc
commit fceac70336
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
2 changed files with 35 additions and 8 deletions

View file

@ -58,6 +58,15 @@ function _civicrm_api3_twingle_sync_Post_spec(array &$spec) {
function civicrm_api3_twingle_sync_Post(array $params) {
$result_values = [];
// Who is calling?
$api_key = $_REQUEST['api_key'];
$user = CRM_Core_DAO::getFieldValue(
'CRM_Contact_DAO_Contact',
$api_key,
'id',
'api_key'
);
// Is this call a test?
$is_test = (boolean) $params['is_test'];
@ -93,7 +102,7 @@ function civicrm_api3_twingle_sync_Post(array $params) {
foreach ($events as $event) {
if ($event) {
$result_values['sync']['events'][$j++] =
TwingleEvent::sync($event, $twingleApi, $is_test);
TwingleEvent::sync($event, $twingleApi, $user, $is_test);
}
}
}