From a9315b5eb094563fb3f3087d678f25b16cfc1419 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Wed, 7 May 2014 11:31:55 -0400 Subject: [PATCH] CRM-14656 - Add contact ID A and B and relationship ID to Relationship report, and some field title cleanup for consistency. ---------------------------------------- * CRM-14656: https://issues.civicrm.org/jira/browse/CRM-14656 --- CRM/Report/Form/Contact/Relationship.php | 26 ++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index 0749f619d7..cf255964a7 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -130,7 +130,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'fields' => array( 'email_a' => - array('title' => ts('Email of Contact A'), + array('title' => ts('Email (Contact A)'), 'name' => 'email', ), ), @@ -143,7 +143,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'fields' => array( 'email_b' => - array('title' => ts('Email of Contact B'), + array('title' => ts('Email (Contact B)'), 'name' => 'email', ), ), @@ -157,12 +157,12 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { array( 'phone_a' => array( - 'title' => ts('Phone of Contact A'), + 'title' => ts('Phone (Contact A)'), 'name' => 'phone', ), 'phone_ext_a' => array( - 'title' => ts('Phone Extension of Contact A'), + 'title' => ts('Phone Ext (Contact A)'), 'name' => 'phone_ext', ), ), @@ -176,12 +176,12 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { array( 'phone_b' => array( - 'title' => ts('Phone of Contact B'), + 'title' => ts('Phone (Contact B)'), 'name' => 'phone' ), 'phone_ext_b' => array( - 'title' => ts('Phone Extension of Contact B'), + 'title' => ts('Phone Ext (Contact B)'), 'name' => 'phone_ext' ), ), @@ -232,6 +232,11 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'description' => array('title' => ts('Description'), ), + 'relationship_id' => + array( + 'title' => ts('Rel ID'), + 'name' => 'id', + ), ), 'filters' => array( @@ -615,6 +620,7 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_id'], $this->_absoluteUrl, $this->_id, $this->_drilldownReport ); + $rows[$rowNum]['civicrm_contact_sort_name_a'] = $rows[$rowNum]['civicrm_contact_sort_name_a'] . ' (' . $rows[$rowNum]['civicrm_contact_id'] . ')'; $rows[$rowNum]['civicrm_contact_sort_name_a_link'] = $url; $rows[$rowNum]['civicrm_contact_sort_name_a_hover'] = ts("View Contact details for this contact."); $entryFound = TRUE; @@ -627,11 +633,19 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'reset=1&force=1&id_op=eq&id_value=' . $row['civicrm_contact_b_id'], $this->_absoluteUrl, $this->_id, $this->_drilldownReport ); + $rows[$rowNum]['civicrm_contact_b_sort_name_b'] = $rows[$rowNum]['civicrm_contact_b_sort_name_b'] . ' (' . $rows[$rowNum]['civicrm_contact_b_id'] . ')'; $rows[$rowNum]['civicrm_contact_b_sort_name_b_link'] = $url; $rows[$rowNum]['civicrm_contact_b_sort_name_b_hover'] = ts("View Contact details for this contact."); $entryFound = TRUE; } + if (array_key_exists('civicrm_relationship_relationship_id', $row) && array_key_exists('civicrm_contact_id', $row)) { + $url = "/civicrm/contact/view/rel?reset=1&action=update&rtype=a_b&cid=" . $row['civicrm_contact_id'] . "&id=" . $row['civicrm_relationship_relationship_id']; + $rows[$rowNum]['civicrm_relationship_relationship_id_link'] = $url; + $rows[$rowNum]['civicrm_relationship_relationship_id_hover'] = ts("Edit this relationship."); + $entryFound = TRUE; + } + // skip looking further in rows, if first row itself doesn't // have the column we need if (!$entryFound) { -- 2.25.1