From: Tim Otten Date: Tue, 6 Jan 2015 21:21:23 +0000 (-0800) Subject: INFRA-132 - CRM/Report - phpcbf X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=841781205ef7c0c2656fc1c77bf6d739a4bc440a;p=civicrm-core.git INFRA-132 - CRM/Report - phpcbf --- diff --git a/CRM/Report/Form/Campaign/SurveyDetails.php b/CRM/Report/Form/Campaign/SurveyDetails.php index a64f713398..f070f017c6 100644 --- a/CRM/Report/Form/Campaign/SurveyDetails.php +++ b/CRM/Report/Form/Campaign/SurveyDetails.php @@ -622,7 +622,6 @@ INNER JOIN civicrm_option_value val ON ( val.option_group_id = survey.result_id //format the survey response data. $this->_formatSurveyResponseData($rows); - // custom code to alter rows $entryFound = FALSE; foreach ($rows as $rowNum => $row) { @@ -655,7 +654,6 @@ INNER JOIN civicrm_option_value val ON ( val.option_group_id = survey.result_id $entryFound = TRUE; } - if (array_key_exists('civicrm_activity_contact_contact_id', $row)) { $rows[$rowNum]['civicrm_activity_contact_contact_id'] = CRM_Utils_Array::value($row['civicrm_activity_contact_contact_id'], CRM_Campaign_BAO_Survey::getInterviewers() @@ -663,7 +661,6 @@ INNER JOIN civicrm_option_value val ON ( val.option_group_id = survey.result_id $entryFound = TRUE; } - if (array_key_exists('civicrm_activity_survey_id', $row)) { $rows[$rowNum]['civicrm_activity_survey_id'] = CRM_Utils_Array::value($row['civicrm_activity_survey_id'], CRM_Campaign_BAO_Survey::getSurveys() @@ -961,8 +958,7 @@ INNER JOIN civicrm_custom_field cf ON ( cg.id = cf.custom_group_id ) 'dataType' => $response->data_type, 'htmlType' => $response->html_type, 'required' => TRUE, - 'alias' => ($response->data_type == 'ContactReference') ? - $this->_columns[$resTable]['alias'] . + 'alias' => ($response->data_type == 'ContactReference') ? $this->_columns[$resTable]['alias'] . '_contact' : $this->_columns[$resTable]['alias'], 'dbAlias' => $this->_columns[$resTable]['alias'] . '.' . $response->column_name, diff --git a/CRM/Report/Form/Case/Demographics.php b/CRM/Report/Form/Case/Demographics.php index fce44d3d0c..7abdc9b789 100644 --- a/CRM/Report/Form/Case/Demographics.php +++ b/CRM/Report/Form/Case/Demographics.php @@ -128,7 +128,7 @@ class CRM_Report_Form_Case_Demographics extends CRM_Report_Form { 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince( ), ), ), -*/ + */ ), 'civicrm_phone' => array( 'dao' => 'CRM_Core_DAO_Phone', diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php index 932b03d016..2b02d2b133 100644 --- a/CRM/Report/Form/Case/Detail.php +++ b/CRM/Report/Form/Case/Detail.php @@ -479,8 +479,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { foreach ($statistics['filters'] as $id => $value) { if ($value['title'] == 'Case Type') { $statistics['filters'][$id]['value'] = 'Is ' . - $this->case_types[substr($statistics['filters'][$id] - ['value'], -3, -2 + $this->case_types[substr($statistics['filters'][$id]['value'], -3, -2 )]; } } diff --git a/CRM/Report/Form/Case/Summary.php b/CRM/Report/Form/Case/Summary.php index 787ab4d8bf..4d40101c9a 100644 --- a/CRM/Report/Form/Case/Summary.php +++ b/CRM/Report/Form/Case/Summary.php @@ -278,8 +278,7 @@ inner join civicrm_contact $c2 on ${c2}.id=${ccc}.contact_id if (array_key_exists('filters', $table)) { foreach ($table['filters'] as $fieldName => $field) { $clause = NULL; - if (CRM_Utils_Array::value("operatorType", $field) & - CRM_Report_Form::OP_DATE + if (CRM_Utils_Array::value("operatorType", $field) & CRM_Report_Form::OP_DATE ) { $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); diff --git a/CRM/Report/Form/Case/TimeSpent.php b/CRM/Report/Form/Case/TimeSpent.php index 7881af631d..584673a5cf 100644 --- a/CRM/Report/Form/Case/TimeSpent.php +++ b/CRM/Report/Form/Case/TimeSpent.php @@ -101,7 +101,7 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { ), ), 'filters' => array( - 'activity_date_time' => //'default' => 'this.month', + 'activity_date_time' => //'default' => 'this.month', array( 'operatorType' => CRM_Report_Form::OP_DATE, ), diff --git a/CRM/Report/Form/Contact/CurrentEmployer.php b/CRM/Report/Form/Contact/CurrentEmployer.php index 85e4d9e36b..22c6f2a57e 100644 --- a/CRM/Report/Form/Contact/CurrentEmployer.php +++ b/CRM/Report/Form/Contact/CurrentEmployer.php @@ -249,8 +249,7 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} if (array_key_exists('filters', $table)) { foreach ($table['filters'] as $fieldName => $field) { $clause = NULL; - if (CRM_Utils_Array::value('operatorType', $field) & - CRM_Report_Form::OP_DATE + if (CRM_Utils_Array::value('operatorType', $field) & CRM_Report_Form::OP_DATE ) { $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); diff --git a/CRM/Report/Form/Contact/Detail.php b/CRM/Report/Form/Contact/Detail.php index 9cdfe075fc..fb04d5da78 100644 --- a/CRM/Report/Form/Contact/Detail.php +++ b/CRM/Report/Form/Contact/Detail.php @@ -545,8 +545,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { if (array_key_exists('filters', $table)) { foreach ($table['filters'] as $fieldName => $field) { $clause = NULL; - if (CRM_Utils_Array::value('operatorType', $field) & - CRM_Report_Form::OP_DATE + if (CRM_Utils_Array::value('operatorType', $field) & CRM_Report_Form::OP_DATE ) { $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); @@ -842,7 +841,6 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { $entryFound = TRUE; } - // skip looking further in rows, if first row itself doesn't // have the column we need if (!$entryFound) { diff --git a/CRM/Report/Form/Contact/Log.php b/CRM/Report/Form/Contact/Log.php index a2be5ecebb..59b0d85163 100644 --- a/CRM/Report/Form/Contact/Log.php +++ b/CRM/Report/Form/Contact/Log.php @@ -201,8 +201,7 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { if (array_key_exists('filters', $table)) { foreach ($table['filters'] as $fieldName => $field) { $clause = NULL; - if (CRM_Utils_Array::value('operatorType', $field) & - CRM_Report_Form::OP_DATE + if (CRM_Utils_Array::value('operatorType', $field) & CRM_Report_Form::OP_DATE ) { $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); diff --git a/CRM/Report/Form/Contact/LoggingSummary.php b/CRM/Report/Form/Contact/LoggingSummary.php index 65cb0af61f..5cde591ab1 100644 --- a/CRM/Report/Form/Contact/LoggingSummary.php +++ b/CRM/Report/Form/Contact/LoggingSummary.php @@ -40,7 +40,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { parent::__construct(); $logTypes = array(); - foreach ( array_keys($this->_logTables) as $table ) { + foreach ( array_keys($this->_logTables) as $table ) { $type = $this->getLogType($table); $logTypes[$type] = $type; } @@ -177,8 +177,9 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_altered_contact_id']); $row['log_civicrm_entity_altered_contact_hover'] = ts("Go to contact summary"); $entity = $this->getEntityValue($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_type'], $row['log_civicrm_entity_log_date']); - if ($entity) + if ($entity) { $row['log_civicrm_entity_altered_contact'] = $row['log_civicrm_entity_altered_contact'] . " [{$entity}]"; + } } $row['altered_by_contact_display_name_link'] = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $row['log_civicrm_entity_log_user_id']); $row['altered_by_contact_display_name_hover'] = ts("Go to contact summary"); @@ -195,8 +196,9 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { if ($newAction = $this->getEntityAction($row['log_civicrm_entity_id'], $row['log_civicrm_entity_log_conn_id'], $row['log_civicrm_entity_log_type'], - CRM_Utils_Array::value('log_civicrm_entity_log_action', $row))) + CRM_Utils_Array::value('log_civicrm_entity_log_action', $row))) { $row['log_civicrm_entity_log_action'] = $newAction; + } $row['log_civicrm_entity_log_type'] = $this->getLogType($row['log_civicrm_entity_log_type']); @@ -207,12 +209,9 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { if ($this->cid) { $q .= '&cid=' . $this->cid; } - $q .= (!empty($row['log_civicrm_entity_altered_contact'])) ? - '&alteredName='.$row['log_civicrm_entity_altered_contact'] : ''; - $q .= (!empty($row['altered_by_contact_display_name'])) ? - '&alteredBy='.$row['altered_by_contact_display_name'] : ''; - $q .= (!empty($row['log_civicrm_entity_log_user_id'])) ? - '&alteredById='.$row['log_civicrm_entity_log_user_id'] : ''; + $q .= (!empty($row['log_civicrm_entity_altered_contact'])) ? '&alteredName='.$row['log_civicrm_entity_altered_contact'] : ''; + $q .= (!empty($row['altered_by_contact_display_name'])) ? '&alteredBy='.$row['altered_by_contact_display_name'] : ''; + $q .= (!empty($row['log_civicrm_entity_log_user_id'])) ? '&alteredById='.$row['log_civicrm_entity_log_user_id'] : ''; $url1 = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', "{$q}&snippet=4§ion=2&layout=overlay", FALSE, TRUE); $url2 = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', "{$q}§ion=2", FALSE, TRUE); @@ -237,8 +236,8 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { /** * @param null $logTable */ - public function from( $logTable = null ) { - static $entity = null; + public function from($logTable = NULL) { + static $entity = NULL; if ( $logTable ) { $entity = $logTable; } @@ -246,7 +245,7 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { $detail = $this->_logTables[$entity]; $tableName = CRM_Utils_Array::value('table_name', $detail, $entity); $clause = CRM_Utils_Array::value('entity_table', $detail); - $clause = $clause ? "AND entity_log_civireport.entity_table = 'civicrm_contact'" : null; + $clause = $clause ? "AND entity_log_civireport.entity_table = 'civicrm_contact'" : NULL; $joinClause = " INNER JOIN civicrm_contact modified_contact_civireport @@ -254,7 +253,7 @@ INNER JOIN civicrm_contact modified_contact_civireport if (!empty($detail['joins'])) { $clause = CRM_Utils_Array::value('entity_table', $detail); - $clause = $clause ? "AND fk_table.entity_table = 'civicrm_contact'" : null; + $clause = $clause ? "AND fk_table.entity_table = 'civicrm_contact'" : NULL; $joinClause = " INNER JOIN `{$this->loggingDB}`.{$detail['joins']['table']} fk_table ON {$detail['joins']['join']} INNER JOIN civicrm_contact modified_contact_civireport diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php index b4bbb6f385..f96a6b351f 100644 --- a/CRM/Report/Form/Contribute/Bookkeeping.php +++ b/CRM/Report/Form/Contribute/Bookkeeping.php @@ -289,28 +289,31 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { !empty($this->_params['fields'][$fieldName]) ) { switch ($fieldName) { - case 'credit_accounting_code' : + case 'credit_accounting_code': $select[] = " CASE WHEN {$this->_aliases['civicrm_financial_trxn']}.from_financial_account_id IS NOT NULL THEN {$this->_aliases['civicrm_financial_account']}_credit_1.accounting_code ELSE {$this->_aliases['civicrm_financial_account']}_credit_2.accounting_code END AS civicrm_financial_account_credit_accounting_code "; break; - case 'amount' : + + case 'amount': $select[] = " CASE WHEN {$this->_aliases['civicrm_entity_financial_trxn']}_item.entity_id IS NOT NULL THEN {$this->_aliases['civicrm_entity_financial_trxn']}_item.amount ELSE {$this->_aliases['civicrm_entity_financial_trxn']}.amount END AS civicrm_entity_financial_trxn_amount "; break; - case 'credit_name' : + + case 'credit_name': $select[] = " CASE WHEN {$this->_aliases['civicrm_financial_trxn']}.from_financial_account_id IS NOT NULL THEN {$this->_aliases['civicrm_financial_account']}_credit_1.name ELSE {$this->_aliases['civicrm_financial_account']}_credit_2.name END AS civicrm_financial_account_credit_name "; break; - default : + + default: $select[] = "{$field['dbAlias']} as {$tableName}_{$fieldName}"; break; } diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php index a385069399..337da32167 100644 --- a/CRM/Report/Form/Contribute/Detail.php +++ b/CRM/Report/Form/Contribute/Detail.php @@ -618,8 +618,7 @@ UNION ALL list($alias, $rest) = explode('.', $clause); $orderClause[] = $aliases[$alias] . "_" . $rest; } - $orderBy = (!empty($orderClause)) ? - "ORDER BY " . implode(', ', $orderClause) : ''; + $orderBy = (!empty($orderClause)) ? "ORDER BY " . implode(', ', $orderClause) : ''; } // 6. show result set from temp table 3 @@ -874,11 +873,9 @@ WHERE civicrm_contribution_contribution_id={$row['civicrm_contribution_contribu } else { // other aliases are higher level; roll count into their total - $totals[$key] = (array_key_exists($key, $totals)) ? - $totals[$key] + $dao->ct : $dao->ct; + $totals[$key] = (array_key_exists($key, $totals)) ? $totals[$key] + $dao->ct : $dao->ct; if ($showsumcontribs) { - $sumcontribs[$key] = array_key_exists($key, $sumcontribs) ? - $sumcontribs[$key] + $dao->sumcontribs : $dao->sumcontribs; + $sumcontribs[$key] = array_key_exists($key, $sumcontribs) ? $sumcontribs[$key] + $dao->sumcontribs : $dao->sumcontribs; } } } diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php index fe9aa21ccc..d86105ebcb 100644 --- a/CRM/Report/Form/Contribute/History.php +++ b/CRM/Report/Form/Contribute/History.php @@ -353,8 +353,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { if ($fieldName == 'this_year' || $fieldName == 'other_year') { continue; } - elseif (CRM_Utils_Array::value('type', $field) & - CRM_Utils_Type::T_DATE + elseif (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE ) { $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); @@ -738,7 +737,6 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { return; } - $last_primary = NULL; foreach ($rows as $rowNum => $row) { // Highlight primary contact and amount row diff --git a/CRM/Report/Form/Contribute/HouseholdSummary.php b/CRM/Report/Form/Contribute/HouseholdSummary.php index d2d2f475bd..1c63b59671 100644 --- a/CRM/Report/Form/Contribute/HouseholdSummary.php +++ b/CRM/Report/Form/Contribute/HouseholdSummary.php @@ -422,8 +422,7 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { //replace retionship id by relationship name if (array_key_exists('civicrm_relationship_relationship_type_id', $row)) { if ($value = $row['civicrm_relationship_relationship_type_id']) { - $rows[$rowNum]['civicrm_relationship_relationship_type_id'] = $this->relationTypes[ - $value . '_' . $type]; + $rows[$rowNum]['civicrm_relationship_relationship_type_id'] = $this->relationTypes[$value . '_' . $type]; $entryFound = TRUE; } } diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index c36e78aba5..466e7d741d 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -122,8 +122,8 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { ), ), ) - + $this->addAddressFields() - + array( + + $this->addAddressFields() + + array( 'civicrm_contribution' => array( 'dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array( @@ -197,7 +197,6 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { $current_year = $this->_params['yid_value']; $previous_year = $current_year - 1; - foreach ($this->_columns as $tableName => $table) { if (array_key_exists('fields', $table)) { @@ -277,8 +276,7 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { WHERE " . self::fiscalYearOffset('contri.receive_date') . " = $previous_year AND contri.is_test = 0)"; } - elseif (CRM_Utils_Array::value('type', $field) & - CRM_Utils_Type::T_DATE + elseif (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE ) { $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); diff --git a/CRM/Report/Form/Contribute/OrganizationSummary.php b/CRM/Report/Form/Contribute/OrganizationSummary.php index c79912840e..6cb7dda130 100644 --- a/CRM/Report/Form/Contribute/OrganizationSummary.php +++ b/CRM/Report/Form/Contribute/OrganizationSummary.php @@ -458,8 +458,7 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { } // convert Organization display name to links - if (array_key_exists('civicrm_contact_organization_organization_name', $row) && !empty($rows[$rowNum] - ['civicrm_contact_organization_organization_name']) && + if (array_key_exists('civicrm_contact_organization_organization_name', $row) && !empty($rows[$rowNum]['civicrm_contact_organization_organization_name']) && array_key_exists('civicrm_contact_organization_id', $row) ) { $url = CRM_Utils_System::url('civicrm/contact/view', diff --git a/CRM/Report/Form/Contribute/Recur.php b/CRM/Report/Form/Contribute/Recur.php index c85687427a..52262405d0 100644 --- a/CRM/Report/Form/Contribute/Recur.php +++ b/CRM/Report/Form/Contribute/Recur.php @@ -170,7 +170,7 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { 'frequency_unit' => array( 'title' => ts('Frequency Unit'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Core_OptionGroup::values('recur_frequency_units'), + 'options' => CRM_Core_OptionGroup::values('recur_frequency_units'), 'type' => CRM_Utils_Type::T_INT, ), 'frequency_interval' => array( @@ -209,7 +209,7 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { parent::__construct(); } public function getTemplateName() { - return 'CRM/Report/Form.tpl' ; + return 'CRM/Report/Form.tpl'; } public function from() { @@ -241,7 +241,7 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { // installments * intervals using the mysql date_add function, along // with the interval unit (e.g. DATE_ADD(start_date, INTERVAL 12 * 1 MONTH) $date_suffixes = array('relative', 'from', 'to'); - while(list(,$suffix) = each($date_suffixes)) { + while(list(, $suffix) = each($date_suffixes)) { // Check to see if the user wants to search by calculated date. if(!empty($this->_params['calculated_end_date_' . $suffix])) { // The calculated date field is in use - spring into action @@ -317,11 +317,11 @@ class CRM_Report_Form_Contribute_Recur extends CRM_Report_Form { if ($value = CRM_Utils_Array::value('civicrm_contribution_recur_contribution_status_id', $row)) { $rows[$rowNum]['civicrm_contribution_recur_contribution_status_id'] = $contributionStatus[$value]; } - + if ($value = CRM_Utils_Array::value('civicrm_contribution_recur_amount', $row)) { - $rows[$rowNum]['civicrm_contribution_recur_amount'] = CRM_Utils_Money::format($rows[$rowNum]['civicrm_contribution_recur_amount'],$rows[$rowNum]['civicrm_contribution_recur_currency']); + $rows[$rowNum]['civicrm_contribution_recur_amount'] = CRM_Utils_Money::format($rows[$rowNum]['civicrm_contribution_recur_amount'], $rows[$rowNum]['civicrm_contribution_recur_currency']); } - + } } } diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index b1e4ab2876..a958ce11af 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -389,8 +389,7 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution unset($clauses['receive_date1'], $clauses['total_amount1']); } - $whereClause = !empty($clauses) ? - "WHERE " . implode(' AND ', $clauses) : ''; + $whereClause = !empty($clauses) ? "WHERE " . implode(' AND ', $clauses) : ''; if ($replaceAliasWith) { $whereClause = str_replace($this->_aliases['civicrm_contribution'], $replaceAliasWith, $whereClause); @@ -428,8 +427,7 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution } } - $this->_where = !empty($clauses) ? - "WHERE " . implode(' AND ', $clauses) : ''; + $this->_where = !empty($clauses) ? "WHERE " . implode(' AND ', $clauses) : ''; } /** diff --git a/CRM/Report/Form/Contribute/SoftCredit.php b/CRM/Report/Form/Contribute/SoftCredit.php index 8e504003e5..d5d610cfda 100644 --- a/CRM/Report/Form/Contribute/SoftCredit.php +++ b/CRM/Report/Form/Contribute/SoftCredit.php @@ -146,7 +146,7 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form { ), 'civicrm_financial_type' => array( 'dao' => 'CRM_Financial_DAO_FinancialType', - 'fields' => array('financial_type' => NULL,), + 'fields' => array('financial_type' => NULL), 'filters' => array( 'id' => array( 'name' => 'id', diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index cfe68319b0..334a66699b 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -112,7 +112,7 @@ 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')), @@ -122,7 +122,7 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { 'dao' => 'CRM_Contribute_DAO_Contribution', //'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, diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php index 3dcfffb67f..d166b6c2e2 100644 --- a/CRM/Report/Form/Contribute/Sybunt.php +++ b/CRM/Report/Form/Contribute/Sybunt.php @@ -113,8 +113,8 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { ), ), ) - + $this->addAddressFields() - + array( + + $this->addAddressFields() + + array( 'civicrm_contribution' => array( 'dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array( @@ -273,8 +273,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { self::fiscalYearOffset('contri.receive_date') . " = {$this->_params['yid_value']} AND contri.is_test = 0 )"; } - elseif (CRM_Utils_Array::value('type', $field) & - CRM_Utils_Type::T_DATE + elseif (CRM_Utils_Array::value('type', $field) & CRM_Utils_Type::T_DATE ) { $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php index 4b0117a158..79abd52203 100644 --- a/CRM/Report/Form/Contribute/TopDonor.php +++ b/CRM/Report/Form/Contribute/TopDonor.php @@ -80,8 +80,8 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { ), ), ) - + $this->getAddressColumns() - + array( + + $this->getAddressColumns() + + array( 'civicrm_contribution' => array( 'dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array( @@ -335,7 +335,6 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { $this->limit(); - //set the variable value rank, rows = 0 $setVariable = " SET @rows:=0, @rank=0 "; CRM_Core_DAO::singleValueQuery($setVariable); diff --git a/CRM/Report/Form/Event/Income.php b/CRM/Report/Form/Event/Income.php index c6405f8790..6dfcf0ef1d 100644 --- a/CRM/Report/Form/Event/Income.php +++ b/CRM/Report/Form/Event/Income.php @@ -291,7 +291,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { //if pageId is greator than last page then display last page. if ((($pageId * self::ROW_COUNT_LIMIT) - 1) > $this->_rowsFound) { - $pageId = ceil((float)$this->_rowsFound / (float)self::ROW_COUNT_LIMIT); + $pageId = ceil((float) $this->_rowsFound / (float) self::ROW_COUNT_LIMIT); $this->set(CRM_Utils_Pager::PAGE_ID, $pageId); } $this->_limit = ($pageId - 1) * self::ROW_COUNT_LIMIT; diff --git a/CRM/Report/Form/Event/ParticipantListCount.php b/CRM/Report/Form/Event/ParticipantListCount.php index a1973b76ba..761d123b80 100644 --- a/CRM/Report/Form/Event/ParticipantListCount.php +++ b/CRM/Report/Form/Event/ParticipantListCount.php @@ -537,7 +537,6 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { $entryFound = TRUE; } - // skip looking further in rows, if first row itself doesn't // have the column we need if (!$entryFound) { diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index cdc7f7ca83..5d86efb0ea 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -365,7 +365,6 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { ), ); - $this->_options = array( 'blank_column_begin' => array( 'title' => ts('Blank column at the Begining'), @@ -600,7 +599,6 @@ ORDER BY cv.label // build query $sql = $this->buildQuery(TRUE); - // build array of result based on column headers. This method also allows // modifying column headers before using it to build result set i.e $rows. $rows = array(); diff --git a/CRM/Report/Form/Extended.php b/CRM/Report/Form/Extended.php index 851b65debe..5b865fe85e 100644 --- a/CRM/Report/Form/Extended.php +++ b/CRM/Report/Form/Extended.php @@ -244,7 +244,7 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { 'title' => ts('Price Field Value Label'), ), ), - 'group_bys' => //note that we have a requirement to group by label such that all 'Promo book' lines + 'group_bys' => //note that we have a requirement to group by label such that all 'Promo book' lines // are grouped together across price sets but there may be a separate need to group // by id so that entries in one price set are distinct from others. Not quite sure what // to call the distinction for end users benefit diff --git a/CRM/Report/Form/Grant/Statistics.php b/CRM/Report/Form/Grant/Statistics.php index a5da89bea2..b6a02c2e2a 100644 --- a/CRM/Report/Form/Grant/Statistics.php +++ b/CRM/Report/Form/Grant/Statistics.php @@ -512,8 +512,7 @@ SELECT COUNT({$this->_aliases['civicrm_grant']}.id) as count , "({$values['percentage']}%)"; } $totalAmt = implode(', ', $totalAmount); - $count = (boolean) CRM_Utils_Array::value('count', $values, 0) ? - $values['count'] . " ({$values['percentage']}%)" : ''; + $count = (boolean) CRM_Utils_Array::value('count', $values, 0) ? $values['count'] . " ({$values['percentage']}%)" : ''; $row[] = array( 'civicrm_grant_total_grants' => $field, 'civicrm_grant_count' => $count, @@ -544,7 +543,6 @@ SELECT COUNT({$this->_aliases['civicrm_grant']}.id) as count , $currencies = CRM_Core_PseudoConstant::get('CRM_Grant_DAO_Grant', 'currency', array('labelColumn' => 'symbol')); $currency = $currencies[$values['civicrm_grant_currency']]; - if (!$customData) { if (!isset($grantStatistics['value'][$fieldValue]['currency'][$currency]) || diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php index 29f831a45f..983cb89ef9 100644 --- a/CRM/Report/Form/Instance.php +++ b/CRM/Report/Form/Instance.php @@ -87,7 +87,8 @@ class CRM_Report_Form_Instance { $form->add('text', 'row_count', ts('Limit Dashboard Results'), - array('maxlength' => 64, + array( + 'maxlength' => 64, 'size' => 5 ) ); @@ -154,8 +155,9 @@ class CRM_Report_Form_Instance { // For now we only providing drilldown for one primary detail report only. In future this could be multiple reports foreach ($form->_drilldownReport as $reportUrl => $drillLabel) { $instanceList = CRM_Report_Utils_Report::getInstanceList($reportUrl); - if (count($instanceList) > 1) + if (count($instanceList) > 1) { $form->add('select', 'drilldown_id', $drillLabel, array('' => ts('- select -')) + $instanceList); + } break; } @@ -213,8 +215,8 @@ class CRM_Report_Form_Instance { $navigationDefaults = array(); if (!isset($defaults['permission'])){ - $permissions = array_flip(CRM_Core_Permission::basicPermissions( )); - $defaults['permission'] = $permissions['CiviReport: access CiviReport']; + $permissions = array_flip(CRM_Core_Permission::basicPermissions( )); + $defaults['permission'] = $permissions['CiviReport: access CiviReport']; } $config = CRM_Core_Config::singleton(); diff --git a/CRM/Report/Form/Mailing/Bounce.php b/CRM/Report/Form/Mailing/Bounce.php index 4084e4708b..dde606de27 100644 --- a/CRM/Report/Form/Mailing/Bounce.php +++ b/CRM/Report/Form/Mailing/Bounce.php @@ -231,7 +231,6 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { } } - if (!empty($this->_params['charts'])) { $select[] = "COUNT({$this->_aliases['civicrm_mailing_event_bounce']}.id) as civicrm_mailing_bounce_count"; $this->_columnHeaders["civicrm_mailing_bounce_count"]['title'] = ts('Bounce Count'); diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index 5476a7422e..9fd76ebaa0 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -51,7 +51,7 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { 'bar_3dChart' => 'Bar Chart', ); - public $campaignEnabled = False; + public $campaignEnabled = FALSE; /** * @@ -446,13 +446,16 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { * @return array */ public static function getChartCriteria() { - return array('count' => array('civicrm_mailing_event_delivered_delivered_count' => ts('Delivered'), + return array( + 'count' => array( + 'civicrm_mailing_event_delivered_delivered_count' => ts('Delivered'), 'civicrm_mailing_event_bounce_bounce_count' => ts('Bounce'), 'civicrm_mailing_event_opened_open_count' => ts('Opened'), 'civicrm_mailing_event_trackable_url_open_click_count' => ts('Clicks'), 'civicrm_mailing_event_unsubscribe_unsubscribe_count' => ts('Unsubscribe'), ), - 'rate' => array('civicrm_mailing_event_delivered_accepted_rate' => ts('Accepted Rate'), + 'rate' => array( + 'civicrm_mailing_event_delivered_accepted_rate' => ts('Accepted Rate'), 'civicrm_mailing_event_bounce_bounce_rate' => ts('Bounce Rate'), 'civicrm_mailing_event_opened_open_rate' => ts('Confirmed Open Rate'), 'civicrm_mailing_event_trackable_url_open_CTR' => ts('Click through Rate'), @@ -501,7 +504,8 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { $criterias = self::getChartCriteria(); - $chartInfo = array('legend' => ts('Mail Summary'), + $chartInfo = array( + 'legend' => ts('Mail Summary'), 'xname' => ts('Mailing'), 'yname' => ts('Statistics'), 'xLabelAngle' => 20, @@ -589,7 +593,6 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { $entryFound = TRUE; } - // skip looking further in rows, if first row itself doesn't // have the column we need if (!$entryFound) { diff --git a/CRM/Report/Form/Member/ContributionDetail.php b/CRM/Report/Form/Member/ContributionDetail.php index 5ce851e5a2..b9e34aac17 100644 --- a/CRM/Report/Form/Member/ContributionDetail.php +++ b/CRM/Report/Form/Member/ContributionDetail.php @@ -700,7 +700,6 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { if (!empty($this->_noRepeats) && $this->_outputMode != 'csv') { $repeatFound = FALSE; - $display_flag = NULL; if (array_key_exists('civicrm_contact_id', $row)) { if ($cid = $row['civicrm_contact_id']) { @@ -730,7 +729,6 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { } } - if (array_key_exists('civicrm_membership_membership_type_id', $row)) { if ($value = $row['civicrm_membership_membership_type_id']) { $rows[$rowNum]['civicrm_membership_membership_type_id'] = CRM_Member_PseudoConstant::membershipType($value, FALSE); diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index eb76b01604..952f5cb1a8 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -327,7 +327,6 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { ON {$this->_aliases['civicrm_membership_status']}.id = {$this->_aliases['civicrm_membership']}.status_id "; - //used when address field is selected if ($this->_addressField) { $this->_from .= " diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index af1f916539..7c2b9871bd 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -191,7 +191,6 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { $this->_columns['civicrm_membership']['group_bys']['campaign_id'] = array('title' => ts('Campaign')); } - $this->_groupFilter = TRUE; $this->_currencyColumn = 'civicrm_contribution_currency'; parent::__construct(); @@ -627,7 +626,6 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency $entryFound = TRUE; } - // If using campaigns, convert campaign_id to campaign title if (array_key_exists('civicrm_membership_campaign_id', $row)) { if ($value = $row['civicrm_membership_campaign_id']) { diff --git a/CRM/Report/Form/Pledge/Detail.php b/CRM/Report/Form/Pledge/Detail.php index b748d773db..4711c56a72 100644 --- a/CRM/Report/Form/Pledge/Detail.php +++ b/CRM/Report/Form/Pledge/Detail.php @@ -176,8 +176,8 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { ), ), ) - + $this->getAddressColumns(array('group_by' => FALSE)) - + $this->getPhoneColumns(); + + $this->getAddressColumns(array('group_by' => FALSE)) + + $this->getPhoneColumns(); // If we have a campaign, build out the relevant elements $this->_tagFilter = TRUE; if ($campaignEnabled && !empty($this->activeCampaigns)) { diff --git a/CRM/Report/Info.php b/CRM/Report/Info.php index 2fe166a71d..0c5f22ade7 100644 --- a/CRM/Report/Info.php +++ b/CRM/Report/Info.php @@ -172,5 +172,6 @@ class CRM_Report_Info extends CRM_Core_Component_Info { /** * @param $shortCuts */ - public function creatNewShortcut(&$shortCuts) {} + public function creatNewShortcut(&$shortCuts) { + } } diff --git a/CRM/Report/Page/InstanceList.php b/CRM/Report/Page/InstanceList.php index 132d125506..3d060d456f 100644 --- a/CRM/Report/Page/InstanceList.php +++ b/CRM/Report/Page/InstanceList.php @@ -47,14 +47,14 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { * Name of component if report list is filtered * * @var string - **/ + **/ protected $_compName = NULL; /** * ID of component if report list is filtered * * @var int - **/ + **/ protected $_compID = NULL; /** @@ -68,7 +68,7 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { * ID of parent report template if list is filtered by template * * @var int - **/ + **/ protected $_ovID = NULL; @@ -76,7 +76,7 @@ class CRM_Report_Page_InstanceList extends CRM_Core_Page { * Title of parent report template if list is filtered by template * * @var string - **/ + **/ protected $_title = NULL; /** diff --git a/CRM/Report/Utils/Get.php b/CRM/Report/Utils/Get.php index f0fd552db8..24d825117b 100644 --- a/CRM/Report/Utils/Get.php +++ b/CRM/Report/Utils/Get.php @@ -121,6 +121,7 @@ class CRM_Report_Utils_Get { case 'nnll': $defaults["{$fieldName}_op"] = $fieldOP; break; + case 'in': case 'notin': case 'mhas': diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index 62de36c2b2..7d8f6cb09d 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -130,12 +130,14 @@ WHERE TRIM(BOTH '/' FROM CONCAT(report_id, '/', name)) = %1"; */ public static function getNextUrl($urlValue, $query = 'reset=1', $absolute = FALSE, $instanceID = NULL, $drilldownReport = array()) { if ($instanceID) { - $drilldownInstanceID = false; - if (array_key_exists($urlValue, $drilldownReport)) + $drilldownInstanceID = FALSE; + if (array_key_exists($urlValue, $drilldownReport)) { $drilldownInstanceID = CRM_Core_DAO::getFieldValue('CRM_Report_DAO_ReportInstance', $instanceID, 'drilldown_id', 'id'); + } - if (!$drilldownInstanceID) + if (!$drilldownInstanceID) { $drilldownInstanceID = self::getInstanceIDForValue($urlValue); + } if ($drilldownInstanceID) { return CRM_Utils_System::url("civicrm/report/instance/{$drilldownInstanceID}", @@ -160,7 +162,8 @@ WHERE TRIM(BOTH '/' FROM CONCAT(report_id, '/', name)) = %1"; * @return int|null|string */ public static function getInstanceCount($optionVal) { - if (empty($optionVal)) return 0; + if (empty($optionVal)) { return 0; + } $sql = " SELECT count(inst.id)