/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
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;
}