Commit ec3500a0 authored by bgm's avatar bgm
Browse files

Merge branch 'master' of lab.civicrm.org:extensions/activityprofile

parents 0ed27947 3b73bf8e
......@@ -146,6 +146,11 @@ class CRM_Activityprofile_APIWrappers_Profile {
'subject' => $title,
]);
// [ML] see also patch in remoteform.js to escape newlines on submit
if (!empty($apiRequest['params']['activity_details']) && strpos($apiRequest['params']['activity_details'], '<') === FALSE) {
$apiRequest['params']['activity_details'] = nl2br($apiRequest['params']['activity_details']);
}
$apiRequest['params']['activity_id'] = $activity['id'];
return $apiRequest;
}
......
......@@ -187,6 +187,17 @@ function activityprofile_civicrm_post($op, $objectName, $objectId, &$objectRef)
2 => [$activity_type_id, 'Positive'],
]);
}
// If notifications are enable, send the email
// Copied from CRM/Profile/Form.php
if ($notify = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_UFGroup', $profile_id, 'notify')) {
$contact_id = CRM_Core_DAO::singleValueQuery('SELECT contact_id FROM civicrm_activity_contact WHERE activity_id = %1', [
1 => [$objectRef->id, 'Positive'],
]);
// @todo Lookup the labels for the keys of the $data['params'] so that the email displays the labels?
$values = ['id' => $profile_id, 'values' => $data['params'], 'email' => $notify];
CRM_Core_BAO_UFGroup::commonSendMail($contact_id, $values);
}
}
}
......
Supports Markdown
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