/**
  * (non-PHPdoc)
  * @see CRM_Extendedreport_Form_Report_Advancedfundraising::beginPostProcess()
  */
 function beginPostProcess()
 {
     parent::beginPostProcess();
     if (!empty($this->_params['report_options_value'])) {
         //if none are set we will display all
         $this->_kpiDescriptors = array_intersect_key($this->_kpiDescriptors, array_flip($this->_params['report_options_value']));
     }
     if (!empty($this->_params['receive_date_relative'])) {
         //render out relative dates here
         $rels = explode('.', $this->_params['receive_date_relative']);
         $fromTo = CRM_Utils_Date::relativeToAbsolute($rels[0], $rels[1]);
         $this->_params['receive_date_from'] = $this->_params['receive_date_from_stash'] = $fromTo['from'];
         $this->_params['receive_date_to'] = $fromTo['to'];
         // unset($this->_params['receive_date_relative']);
     }
     $this->_currentYear = date('Y', strtotime($this->_params['receive_date_from']));
     $this->_lastYear = $this->_currentYear - 1;
     $this->_yearBeforeLast = $this->_currentYear - 2;
     $this->_years = array(0 => $this->_currentYear, 1 => $this->_lastYear);
     // receive date from & to get unset in parent class. I'm a bit scared to change that right
     // now so will hack around it by stashing them for a bit
     $this->_params['receive_date_from_stash'] = $this->_params['receive_date_from'];
     $this->_params['receive_date_to_stash'] = $this->_params['receive_date_to'];
     $this->constructRanges(array('primary_from_date' => 'receive_date_from', 'primary_to_date' => 'receive_date_to', 'offset_unit' => 'year', 'offset' => 1, 'comparison_offset' => '1', 'comparison_offset_unit' => 'year', 'no_periods' => 2, 'statuses' => array('increased')));
 }
 function beginPostProcess()
 {
     parent::beginPostProcess();
     $this->constructRanges(array('cutoff_date' => 'receive_date_value', 'offset_unit' => 'month', 'offset' => 'contribution_baseline_interval_value', 'comparison_offset' => 'contribution_renewal_comparison_value', 'comparison_offset_unit' => 'month', 'no_periods' => 'contribution_no_periods_value'));
 }
 function beginPostProcess()
 {
     parent::beginPostProcess();
     $this->_ranges = array('interval_0' => array());
     $dateFields = array('receive_date' => '', 'comparison_date' => 'comparison_', 'report_date' => 'report_date');
     $earliestDate = date('Y-m-d');
     $latestDate = date('Y-m-d', strtotime('50 years ago'));
     foreach ($dateFields as $fieldName => $prefix) {
         $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params);
         $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params);
         $to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params);
         $fromTime = CRM_Utils_Array::value("{$fieldName}_from_time", $this->_params);
         $toTime = CRM_Utils_Array::value("{$fieldName}_to_time", $this->_params);
         list($from, $to) = CRM_Report_Form::getFromTo($relative, $from, $to, $fromTime, $toTime);
         $this->_ranges['interval_0'][$prefix . 'from_date'] = DATE('Y-m-d', strtotime($from));
         $this->_ranges['interval_0'][$prefix . 'to_date'] = DATE('Y-m-d', strtotime($to));
         if (strtotime($from) < strtotime($earliestDate)) {
             $earliestDate = date('m/d/Y', strtotime($from));
         }
         if (strtotime($to) > strtotime($latestDate)) {
             $latestDate = date('m/d/Y', strtotime($to));
         }
     }
     // now we will re-set the receive date range to reflect the largest
     // & smallest dates we are interested in
     $this->_params['report_date_from'] = $earliestDate;
     $this->_params['report_date_to'] = $latestDate;
     $this->_params['report_date_relative'] = '0';
     $this->_columns['civicrm_contribution']['filters']['report_date'] = $this->_columns['civicrm_contribution']['filters']['receive_date'];
     $this->_columns['civicrm_contribution']['filters']['report_date']['title'] = 'Report Date Range';
     $this->_columns['civicrm_contribution']['filters']['report_date']['pseudofield'] = FALSE;
     $this->_statuses = array($this->_params['behaviour_type_value']);
 }
 /**
  * (non-PHPdoc)
  * @see CRM_Extendedreport_Form_Report_Advancedfundraising::beginPostProcess()
  */
 function beginPostProcess()
 {
     parent::beginPostProcess();
     $this->constructRanges(array('cutoff_date' => 'receive_date_value', 'start_offset' => 'contribution_timeframe_value', 'start_offset_unit' => 'month', 'offset_unit' => 'month', 'offset' => 'contribution_baseline_interval_value', 'comparison_offset' => 'contribution_renewal_comparison_value', 'comparison_offset_unit' => 'month', 'comparison_offset_type' => 'allprior', 'no_periods' => 2, 'statuses' => array('new', 'recovered', 'renewed')));
 }
 /**
  * (non-PHPdoc)
  * @see CRM_Extendedreport_Form_Report_Advancedfundraising::beginPostProcess()
  */
 function beginPostProcess()
 {
     parent::beginPostProcess();
     $this->beginPostProcessCommon();
 }