Commit 78a8cd0c authored by bgm's avatar bgm Committed by Aegir user
Browse files

Add support for creating new cases

parent 51b77d4b
......@@ -10,6 +10,16 @@ class CRM_Activityprofile_APIWrappers_Profile {
$profile_id = _civicrm_api3_profile_getProfileID($params['profile_id']);
$isContactActivityProfile = CRM_Core_BAO_UFField::checkContactActivityProfileType($profile_id);
// If it is not for a Contact or Activity, check if it's for a new Case
if (!$isContactActivityProfile) {
$uf_group_type = civicrm_api3('UFGroup', 'getsingle', [
'id' => $profile_id,
'return' => 'group_type',
])['group_type'];
$isContactActivityProfile = ($uf_group_type == 'Case');
}
if (!$isContactActivityProfile || !empty($params['activity_id'])) {
return $apiRequest;
}
......@@ -102,6 +112,10 @@ class CRM_Activityprofile_APIWrappers_Profile {
$profile_id = _civicrm_api3_profile_getProfileID($params['profile_id']);
foreach ($result['values'] as $key => &$val) {
if ($val['name'] == 'profile_id') {
continue;
}
if ($val['name'] == 'url' && empty($val['data_type'])) {
$val = civicrm_api3('Website', 'getfields')['values']['url'];
}
......
# Activity Profile
Makes it possible to create new activities using standard CiviCRM Profiles.
Makes it possible to create new activities, cases and case activities using standard CiviCRM Profiles.
This works best with the [remoteforms](https://github.com/progressivetech/net.ourpowerbase.remoteform/)
extension, so we can embed simple contact forms in other websites with minimal configuration.
......@@ -20,8 +20,8 @@ The extension is licensed under [AGPL-3.0](LICENSE.txt).
## Requirements
* PHP v7.0+
* CiviCRM 5.10+
* PHP v7.2+
* CiviCRM 5.20+
* [remoteforms](https://github.com/progressivetech/net.ourpowerbase.remoteform/)
## Installation
......
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