protected $_contribField = FALSE;
- protected $_customGroupExtends = array('Participant');
+ protected $_customGroupExtends = array('Participant', 'Contact', 'Individual',);
+
public $_drilldownReport = array('event/income' => 'Link to Detail Report');
function __construct() {
+ $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
// Check if CiviCampaign is a) enabled and b) has active campaigns
$config = CRM_Core_Config::singleton();
'no_display' => TRUE,
'required' => TRUE,
),
+ 'gender_id' =>
+ array('title' => ts('Gender'),
+ ),
'birth_date' =>
array('title' => ts('Birth Date'),
),
- 'gender_id' =>
- array('title' => ts('Gender'),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
+ 'age_at_event' => array(
+ 'title' => ts('Age at Event'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, event_civireport.start_date)',
),
'employer_id' =>
array('title' => ts('Organization'),
'default_weight' => '0',
'default_order' => 'ASC',
),
+ 'gender_id' =>
+ array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' =>
+ array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
+ 'age_at_event' =>
+ array(
+ 'name' => 'age_at_event',
+ 'title' => ts('Age at Event'),
+ ),
),
'filters' =>
array(
array('title' => ts('Participant Name'),
'operator' => 'like',
),
+ 'gender_id' =>
+ array('title' => ts('Gender'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
+ ),
+ 'birth_date' => array(
+ 'title' => 'Birth Date',
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ 'type' => CRM_Utils_Type::T_DATE
+ ),
),
),
'civicrm_email' =>
$entryFound = TRUE;
}
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ if ($value = $row['civicrm_contact_birth_date']) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($row['civicrm_contact_birth_date'], '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
}
}
}
-}
+}
\ No newline at end of file
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
+
+{literal}
+<script type="text/javascript">
+ cj(document).ready(function(){
+ cj('#birth_date_from').attr('startOffset',200);
+ cj('#birth_date_from').attr('endoffset',0);
+ cj('#birth_date_to').attr('startOffset',200);
+ cj('#birth_date_to').attr('endoffset',0);
+ });
+</script>
+{/literal}
+
{include file="CRM/Report/Form.tpl"}