CRM-13833 - Add contact summary link to soft credit contacts in Soft Credit report.
authorDave Greenberg <dave@civicrm.org>
Mon, 3 Feb 2014 03:24:35 +0000 (19:24 -0800)
committerDave Greenberg <dave@civicrm.org>
Mon, 3 Feb 2014 03:24:35 +0000 (19:24 -0800)
----------------------------------------
* CRM-13833: Implement Soft Credit Types
  http://issues.civicrm.org/jira/browse/CRM-13833

CRM/Report/Form/Contribute/SoftCredit.php

index e0c6c853c92dae1139e1d80a23cfce4b7fd6ff9b..af128b94541b77a6fea9a0a03d73c0de63b8068c 100644 (file)
@@ -506,6 +506,18 @@ GROUP BY   {$this->_aliases['civicrm_contribution']}.currency
         $entryFound = TRUE;
       }
 
+      // convert soft credit contact name to link
+      if (array_key_exists('civicrm_contact_display_name_creditor', $row) && !empty($rows[$rowNum]['civicrm_contact_display_name_creditor']) &&
+        array_key_exists('civicrm_contact_id_creditor', $row)
+      ) {
+        $url = CRM_Utils_System::url("civicrm/contact/view",
+          'reset=1&cid=' . $row['civicrm_contact_id_creditor'],
+          $this->_absoluteUrl
+        );
+        $rows[$rowNum]['civicrm_contact_display_name_creditor_link'] = $url;
+        $rows[$rowNum]['civicrm_contact_display_name_creditor_hover'] = ts("view contact summary");
+      }
+
       // make subtotals look nicer
       if (array_key_exists('civicrm_contact_id_constituent', $row) &&
         !$row['civicrm_contact_id_constituent']