From: Sudha Bisht Date: Mon, 18 May 2015 09:40:29 +0000 (+0530) Subject: Fix for pledge api X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d4e614adeced5cccacf2651cfd8258eed456e22b;p=civicrm-core.git Fix for pledge api --- diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 51a0a6d47d..cd52b7d4c7 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -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; } }