Commit 99a17952 authored by sluc23's avatar sluc23

add age filter to birthday report

parent ca8a2ba4
......@@ -83,6 +83,11 @@ class CRM_Reportplus_Form_Contact_Birthday extends CRM_Reportplus_Form {
'type' => CRM_Utils_Type::T_DATE,
'default' => 'this.day',
],
'age' => [
'title' => ts('Age'),
'type' => CRM_Utils_Type::T_INT,
'dbAlias' => "DATE_FORMAT(FROM_DAYS((TO_DAYS(NOW())+1)-TO_DAYS(contact_civireport.birth_date)), '%Y')+0",
],
'is_deceased' => [
'title' => ts('Is Deceased'),
'default' => 0,
......@@ -105,7 +110,7 @@ class CRM_Reportplus_Form_Contact_Birthday extends CRM_Reportplus_Form {
'default_weight' => '0',
'default_order' => 'ASC',
],
'birth_date_year' => [
'birth_date_year' => [
'title' => E::ts('Birth Date (Year)'),
'default_weight' => '1',
'dbAlias' => 'YEAR(contact_civireport.birth_date)',
......@@ -394,7 +399,6 @@ class CRM_Reportplus_Form_Contact_Birthday extends CRM_Reportplus_Form {
$entryFound = TRUE;
}
// display birthday in the configured custom format
if (array_key_exists('civicrm_contact_birth_date', $row)) {
$birthDate = $row['civicrm_contact_birth_date'];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment