X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FPledge%2FBAO%2FQuery.php;h=273e59e4659b8b42c56183992318e37a409100d4;hb=2711fdbed19fb755e2e478b733904a2bbf926c79;hp=45817bcda5d25df3856f47fb462ca8b411b7238d;hpb=3b16a28270778af5122d850f6a4ee7400b8f9920;p=civicrm-core.git diff --git a/CRM/Pledge/BAO/Query.php b/CRM/Pledge/BAO/Query.php index 45817bcda5..273e59e465 100644 --- a/CRM/Pledge/BAO/Query.php +++ b/CRM/Pledge/BAO/Query.php @@ -2,7 +2,7 @@ /* +--------------------------------------------------------------------+ - | CiviCRM version 4.5 | + | CiviCRM version 4.6 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ @@ -37,7 +37,7 @@ class CRM_Pledge_BAO_Query { /** * @return array */ - static function &getFields() { + public static function &getFields() { $fields = CRM_Pledge_BAO_Pledge::exportableFields(); return $fields; } @@ -48,9 +48,8 @@ class CRM_Pledge_BAO_Query { * @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; @@ -103,7 +102,7 @@ class CRM_Pledge_BAO_Query { } 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; } @@ -204,7 +203,7 @@ class CRM_Pledge_BAO_Query { /** * @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])) { @@ -224,7 +223,7 @@ class CRM_Pledge_BAO_Query { * @param $values * @param $query */ - static function whereClauseSingle(&$values, &$query) { + public static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; switch ($name) { @@ -295,7 +294,7 @@ class CRM_Pledge_BAO_Query { } } else { - if (!empty($value) ) { + if (!empty($value)) { $names[] = $statusValues[$value]; } } @@ -337,7 +336,7 @@ class CRM_Pledge_BAO_Query { } } else { - if (!empty($value) ) { + if (!empty($value)) { $names[] = $statusValues[$value]; } } @@ -374,7 +373,7 @@ class CRM_Pledge_BAO_Query { $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; @@ -427,7 +426,7 @@ class CRM_Pledge_BAO_Query { * * @return null|string */ - static function from($name, $mode, $side) { + public static function from($name, $mode, $side) { $from = NULL; switch ($name) { @@ -441,7 +440,7 @@ class CRM_Pledge_BAO_Query { 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': @@ -465,16 +464,16 @@ class CRM_Pledge_BAO_Query { * 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; @@ -508,7 +507,7 @@ class CRM_Pledge_BAO_Query { /** * 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) { @@ -539,7 +538,7 @@ class CRM_Pledge_BAO_Query { /** * @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); @@ -576,7 +575,7 @@ class CRM_Pledge_BAO_Query { $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') ); @@ -628,16 +627,16 @@ class CRM_Pledge_BAO_Query { * @param $row * @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); } } } -