CRM-13810 - Display campaign name on search builder
authorColeman Watts <coleman@civicrm.org>
Wed, 15 Jan 2014 04:09:08 +0000 (20:09 -0800)
committerColeman Watts <coleman@civicrm.org>
Wed, 15 Jan 2014 04:09:08 +0000 (20:09 -0800)
CRM/Campaign/BAO/Query.php
CRM/Contribute/BAO/Contribution.php

index bfbb6980e246370b4ffffca3fa381e4b0fb3f5ef..177a7f61bd6334055f4a1ba26fb38e12079f3a60 100755 (executable)
@@ -85,6 +85,19 @@ class CRM_Campaign_BAO_Query {
         }
       }
     }
+    // CRM-13810 Translate campaign_id to label for search builder
+    if (is_array($query->_select)) {
+      foreach($query->_select as $field => $queryString) {
+        if (substr($field, -11) == 'campaign_id') {
+          $query->_pseudoConstantsSelect[$field] = array(
+            'pseudoField' => 'campaign_id',
+            'idCol' => $field,
+            'bao' => 'CRM_Activity_BAO_Activity',
+          );
+        }
+      }
+    }
+
 
     //get survey clause in force,
     //only when we have survey id.
index d276d481b4745296d7d62cb064a184a80279c2aa..f61917da9ee9f6c60086e28a54b744c38415571c 100644 (file)
@@ -581,12 +581,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
         ));
 
       $extraFields = array(
-        'contribution_campaign' =>
-        array(
-          'title' => ts('Campaign Title')
-        ),
-        'contribution_batch' =>
-        array(
+        'contribution_batch' => array(
           'title' => ts('Batch Name')
         )
       );