Fix for pledge api
authorSudha Bisht <sudha.bisht@webaccessglobal.com>
Mon, 18 May 2015 09:40:29 +0000 (15:10 +0530)
committerSudha Bisht <sudha.bisht@webaccessglobal.com>
Mon, 18 May 2015 09:40:29 +0000 (15:10 +0530)
CRM/Pledge/BAO/Query.php

index 51a0a6d47d1b963acd8f491a5a1bf189742c252c..cd52b7d4c71f91c3aae2a0ddff83b698482d783f 100644 (file)
@@ -416,6 +416,14 @@ class CRM_Pledge_BAO_Query {
         );
         CRM_Campaign_BAO_Query::componentSearchClause($campParams, $query);
         return;
+
+      case 'pledge_contact_id':
+        $name = str_replace('pledge_', '', $name);
+        $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_pledge.$name", $op, $value, 'Integer');
+        list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Pledge_DAO_Pledge', $name, $value, $op);
+        $query->_qill[$grouping][] = ts('Contact ID %1 %2', array(1 => $op, 2 => $value));
+        $query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
+        return;
     }
   }