$ids = array('contactTarget' => $relationship->contact_id_b, 'contact' => $params['contact_id_a']);
CRM_Contact_BAO_Relationship::relatedMemberships($params['contact_id_a'], $values, $ids, (empty($params['id']) ? CRM_Core_Action::ADD : CRM_Core_Action::UPDATE));
}
+
+ //alter related membership if the is_active param is changed
+ if (!empty($params['id'])) {
+ $action = CRM_Core_Action::DISABLE;
+ if (!empty($params['is_active'])) {
+ $action = CRM_Core_Action::ENABLE;
+ }
+ CRM_Contact_BAO_Relationship::disableEnableRelationship($params['id'], $action);
+ }
self::addRecent($params, $relationship);
return $relationship;
}