INFRA-132 - CRM/Report - phpcbf
authorTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 21:21:23 +0000 (13:21 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 6 Jan 2015 23:07:44 +0000 (15:07 -0800)
37 files changed:
CRM/Report/Form/Campaign/SurveyDetails.php
CRM/Report/Form/Case/Demographics.php
CRM/Report/Form/Case/Detail.php
CRM/Report/Form/Case/Summary.php
CRM/Report/Form/Case/TimeSpent.php
CRM/Report/Form/Contact/CurrentEmployer.php
CRM/Report/Form/Contact/Detail.php
CRM/Report/Form/Contact/Log.php
CRM/Report/Form/Contact/LoggingSummary.php
CRM/Report/Form/Contribute/Bookkeeping.php
CRM/Report/Form/Contribute/Detail.php
CRM/Report/Form/Contribute/History.php
CRM/Report/Form/Contribute/HouseholdSummary.php
CRM/Report/Form/Contribute/Lybunt.php
CRM/Report/Form/Contribute/OrganizationSummary.php
CRM/Report/Form/Contribute/Recur.php
CRM/Report/Form/Contribute/Repeat.php
CRM/Report/Form/Contribute/SoftCredit.php
CRM/Report/Form/Contribute/Summary.php
CRM/Report/Form/Contribute/Sybunt.php
CRM/Report/Form/Contribute/TopDonor.php
CRM/Report/Form/Event/Income.php
CRM/Report/Form/Event/ParticipantListCount.php
CRM/Report/Form/Event/ParticipantListing.php
CRM/Report/Form/Extended.php
CRM/Report/Form/Grant/Statistics.php
CRM/Report/Form/Instance.php
CRM/Report/Form/Mailing/Bounce.php
CRM/Report/Form/Mailing/Summary.php
CRM/Report/Form/Member/ContributionDetail.php
CRM/Report/Form/Member/Detail.php
CRM/Report/Form/Member/Summary.php
CRM/Report/Form/Pledge/Detail.php
CRM/Report/Info.php
CRM/Report/Page/InstanceList.php
CRM/Report/Utils/Get.php
CRM/Report/Utils/Report.php

index a64f713398324edd9ce2a802e4792ff8657f7595..f070f017c6ae6d27885fb9e63d3344f07148978d 100644 (file)
@@ -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,
index fce44d3d0c7e573395c299e2f1644be1edbd84f9..7abdc9b7895c6777fbd815a94d439aad6d9881b2 100644 (file)
@@ -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',
index 932b03d016e735705a93acb1f339fefb8b1f77ea..2b02d2b133dc3bf5b0c57effca343303b7e6f0ae 100644 (file)
@@ -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
             )];
         }
       }
index 787ab4d8bf42fad94f3a203b954ca470dd7cd97d..4d40101c9a612d417c2d1ae6382763af08309618 100644 (file)
@@ -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);
index 7881af631d8458969f4ebe2f2e6438ab0b5e3d03..584673a5cf5b73c18e695b842c277ac1cf2d7642 100644 (file)
@@ -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,
             ),
index 85e4d9e36bdff494a5f88f26b97c5e805c9ef899..22c6f2a57e89c85174c22110e0521e12a16a6ad1 100644 (file)
@@ -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);
index 9cdfe075fc1675be631f0b965b757791f86c919f..fb04d5da78a1b01c9ed304b498feb552205764c0 100644 (file)
@@ -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) {
index a2be5ecebbc4e01f4b62290e3283e0cfd3b23ccd..59b0d85163d15bcbc1cbdebcf15a06d073ca4736 100644 (file)
@@ -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);
index 65cb0af61fb072b36cb96f172d1ec59d38fd6c4d..5cde591ab19f966889a35303dd1a37609dc044d0 100644 (file)
@@ -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&section=2&layout=overlay", FALSE, TRUE);
         $url2 = CRM_Report_Utils_Report::getNextUrl('logging/contact/detail', "{$q}&section=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
index b4bbb6f3857054e629896e79fcf76d29b651423f..f96a6b351fc541ccce306dd771e737999cf2cece 100644 (file)
@@ -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;
             }
index a3850693999bd6612cf88fb3e17da6f44c09a47b..337da3216729042c626d8b21f4177ea8b04e5a2f 100644 (file)
@@ -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;
             }
           }
         }
index fe9aa21ccc5a973fbe1d396736c64253ab111399..d86105ebcb6fdb00ee966f943226a569deea8da8 100644 (file)
@@ -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
index d2d2f475bd61b689131e9fbe904a93bf90e2ed3a..1c63b596713aced46f463093254d2e606850488d 100644 (file)
@@ -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;
         }
       }
