Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
012f4901e4 | ||
![]() |
7415fac88d | ||
![]() |
91c70c645a |
4 changed files with 9 additions and 7 deletions
|
@ -219,13 +219,15 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
|
||||||
private
|
private
|
||||||
static function matchContact(string $names, string $email): ?int {
|
static function matchContact(string $names, string $email): ?int {
|
||||||
$names = StringOps::split_names($names); // Hopefully just a temporary solution
|
$names = StringOps::split_names($names); // Hopefully just a temporary solution
|
||||||
$firstnames = $names['firstnames'];
|
$firstnames = $names['firstnames'] ?? NULL;
|
||||||
$lastname = $names['lastname'];
|
$lastname = $names['lastname'] ?? NULL;
|
||||||
|
$display_name = $names['display_name'] ?? NULL;
|
||||||
try {
|
try {
|
||||||
$contact = civicrm_api3('Contact', 'getorcreate', [
|
$contact = civicrm_api3('Contact', 'getorcreate', [
|
||||||
'xcm_profile' => Civi::settings()->get('twinglecampaign_xcm_profile'),
|
'xcm_profile' => Civi::settings()->get('twinglecampaign_xcm_profile'),
|
||||||
'first_name' => $firstnames,
|
'first_name' => $firstnames,
|
||||||
'last_name' => $lastname,
|
'last_name' => $lastname,
|
||||||
|
'display_name' => $display_name,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
]);
|
]);
|
||||||
return (int) $contact['id'];
|
return (int) $contact['id'];
|
||||||
|
|
|
@ -49,7 +49,7 @@ class CRM_TwingleCampaign_Utils_StringOperations {
|
||||||
$firstnames = implode(" ", $names);
|
$firstnames = implode(" ", $names);
|
||||||
return ['firstnames' => $firstnames, 'lastname' => $lastname];
|
return ['firstnames' => $firstnames, 'lastname' => $lastname];
|
||||||
}
|
}
|
||||||
return $string;
|
return ['display_name' => $string];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,4 +71,4 @@ class CRM_TwingleCampaign_Utils_StringOperations {
|
||||||
public static function startsWith($haystack, $needle): bool {
|
public static function startsWith($haystack, $needle): bool {
|
||||||
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
|
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,8 +193,8 @@ function civicrm_api3_twingle_project_Sync(array $params): array {
|
||||||
foreach ($projects_from_civicrm['values'] as $project_from_civicrm) {
|
foreach ($projects_from_civicrm['values'] as $project_from_civicrm) {
|
||||||
if (
|
if (
|
||||||
!in_array($project_from_civicrm['project_id'],
|
!in_array($project_from_civicrm['project_id'],
|
||||||
array_column($projects_from_twingle, 'id')
|
array_column($projects_from_twingle, 'id'),
|
||||||
)) {
|
) && $project_from_civicrm['is_active'] == 1) {
|
||||||
// store campaign id in $id
|
// store campaign id in $id
|
||||||
$id = $project_from_civicrm['id'];
|
$id = $project_from_civicrm['id'];
|
||||||
unset($project_from_civicrm['id']);
|
unset($project_from_civicrm['id']);
|
||||||
|
|
2
info.xml
2
info.xml
|
@ -15,7 +15,7 @@
|
||||||
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
|
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
|
||||||
</urls>
|
</urls>
|
||||||
<releaseDate>2024-06-15</releaseDate>
|
<releaseDate>2024-06-15</releaseDate>
|
||||||
<version>1.0.7</version>
|
<version>1.0.8</version>
|
||||||
<develStage>stable</develStage>
|
<develStage>stable</develStage>
|
||||||
<compatibility>
|
<compatibility>
|
||||||
<ver>5.74</ver>
|
<ver>5.74</ver>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue