// creating a new relationship
$dataExists = self::dataExists($params);
if (!$dataExists) {
- return NULL;
+ return array(FALSE, TRUE, FALSE, FALSE, NULL);
}
$relationshipIds = array();
foreach ($params['contact_check'] as $key => $value) {
)
) {
$duplicate++;
- return array($valid, $invalid, $duplicate);
+ return array($valid, $invalid, $duplicate, $saved, NULL);
}
$validContacts = TRUE;
AND is_current_member = 1";
$result = CRM_Core_DAO::singleValueQuery($query);
if ($result < CRM_Utils_Array::value('max_related', $membershipValues, PHP_INT_MAX)) {
- CRM_Member_BAO_Membership::create($membershipValues, CRM_Core_DAO::$_nullArray);
+ CRM_Member_BAO_Membership::create($membershipValues, CRM_Core_DAO::$_nullArray);
}
}
}
if ($employerId && ($isDisabled || $relChanged)) {
CRM_Contact_BAO_Contact_Utils::clearCurrentEmployer($this->_values['current_employee_id']);
}
-
+
//if field key doesn't exists in params that means the user has unchecked checkbox,
//hence fill FALSE to params
$params['is_active'] = $isDisabled ? FALSE : TRUE;
//special case to handle if all checkboxes are unchecked
$customFields = CRM_Core_BAO_CustomField::getFields('Relationship', FALSE, FALSE, $relationshipTypeId);
- $params['custom'] = CRM_Core_BAO_CustomField::postProcess($params,
+ $params['custom'] = CRM_Core_BAO_CustomField::postProcess(
+ $params,
$customFields,
$this->_relationshipId,
'Relationship'