X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FRelationship.php;h=15c4dc0d4a02492ed63b1c4f829abee876b7cc22;hb=83562390030fc9e97c5df95a87476e15986974ea;hp=e963c3d1789f679fe17e6364a46015e9d98292b7;hpb=78f3c126ef6dbbd6d672213163b1c71067955786;p=civicrm-core.git diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index e963c3d178..15c4dc0d4a 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -261,7 +261,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { $relationship->free(); - CRM_Utils_Hook::post($hook, 'Relationship', $relationshipId, $relationship); + CRM_Utils_Hook::post($hook, 'Relationship', $relationship->id, $relationship); return $relationship; } @@ -491,7 +491,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { $relationship->delete(); CRM_Core_Session::setStatus(ts('Selected relationship has been deleted successfully.'), ts('Record Deleted'), 'success'); - CRM_Utils_Hook::post('delete', 'Relationship', $relationship->id, $relationship); + CRM_Utils_Hook::post('delete', 'Relationship', $id, $relationship); // delete the recently created Relationship $relationshipRecent = array( @@ -846,9 +846,9 @@ WHERE relationship_type_id = " . CRM_Utils_Type::escape($type, 'Integer'); civicrm_state_province.abbreviation as state, civicrm_country.name as country, civicrm_email.email as email, + civicrm_contact.contact_type as contact_type, civicrm_phone.phone as phone, civicrm_contact.id as civicrm_contact_id, - civicrm_contact.contact_type as contact_type, civicrm_relationship.contact_id_b as contact_id_b, civicrm_relationship.contact_id_a as contact_id_a, civicrm_relationship_type.id as civicrm_relationship_type_id, @@ -1054,6 +1054,7 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) $values[$rid]['cid'] = $cid; $values[$rid]['contact_id_a'] = $relationship->contact_id_a; $values[$rid]['contact_id_b'] = $relationship->contact_id_b; + $values[$rid]['contact_type'] = $relationship->contact_type; $values[$rid]['relationship_type_id'] = $relationship->civicrm_relationship_type_id; $values[$rid]['relation'] = $relationship->relation; $values[$rid]['name'] = $relationship->sort_name; @@ -1705,7 +1706,12 @@ AND cc.sort_name LIKE '%$name%'"; // format params foreach ($relationships as $relationshipId => $values) { - $contactRelationships[$relationshipId]['name'] = CRM_Utils_System::href( + //Add image icon for related contacts: CRM-14919 + $icon = CRM_Contact_BAO_Contact_Utils::getImage($values['contact_type'], + FALSE, + $values['cid'] + ); + $contactRelationships[$relationshipId]['name'] = $icon.' '.CRM_Utils_System::href( $values['name'], 'civicrm/contact/view', "reset=1&cid={$values['cid']}");