index c36e78aba50f7fa9deac90b6c666e4dbcae5bba0..466e7d741d08785805e5b389f5b3a213ee8364f8 100644 (file)
@@ -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);
index c79912840eaa6c6e9fa0fdd353842032b2d70259..6cb7dda1304b0ffa5138153f0a01d35ce341a15c 100644 (file)
@@ -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',
index c85687427ab9bd3df5e09afaf5895b2a152dbfec..52262405d0c736cccbbd41ee574dab9420cf195e 100644 (file)
@@ -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']);
       }
-      
+
     }
   }
 }
index b1e4ab2876efe3778a39182f304a893c907e3ff2..a958ce11affd1fbbd19e9d45df265c275ef526cb 100644 (file)
@@ -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) : '';
   }
 
   /**
index 8e504003e56671f9d32d12372d1b997ba321a44c..d5d610cfdaefffda3e484226a31abe86bf3ddc8f 100644 (file)
@@ -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',
index cfe68319b09f33ecac5c3eb9f1dd822f57c0aeab..334a66699bff7d8d55b425db6d0a4620e1caeb85 100644 (file)
@@ -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,
index 3dcfffb67f74c7666dcc55ff68e636e9e0d2535c..d166b6c2e2335b02747f36f846939eee71ab5670 100644 (file)
@@ -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);
index 4b0117a15811248545380715918c9ded297d61fe..79abd52203f8282d5274ccc8ec05c0abf078b047 100644 (file)
@@ -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);
index c6405f8790b92ba52f74c832af600d251a532443..6dfcf0ef1db913e0046745a3a61c8d7945cf0e62 100644 (file)
@@ -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;
index a1973b76ba94b67b1545eecd0e296ecb4c63cd9a..761d123b808db9fb8b9a206ac7573e8092b0b631 100644 (file)
@@ -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) {
index cdc7f7ca837ed3622de030a876479ed3ea6512a0..5d86efb0ea219934184db4c60ef9595ec8f7b58e 100644 (file)
@@ -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();
index 851b65debe086c42a92c79298e26025aa5460199..5b865fe85eba16865a779403ebf633e0552a7fdd 100644 (file)
@@ -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
index a5da89bea2854a9ef5ed4ede5511c5d48a2a469a..b6a02c2e2a9350b123f7bbe43271cef47a2bd33e 100644 (file)
@@ -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])
         ||
index 29f831a45ff04dc58ec5170b5837083c7338480c..983cb89ef9c691e1414b3277fa171245ed9a94c6 100644 (file)
@@ -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();
index 4084e4708b3feb342fd400cee95da5f5662b87d0..dde606de27d64917adfcddb3e24bc21b87c1975b 100644 (file)
@@ -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');
index 5476a7422eb5ec1b2d2e5c413f465b9a808225a9..9fd76ebaa04aa79dbf75b0a4c5cdefc2c76a09dc 100644 (file)
@@ -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) {
index 5ce851e5a2bd0c8fba912054ed246905c4043a54..b9e34aac174a8a165d34744c87cfaefad380e2e9 100644 (file)
@@ -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);
index eb76b01604c07fd201de79caa497776db28e8bbe..952f5cb1a8a1009e9dbf420422b30c990b478e86 100644 (file)
@@ -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 .= "
index af1f916539e9cd10e15c0d7f9dc721ff2d1e9bb8..7c2b9871bd523ae6f248bc9e54a0ae4f9c798d9d 100644 (file)
@@ -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']) {
index b748d773db57fca0b6aae22846f8f64f4a892a4c..4711c56a723cfd813547fb0573cf530da4f94c85 100644 (file)
@@ -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)) {
index 2fe166a71d7e9b435f931d5ccb9a01147f922845..0c5f22ade7c793604507dd0e08df9b0e9d1efe7a 100644 (file)
@@ -172,5 +172,6 @@ class CRM_Report_Info extends CRM_Core_Component_Info {
   /**
    * @param $shortCuts
    */
-  public function creatNewShortcut(&$shortCuts) {}
+  public function creatNewShortcut(&$shortCuts) {
+  }
 }
index 132d12550620e72e12dadb916e9f171db263f6e5..3d060d456fc80877c0cb9db9ec1acef6c540df05 100644 (file)
@@ -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;
 
   /**
index f0fd552db83fdc0b30df22d6154ae5c409a366c3..24d825117bde90b77cc954eb82150c49c70ace75 100644 (file)
@@ -121,6 +121,7 @@ class CRM_Report_Utils_Get {
       case 'nnll':
         $defaults["{$fieldName}_op"] = $fieldOP;
         break;
+
       case 'in':
       case 'notin':
       case 'mhas':
index 62de36c2b2dee56dc090387f24c2b4907e52f1cd..7d8f6cb09da11d3df64b9310ce42995e0470f13a 100644 (file)
@@ -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)