/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* @return array
*/
- static function &getFields() {
+ public static function &getFields() {
$fields = CRM_Pledge_BAO_Pledge::exportableFields();
return $fields;
}
/**
- * build select for Pledge
+ * Build select for Pledge
*
* @param $query
*
* @return void
- * @access public
*/
- static function select(&$query) {
+ public static function select(&$query) {
if (($query->_mode & CRM_Contact_BAO_Query::MODE_PLEDGE) || !empty($query->_returnProperties['pledge_id'])) {
$query->_select['pledge_id'] = 'civicrm_pledge.id as pledge_id';
$query->_element['pledge_id'] = 1;
}
if (!empty($query->_returnProperties['pledge_financial_type'])) {
- $query->_select['pledge_financial_type'] = "(SELECT civicrm_financial_type.name FROM civicrm_financial_type WHERE civicrm_financial_type.id = civicrm_pledge.financial_type_id) as pledge_financial_type";
+ $query->_select['pledge_financial_type'] = "(SELECT civicrm_financial_type.name FROM civicrm_financial_type WHERE civicrm_financial_type.id = civicrm_pledge.financial_type_id) as pledge_financial_type";
$query->_element['pledge_financial_type'] = 1;
$query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
}
/**
* @param $query
*/
- static function where(&$query) {
+ public static function where(&$query) {
$grouping = NULL;
foreach (array_keys($query->_params) as $id) {
if (empty($query->_params[$id][0])) {
* @param $values
* @param $query
*/
- static function whereClauseSingle(&$values, &$query) {
+ public static function whereClauseSingle(&$values, &$query) {
list($name, $op, $value, $grouping, $wildcard) = $values;
switch ($name) {
}
}
else {
- if (!empty($value) ) {
+ if (!empty($value)) {
$names[] = $statusValues[$value];
}
}
}
}
else {
- if (!empty($value) ) {
+ if (!empty($value)) {
$names[] = $statusValues[$value];
}
}
$value,
'Integer'
);
- $query->_qill[$grouping][] = ts( 'Financial Type - %1', array( 1 => $type ) );
+ $query->_qill[$grouping][] = ts('Financial Type - %1', array(1 => $type));
$query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
return;
return;
case 'pledge_id':
- $query->_where[$grouping][] = "civicrm_pledge.id $op $value";
+ $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_pledge.id",
+ $op,
+ $value,
+ "Integer"
+ );
$query->_tables['civicrm_pledge'] = $query->_whereTables['civicrm_pledge'] = 1;
return;
}
/**
- * @param $name
+ * @param string $name
* @param $mode
* @param $side
*
* @return null|string
*/
- static function from($name, $mode, $side) {
+ public static function from($name, $mode, $side) {
$from = NULL;
switch ($name) {
break;
case 'pledge_financial_type':
- $from .= " $side JOIN civicrm_financial_type ON civicrm_pledge.financial_type_id = civicrm_financial_type.id ";
+ $from .= " $side JOIN civicrm_financial_type ON civicrm_pledge.financial_type_id = civicrm_financial_type.id ";
break;
case 'civicrm_pledge_payment':
}
/**
- * getter for the qill object
+ * Getter for the qill object
*
* @return string
- * @access public
*/
- function qill() {
+ public function qill() {
return (isset($this->_qill)) ? $this->_qill : "";
}
/**
* Ideally this function should include fields that are displayed in the selector
*/
- static function defaultReturnProperties($mode,
+ static function defaultReturnProperties(
+ $mode,
$includeCustomFields = TRUE
) {
$properties = NULL;
/**
* This includes any extra fields that might need for export etc
*/
- static function extraReturnProperties($mode) {
+ public static function extraReturnProperties($mode) {
$properties = NULL;
if ($mode & CRM_Contact_BAO_Query::MODE_PLEDGE) {
}
/**
- * @param $form
+ * @param CRM_Core_Form $form
*/
- static function buildSearchForm(&$form) {
+ public static function buildSearchForm(&$form) {
// pledge related dates
CRM_Core_Form_Date::buildDateRange($form, 'pledge_start_date', 1, '_low', '_high', ts('From'), FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'pledge_end_date', 1, '_low', '_high', ts('From'), FALSE);
$form->addGroup($paymentStatus, 'pledge_payment_status_id', ts('Pledge Payment Status'));
$form->add('select', 'pledge_financial_type_id',
- ts( 'Financial Type' ),
+ ts('Financial Type'),
array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(),
FALSE, array('class' => 'crm-select2')
);
/**
* @param $row
- * @param $id
+ * @param int $id
*/
- static function searchAction(&$row, $id) {}
+ public static function searchAction(&$row, $id) {
+ }
/**
* @param $tables
*/
- static function tableNames(&$tables) {
+ public static function tableNames(&$tables) {
//add status table
if (!empty($tables['pledge_status']) || !empty($tables['civicrm_pledge_payment'])) {
$tables = array_merge(array('civicrm_pledge' => 1), $tables);
}
}
}
-