Commit 42abe036 authored by bgm's avatar bgm Committed by Aegir user
Browse files

#1 Fix activity type ID references (hardcoded values)

parent 05255389
......@@ -37,8 +37,10 @@ class CRM_Activityprofile_APIWrappers_Profile {
])['title'];
}
$atype = Civi::settings()->get('activityprofile_' . $profile_id . '_atype') ?? 1;
$activity = civicrm_api3('Activity', 'create', [
'activity_type_id' => 1, // FIXME
'activity_type_id' => $atype,
'source_contact_id' => $contact['id'],
'target_contact_id' => $contact['id'],
'subject' => $title,
......
......@@ -186,8 +186,9 @@ function activityprofile_civicrm_post($op, $objectName, $objectId, &$objectRef)
$activity_type_id = Civi::settings()->get('activityprofile_' . $profile_id . '_atype');
if ($activity_type_id) {
CRM_Core_DAO::executeQuery('UPDATE civicrm_activity SET activity_type_id = 28 WHERE id = %1', [
CRM_Core_DAO::executeQuery('UPDATE civicrm_activity SET activity_type_id = %2 WHERE id = %1', [
1 => [$objectRef->id, 'Positive'],
2 => [$activity_type_id, 'Positive'],
]);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment