From 91c0d0d891ebf3174f34feb6983fce71d46542f0 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Wed, 10 Dec 2014 20:08:09 +0530 Subject: [PATCH] CRM-15626 fixes - Relationship Create Widget Not always showing the correct available relationships in select tool https://issues.civicrm.org/jira/browse/CRM-15626 --- CRM/Contact/BAO/Relationship.php | 24 ++++++------------------ CRM/Contact/Form/Relationship.php | 2 +- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 33f1e9c4e6..c151ba9913 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -369,15 +369,9 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { (!$otherContactType) || $value['contact_type_b'] == $otherContactType ) && - (!$contactSubType || - (in_array($value['contact_sub_type_a'], $contactSubType) || - in_array($value['contact_sub_type_b'], $contactSubType) || - ((!$value['contact_sub_type_b'] && - !$value['contact_sub_type_a'] - ) && - !$onlySubTypeRelationTypes - ) - ) + (in_array($value['contact_sub_type_a'], $contactSubType) || + in_array($value['contact_sub_type_b'], $contactSubType) || + (!$value['contact_sub_type_a'] && !$onlySubTypeRelationTypes) ) ) { $relationshipType[$key . '_a_b'] = $value["{$column}_a_b"]; @@ -390,15 +384,9 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { (!$otherContactType) || $value['contact_type_a'] == $otherContactType ) && - (!$contactSubType || - (in_array($value['contact_sub_type_b'], $contactSubType) || - in_array($value['contact_sub_type_a'], $contactSubType) || - ((!$value['contact_sub_type_a'] && - !$value['contact_sub_type_b'] - ) && - !$onlySubTypeRelationTypes - ) - ) + (in_array($value['contact_sub_type_b'], $contactSubType) || + in_array($value['contact_sub_type_a'], $contactSubType) || + (!$value['contact_sub_type_b'] && !$onlySubTypeRelationTypes) ) ) { $relationshipType[$key . '_b_a'] = $value["{$column}_b_a"]; diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 9639a69365..45ff98c3f9 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -322,7 +322,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { $this->assign('includeWysiwygEditor', TRUE); // Select list - $relationshipList = CRM_Contact_BAO_Relationship::getContactRelationshipType($this->_contactId, $this->_rtype, $this->_relationshipId, NULL, FALSE, 'label', TRUE, NULL, TRUE); + $relationshipList = CRM_Contact_BAO_Relationship::getContactRelationshipType($this->_contactId, $this->_rtype, $this->_relationshipId); // Metadata needed on clientside $contactTypes = CRM_Contact_BAO_ContactType::contactTypeInfo(TRUE); -- 2.25.1