From d97a2fc1277c404555f3c00354486aa852d2d4f6 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 10 Mar 2014 09:25:11 -0400 Subject: [PATCH] Relationship form/xml tweaks --- CRM/Contact/Form/Relationship.php | 30 ++++++++++++------------- xml/schema/Contact/Relationship.xml | 10 ++++----- xml/schema/Contact/RelationshipType.xml | 4 ++-- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CRM/Contact/Form/Relationship.php b/CRM/Contact/Form/Relationship.php index 12e452ce1b..ff9125ac1e 100644 --- a/CRM/Contact/Form/Relationship.php +++ b/CRM/Contact/Form/Relationship.php @@ -44,77 +44,77 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { * * @var int */ - protected $_relationshipId; + public $_relationshipId; /** * The contact id, used when add/edit relationship * * @var int */ - protected $_contactId; + public $_contactId; /** * This is a string which is either a_b or b_a used to determine the relationship between to contacts * */ - protected $_rtype; + public $_rtype; /** * This is a string which is used to determine the relationship between to contacts * */ - protected $_rtypeId; + public $_rtypeId; /** * Display name of contact a * */ - protected $_display_name_a; + public $_display_name_a; /** * Display name of contact b * */ - protected $_display_name_b; + public $_display_name_b; /** * The relationship type id * * @var int */ - protected $_relationshipTypeId; + public $_relationshipTypeId; /** * an array of all relationship names * * @var array */ - protected $_allRelationshipNames; + public $_allRelationshipNames; /** * @var bool */ - protected $_enabled; + public $_enabled; /** * @var bool */ - protected $_isCurrentEmployer; + public $_isCurrentEmployer; /** * @var string */ - protected $_contactType; + public $_contactType; /** * The relationship values if Updating relationship */ - protected $_values; + public $_values; /** * casid if it called from case context */ - protected $_caseId; + public $_caseId; /** * @var mixed @@ -327,7 +327,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { // Metadata needed on clientside $contactTypes = CRM_Contact_BAO_ContactType::contactTypeInfo(TRUE); $jsData = array(); - // Filter it down to just what we need to keep the dom small + // Get just what we need to keep the dom small $whatWeWant = array_flip(array('contact_type_a', 'contact_type_b', 'contact_sub_type_a', 'contact_sub_type_b')); foreach($this->_allRelationshipNames as $id => $vals) { if ($vals['name_a_b'] === 'Employee of') { @@ -439,7 +439,7 @@ class CRM_Contact_Form_Relationship extends CRM_Core_Form { // Fill up this weird param with contact ids like the weird relationship bao expects $params['contact_check'] = array_fill_keys(explode(',', $params['related_contact_id']), 1); if (!$this->_rtype) { - list(, $this->_rtype) = explode('_', $relationshipTypeId, 2); + list(, $this->_rtype) = explode('_', $params['relationship_type_id'], 2); } } $params['start_date'] = CRM_Utils_Date::processDate($params['start_date'], NULL, TRUE); diff --git a/xml/schema/Contact/Relationship.xml b/xml/schema/Contact/Relationship.xml index 7a20ad673f..20f3362b83 100644 --- a/xml/schema/Contact/Relationship.xml +++ b/xml/schema/Contact/Relationship.xml @@ -22,7 +22,7 @@ contact_id_a int unsigned - Contact A ID + Contact A true id of the first contact 1.1 @@ -37,7 +37,7 @@ contact_id_b int unsigned - Contact B ID + Contact B true id of the second contact 1.1 @@ -52,10 +52,10 @@ relationship_type_id int unsigned - Relationship Type ID + Relationship Type true id of the relationship - 1.1 + 1.1 relationship_type_id @@ -115,7 +115,7 @@ case_id int unsigned - Relationship Case ID + Relationship Case NULL FK to civicrm_case 2.2 diff --git a/xml/schema/Contact/RelationshipType.xml b/xml/schema/Contact/RelationshipType.xml index 08280f652f..1416a1da88 100644 --- a/xml/schema/Contact/RelationshipType.xml +++ b/xml/schema/Contact/RelationshipType.xml @@ -95,7 +95,7 @@ If defined, contact_sub_type_a in a relationship of this type must be a specific contact_sub_type. 3.1 - Multi-Select + Select @@ -106,7 +106,7 @@ If defined, contact_sub_type_b in a relationship of this type must be a specific contact_sub_type. 3.1 - Multi-Select + Select -- 2.25.1