/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
/**
* Adjust Metadata for Create action
- *
+ *
* The metadata is used for setting defaults, documentation & validation
* @param array $params array or parameters determined by getfields
*/
* @param string $op
*
* @return Array
- * @todo behaviour is highly non-standard - need to figure out how to make this 'behave'
+ * @todo behaviour is highly non-standard - need to figure out how to make this 'behave'
* & at the very least return IDs & details of the groups created / changed
*/
function _civicrm_api3_group_contact_common($params, $op = 'Added') {
$method = CRM_Utils_Array::value('method', $params, 'API');
$status = CRM_Utils_Array::value('status', $params, $op);
$tracking = CRM_Utils_Array::value('tracking', $params);
-
if ($op == 'Added' || $op == 'Pending') {
$extraReturnValues= array(
civicrm_api3_verify_mandatory($params, NULL, array('contact_id', 'group_id'));
- $method = CRM_Utils_Array::value('method', $params, 'API');
- $tracking = CRM_Utils_Array::value('tracking', $params);
-
- CRM_Contact_BAO_GroupContact::updateGroupMembershipStatus($params['contact_id'], $params['group_id'], $method, $tracking);
+ CRM_Contact_BAO_GroupContact::addContactsToGroup(
+ array($params['contact_id']),
+ $params['group_id'],
+ CRM_Utils_Array::value('method', $params, 'API'),
+ 'Added',
+ CRM_Utils_Array::value('tracking', $params)
+ );
return TRUE;
}