From 83abdecd1f05f4d2c6a5f943b8ae2afccb830858 Mon Sep 17 00:00:00 2001 From: "Donald A. Lobo" Date: Mon, 3 Jun 2013 13:47:06 -0700 Subject: [PATCH] misc fixes while testing ofc and wkhtml --- CRM/Report/Form.php | 2 ++ CRM/Report/Form/Contribute/Summary.php | 39 +++++++++++++------------- CRM/Utils/OpenFlashChart.php | 2 +- api/v3/utils.php | 5 ++-- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 296afcd100..51a3da3833 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -161,6 +161,8 @@ class CRM_Report_Form extends CRM_Core_Form { public $_drilldownReport = array(); + protected $_grandFlag = FALSE; + /** * An attribute for checkbox/radio form field layout * diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index 9543fa7041..9ac733ee67 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -43,7 +43,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { 'pieChart' => 'Pie Chart', ); protected $_customGroupExtends = array('Contribution'); - protected $_customGroupGroupBy = TRUE; + protected $_customGroupGroupBy = TRUE; public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report'); @@ -109,11 +109,11 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { ), 'civicrm_financial_type' => array('dao' => 'CRM_Financial_DAO_FinancialType', - 'fields' => array('financial_type' => null,), + 'fields' => array('financial_type' => null,), 'grouping' => 'contri-fields', - 'group_bys' => array( - 'financial_type' => array('title' => ts('Financial Type')), - ), + 'group_bys' => array( + 'financial_type' => array('title' => ts('Financial Type')), + ), ), 'civicrm_contribution' => array( @@ -121,8 +121,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { //'bao' => 'CRM_Contribute_BAO_Contribution', 'fields' => array( - 'contribution_source' => array('title' => ts('Source'), - ), + 'contribution_source' => array('title' => ts('Source'), ), 'currency' => array('required' => TRUE, 'no_display' => TRUE, @@ -158,7 +157,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { 'type' => CRM_Utils_Type::T_STRING, ), 'financial_type_id' => - array('title' => ts('Financial Type'), + array('title' => ts('Financial Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::financialType(), 'type' => CRM_Utils_Type::T_INT, @@ -375,24 +374,24 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { function from() { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} - INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} + INNER JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_contribution']}.contact_id AND {$this->_aliases['civicrm_contribution']}.is_test = 0 - LEFT JOIN civicrm_financial_type {$this->_aliases['civicrm_financial_type']} + LEFT JOIN civicrm_financial_type {$this->_aliases['civicrm_financial_type']} ON {$this->_aliases['civicrm_contribution']}.financial_type_id ={$this->_aliases['civicrm_financial_type']}.id - LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']} - ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND - {$this->_aliases['civicrm_email']}.is_primary = 1) - - LEFT JOIN civicrm_phone {$this->_aliases['civicrm_phone']} - ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND + LEFT JOIN civicrm_email {$this->_aliases['civicrm_email']} + ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_email']}.contact_id AND + {$this->_aliases['civicrm_email']}.is_primary = 1) + + LEFT JOIN civicrm_phone {$this->_aliases['civicrm_phone']} + ON ({$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_phone']}.contact_id AND {$this->_aliases['civicrm_phone']}.is_primary = 1)"; if ($this->_addressField) { $this->_from .= " - LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} - ON {$this->_aliases['civicrm_contact']}.id = - {$this->_aliases['civicrm_address']}.contact_id AND + LEFT JOIN civicrm_address {$this->_aliases['civicrm_address']} + ON {$this->_aliases['civicrm_contact']}.id = + {$this->_aliases['civicrm_address']}.contact_id AND {$this->_aliases['civicrm_address']}.is_primary = 1\n"; } } @@ -451,7 +450,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { $select = " SELECT COUNT({$this->_aliases['civicrm_contribution']}.total_amount ) as count, SUM({$this->_aliases['civicrm_contribution']}.total_amount ) as amount, - ROUND(AVG({$this->_aliases['civicrm_contribution']}.total_amount), 2) as avg, {$this->_aliases['civicrm_contribution']}.currency as currency + ROUND(AVG({$this->_aliases['civicrm_contribution']}.total_amount), 2) as avg, {$this->_aliases['civicrm_contribution']}.currency as currency "; $group = "\nGROUP BY {$this->_aliases['civicrm_contribution']}.currency"; $sql = "{$select} {$this->_from} {$this->_where}{$group}"; diff --git a/CRM/Utils/OpenFlashChart.php b/CRM/Utils/OpenFlashChart.php index 344d613997..5147c54d50 100644 --- a/CRM/Utils/OpenFlashChart.php +++ b/CRM/Utils/OpenFlashChart.php @@ -473,7 +473,7 @@ class CRM_Utils_OpenFlashChart { return self::buildChart($chartData, $chart); } - function buildChart(&$params, $chart) { + static function buildChart(&$params, $chart) { $openFlashChart = array(); if ($chart && is_array($params) && !empty($params)) { // build the chart objects. diff --git a/api/v3/utils.php b/api/v3/utils.php index bc50e3cc28..5fa2be30b9 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -1086,11 +1086,12 @@ function _civicrm_api3_validate_fields($entity, $action, &$params, $errorMode = //field is of type date or datetime _civicrm_api3_validate_date($params, $fieldname, $fieldInfo); break; - case 32://blob + + case 32://blob _civicrm_api3_validate_html($params, $fieldname, $fieldInfo); break; - case CRM_Utils_Type::T_STRING: + case CRM_Utils_Type::T_STRING: _civicrm_api3_validate_string($params, $fieldname, $fieldInfo); break; -- 2.25.1