bug fix: get all events of all projects
This commit is contained in:
parent
3554f958d2
commit
50a63ee860
1 changed files with 11 additions and 11 deletions
|
@ -74,22 +74,22 @@ function civicrm_api3_twingle_sync_Post(array $params) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all events from projects of event type
|
// Get all events from projects of type "event" and create them as campaigns
|
||||||
|
// if they do not exist yet
|
||||||
|
$j = 0;
|
||||||
foreach ($result_values['sync']['projects'] as $project) {
|
foreach ($result_values['sync']['projects'] as $project) {
|
||||||
if ($project['project_type'] == 'event') {
|
if ($project['project_type'] == 'event') {
|
||||||
$events = $twingleApi->getEvent($project['project_id']);
|
$events = $twingleApi->getEvent($project['project_id']);
|
||||||
}
|
if (is_array($events)) {
|
||||||
}
|
|
||||||
|
|
||||||
// Create events them as campaigns if they do not exist and store results in
|
|
||||||
// $result_values
|
|
||||||
$j = 0;
|
|
||||||
if ($events) {
|
|
||||||
foreach ($events as $event) {
|
foreach ($events as $event) {
|
||||||
|
if ($event) {
|
||||||
$result_values['sync']['events'][$j++] =
|
$result_values['sync']['events'][$j++] =
|
||||||
TwingleEvent::sync($event, $twingleApi, $is_test);
|
TwingleEvent::sync($event, $twingleApi, $is_test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return civicrm_api3_create_success($result_values);
|
return civicrm_api3_create_success($result_values);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue