Notice Fixes on Contribution Reports
authoratif-shaikh <shaikh388@gmail.com>
Mon, 25 Aug 2014 10:38:27 +0000 (16:08 +0530)
committeratif-shaikh <shaikh388@gmail.com>
Mon, 25 Aug 2014 10:38:27 +0000 (16:08 +0530)
CRM/Report/Form/Contribute/History.php
CRM/Report/Form/Contribute/OrganizationSummary.php

index 37a0e4e63e8db2158b8aa6610c13421de5a29812..284fe1204eb3c89dff6ba573083fa64e8145dfa3 100644 (file)
@@ -501,11 +501,12 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
     $this->customDataFrom();
     $this->groupBy();
 
+    $sql = NULL;
     $rows = array();
 
     // build array of result based on column headers. This method also allows
     // modifying column headers before using it to build result set i.e $rows.
-    $this->buildRows($rows);
+    $this->buildRows($sql, $rows);
 
     // format result set.
     $this->formatDisplay($rows, FALSE);
@@ -529,7 +530,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form {
   /**
    * @param $rows
    */
-  function buildRows(&$rows) {
+  function buildRows($sql, &$rows) {
     $contactIds = array();
 
     $addWhere = '';
index 8e3463896a4720fc6129771596525a33a0d73391..7159cd9d96dbd6c0c246c533555356a8f4adecfb 100644 (file)
@@ -351,7 +351,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form {
     //hack filter display for relationship type
     $type = substr($this->_params['relationship_type_id_value'], -3);
     foreach ($statistics['filters'] as $id => $value) {
-      if ($value['title'] == 'Relationship Type') {
+      if ($value['title'] == 'Relationship Type' && !empty($id)) {
         $statistics['filters'][$id]['value'] = 'Is equal to ' . $this->relationTypes[$this->relationshipId . '_' . $type];
       }
     }
@@ -387,7 +387,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form {
     $this->relationTypes = $relationTypes = array();
 
     $params = array('contact_type_b' => 'Organization', 'version' => 3);
-    $typesA = &civicrm_api('relationship_type', 'get', $params);
+    $typesA = civicrm_api('relationship_type', 'get', $params);
 
     if (empty($typesA['is_error'])) {
       foreach ($typesA['values'] as $rel) {
@@ -396,7 +396,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form {
     }
 
     $params = array('contact_type_a' => 'Organization', 'version' => 3);
-    $typesB = &civicrm_api('relationship_type', 'get', $params);
+    $typesB = civicrm_api('relationship_type', 'get', $params);
 
     if (empty($typesB['is_error'])) {
       foreach ($typesB['values'] as $rel) {