From 316bcb72faecd92ae4f84430701cc494874218e3 Mon Sep 17 00:00:00 2001 From: yashodha Date: Mon, 8 Oct 2018 17:11:04 +0530 Subject: [PATCH] expose current employer in fields and display in results as well --- CRM/Report/Form.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 9b5027e373..7bc88b8e6d 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -4499,6 +4499,18 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a $entryFound = TRUE; } } + + // Handle employer id + if (array_key_exists('civicrm_contact_employer_id', $row)) { + $employerId = $row['civicrm_contact_employer_id']; + if ($employerId) { + $rows[$rowNum]['civicrm_contact_employer_id'] = CRM_Contact_BAO_Contact::displayName($employerId); + $rows[$rowNum]['civicrm_contact_employer_id_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $employerId, $this->_absoluteUrl); + $rows[$rowNum]['civicrm_contact_employer_id_hover'] = ts('View Contact Summary for Employer.'); + $entryFound = TRUE; + } + } + return $entryFound; } @@ -4766,6 +4778,9 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a 'is_opt_out' => array(), 'is_deceased' => array(), 'preferred_language' => array(), + 'employer_id' => array( + 'title' => ts('Current Employer'), + ), ); } -- 2.25.1