| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2014
* $Id$
- *
*/
class CRM_Contribute_BAO_Query {
/**
- * Static field for all the export/import contribution fields
+ * Static field for all the export/import contribution fields.
*
* @var array
- * @static
*/
static $_contributionFields = NULL;
*
* @return array
* self::$_contributionFields associative array of contribution fields
- * @static
*/
public static function &getFields() {
if (!self::$_contributionFields) {
}
/**
- * If contributions are involved, add the specific contribute fields
+ * If contributions are involved, add the specific contribute fields.
*
* @param $query
*
// get payment instrument id
if (!empty($query->_returnProperties['payment_instrument_id'])) {
- $query->_select['instrument_id'] = "contribution_payment_instrument.value as instrument_id";
+ $query->_select['instrument_id'] = "contribution_payment_instrument.value as instrument_id";
$query->_select['payment_instrument_id'] = "contribution_payment_instrument.value as payment_instrument_id";
$query->_element['instrument_id'] = $query->_element['payment_instrument_id'] = 1;
$query->_tables['civicrm_contribution'] = 1;
case 'financial_type':
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($fields[$name]['where'], $op, $value, 'String');
- CRM_Core_Error::debug( '$query', $query->_where[$grouping] );
list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contribute_DAO_Contribution', $name, $value, $op);
$query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$name]['title'], 2 => $op, 3 => $value));
$query->_tables['civicrm_contribution'] = $query->_whereTables['civicrm_contribution'] = 1;
}
/**
- * Add all the elements shared between contribute search and advnaced search
+ * Add all the elements shared between contribute search and advnaced search.
*
*
* @param CRM_Core_Form $form
*
* @return void
- * @static
*/
public static function buildSearchForm(&$form) {
$form->add('select', 'contribution_currency_type',
ts('Currency Type'),
array(
- '' => ts('- any -')
+ '' => ts('- any -'),
) +
CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')),
FALSE, array('class' => 'crm-select2')
$form->add('select', 'contribution_page_id',
ts('Contribution Page'),
array(
- '' => ts('- any -')
+ '' => ts('- any -'),
) +
CRM_Contribute_PseudoConstant::contributionPage(),
FALSE, array('class' => 'crm-select2')
$form->add('select', 'contribution_pcp_made_through_id',
ts('Personal Campaign Page'),
array(
- '' => ts('- any -')
+ '' => ts('- any -'),
) +
CRM_Contribute_PseudoConstant::pcPage(),
FALSE, array('class' => 'crm-select2')
}
/**
- * Add the where for dates
+ * Add the where for dates.
*
* @param array $values
* Array of query values.
public static function buildDateWhere(&$values, $query, $name, $field, $title) {
$fieldPart = strpos($name, $field);
if ($fieldPart === FALSE) {
- return;
+ return NULL;
}
// we only have recurring dates using this ATM so lets' short cut to find the table name
$table = 'contribution_recur';
'contribution_recur_failure_retry_date' => ts('Failed Recurring Contribution Retry Date'),
);
}
+
}