'first_name' => array(
'title' => ts('First Name'),
),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
'last_name' => array(
'title' => ts('Last Name'),
),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
'job_title' => array(
'title' => ts('Job Title'),
'default' => TRUE,
'gender_id' => array(
'title' => ts('Gender'),
),
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
),
'contact_type' => array(
'title' => ts('Contact Type'),
),
'filters' => array(
'sort_name' => array('title' => ts('Employee Name')),
- 'id' => array('no_display' => TRUE),
+ 'source' => array(
+ 'title' => ts('Contact Source'),
+ 'type' => CRM_Utils_Type::T_STRING,
+ ),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
+ ),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
'grouping' => 'contact-fields',
),
$entryFound = TRUE;
}
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
// convert employee name to links
if (array_key_exists('civicrm_contact_display_name', $row) &&
array_key_exists('civicrm_contact_id', $row)
'first_name' => array(
'title' => ts('First Name'),
),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
'last_name' => array(
'title' => ts('Last Name'),
),
'no_display' => TRUE,
'required' => TRUE,
),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
'contact_type' => array(
'title' => ts('Contact Type'),
),
'contact_sub_type' => array(
'title' => ts('Contact Subtype'),
),
- 'birth_date' => array(
- 'title' => ts('Birth Date'),
- ),
),
'filters' => array(
'id' => array(
'sort_name' => array(
'title' => ts('Contact Name'),
),
+ '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' => ts('Birth Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
'grouping' => 'contact-fields',
'order_bys' => array(
'default_weight' => '0',
'default_order' => 'ASC',
),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ ),
+ 'gender_id' => array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
),
'civicrm_address' => array(
$entryFound = TRUE;
}
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
if (array_key_exists('civicrm_address_state_province_id', $row)) {
if ($value = $row['civicrm_address_state_province_id']) {
$rows[$rowNum]['civicrm_address_state_province_id'] = CRM_Core_PseudoConstant::stateProvince($value, FALSE);
);
public $_drilldownReport = array('contact/detail' => 'Link to Detail Report');
- /**
- * Class constructor.
- */
public function __construct() {
$contact_type = CRM_Contact_BAO_ContactType::getSelectElements(FALSE, TRUE, '_');
'type' => CRM_Utils_Type::T_STRING,
),
),
- 'grouping' => 'conact_a_fields',
+ 'grouping' => 'contact_a_fields',
),
'civicrm_contact_b' => array(
'dao' => 'CRM_Contact_DAO_Contact',
'type' => CRM_Utils_Type::T_STRING,
),
),
- 'grouping' => 'conact_b_fields',
+ 'grouping' => 'contact_b_fields',
),
'civicrm_email' => array(
'dao' => 'CRM_Core_DAO_Email',
'name' => 'email',
),
),
- 'grouping' => 'conact_a_fields',
+ 'grouping' => 'contact_a_fields',
),
'civicrm_email_b' => array(
'dao' => 'CRM_Core_DAO_Email',
'name' => 'email',
),
),
- 'grouping' => 'conact_b_fields',
+ 'grouping' => 'contact_b_fields',
),
'civicrm_phone' => array(
'dao' => 'CRM_Core_DAO_Phone',
'name' => 'phone_ext',
),
),
- 'grouping' => 'conact_a_fields',
+ 'grouping' => 'contact_a_fields',
),
'civicrm_phone_b' => array(
'dao' => 'CRM_Core_DAO_Phone',
'name' => 'phone_ext',
),
),
- 'grouping' => 'conact_b_fields',
+ 'grouping' => 'contact_b_fields',
),
'civicrm_relationship_type' => array(
'dao' => 'CRM_Contact_DAO_RelationshipType',
}
/**
- * Alter display of rows.
- *
- * Iterate through the rows retrieved via SQL and make changes for display purposes,
- * such as rendering contacts as links.
- *
- * @param array $rows
- * Rows generated by SQL, with an array for each row.
+ * @param $rows
*/
public function alterDisplay(&$rows) {
+ // custom code to alter rows
$entryFound = FALSE;
foreach ($rows as $rowNum => $row) {
'no_display' => TRUE,
'required' => TRUE,
),
- 'contact_type' => array(
- 'title' => ts('Contact Type'),
- ),
- 'contact_sub_type' => array(
- 'title' => ts('Contact Subtype'),
- ),
'gender_id' => array(
'title' => ts('Gender'),
),
'title' => ts('Age'),
'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
'filters' => array(
'sort_name' => array('title' => ts('Contact Name')),
'title' => ts('Birth Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
'grouping' => 'contact-fields',
'order_bys' => array(
'default_weight' => '0',
'default_order' => 'ASC',
),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
'gender_id' => array(
'name' => 'gender_id',
'title' => ts('Gender'),
'name' => 'birth_date',
'title' => ts('Birth Date'),
),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
),
'civicrm_email' => array(
protected $_summary = NULL;
protected $_customGroupExtends = array(
+ 'Contact',
+ 'Individual',
+ 'Contribution',
'Membership',
);
- /**
- */
/**
*/
public function __construct() {
+ $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
$this->_columns = array(
'civicrm_contact' => array(
'dao' => 'CRM_Contact_DAO_Contact',
'required' => TRUE,
'no_repeat' => TRUE,
),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ ),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ ),
'id' => array(
'no_display' => TRUE,
'required' => TRUE,
),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
+ ),
+ 'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
+ ),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
+ 'gender_id' => array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
'contact_type' => array(
'title' => ts('Contact Type'),
),
'title' => ts('Contact ID'),
'no_display' => TRUE,
),
- ),
- 'order_bys' => array(
- 'sort_name' => array(
- 'title' => ts('Last Name, First Name'),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
),
),
- 'grouping' => 'contact-fields',
),
'civicrm_membership' => array(
'dao' => 'CRM_Member_DAO_Membership',
if ($value = CRM_Utils_Array::value('civicrm_entity_financial_trxn_amount', $row)) {
$rows[$rowNum]['civicrm_entity_financial_trxn_amount'] = CRM_Utils_Money::format($rows[$rowNum]['civicrm_entity_financial_trxn_amount'], $rows[$rowNum]['civicrm_financial_trxn_currency']);
}
+
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
}
}
protected $_softFrom = NULL;
- protected $_customGroupExtends = array('Contribution');
+ protected $_customGroupExtends = array(
+ 'Contact',
+ 'Individual',
+ 'Contribution'
+ );
- /**
- */
/**
*/
public function __construct() {
-
+ $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
// Check if CiviCampaign is a) enabled and b) has active campaigns
$config = CRM_Core_Config::singleton();
$campaignEnabled = in_array("CiviCampaign", $config->enableComponents);
'first_name' => array(
'title' => ts('First Name'),
),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
'last_name' => array(
'title' => ts('Last Name'),
),
'no_display' => TRUE,
'required' => TRUE,
),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
'contact_type' => array(
'title' => ts('Contact Type'),
),
'no_display' => TRUE,
'type' => CRM_Utils_Type::T_INT,
),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
+ 'grouping' => 'contact-fields',
'order_bys' => array(
'sort_name' => array(
'title' => ts('Last Name, First Name'),
'default_weight' => '0',
'default_order' => 'ASC',
),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
+ 'gender_id' => array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
- 'grouping' => 'contact-fields',
+
),
'civicrm_email' => array(
'dao' => 'CRM_Core_DAO_Email',
$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, 'contribute/detail', 'List all contribution(s) for this ') ? TRUE : $entryFound;
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
protected $_phoneField = FALSE;
protected $_relationshipColumns = array();
- protected $_customGroupExtends = array('Contribution');
+ protected $_customGroupExtends = array(
+ 'Contact',
+ 'Individual',
+ 'Contribution'
+ );
protected $_referenceYear = array(
'this_year' => '',
protected $_yearStatisticsTo = '';
- /**
- */
/**
*/
public function __construct() {
+ $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
$yearsInPast = 4;
$date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, 0);
$count = $date['maxYear'];
'required' => TRUE,
'no_repeat' => TRUE,
),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ ),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ ),
'id' => array(
'no_display' => TRUE,
'default' => TRUE,
'required' => TRUE,
),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
'contact_type' => array(
'title' => ts('Contact Type'),
),
),
),
'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
+ ),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
+ 'gender_id' => array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
+ ),
'filters' => array(
'sort_name' => array('title' => ts('Contact Name')),
'id' => array(
'title' => ts('Contact ID'),
'no_display' => TRUE,
),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
),
'civicrm_email' => array(
$rows[$rowNum]['civicrm_contact_sort_name_link'] = $url;
$rows[$rowNum]['civicrm_contact_sort_name_hover'] = ts("View Contribution Details for this Contact.");
}
+
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
}
}
*/
class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form {
-
protected $_charts = array(
'' => 'Tabular',
'barChart' => 'Bar Chart',
'pieChart' => 'Pie Chart',
);
+ protected $_customGroupExtends = array(
+ 'Contact',
+ 'Individual',
+ 'Contribution'
+ );
+
public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
protected $lifeTime_from = NULL;
protected $lifeTime_where = NULL;
- /**
- */
/**
*/
public function __construct() {
+ $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
$yearsInPast = 10;
$yearsInFuture = 1;
$date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, $yearsInFuture);
'first_name' => array(
'title' => ts('First Name'),
),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
'last_name' => array(
'title' => ts('Last Name'),
),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
+ ),
+ 'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
+ ),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
+ 'gender_id' => array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
'contact_type' => array(
'title' => ts('Contact Type'),
),
'title' => ts('Donor Name'),
'operator' => 'like',
),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
+ ),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
),
'civicrm_email' => array(
foreach ($table['filters'] as $fieldName => $field) {
$clause = NULL;
if ($fieldName == 'yid') {
- $clause = self::fiscalYearOffset('contribution_civireport.receive_date') . " = $previous_year";
+ $clause = "contribution_civireport.contact_id NOT IN
+(SELECT distinct contri.contact_id FROM civicrm_contribution contri
+ WHERE contri.is_test = 0 AND " .
+ self::fiscalYearOffset('contri.receive_date') . " = $current_year) AND contribution_civireport.contact_id IN (SELECT distinct contri.contact_id FROM civicrm_contribution contri
+ 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
) {
$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, 'contribute/detail', 'List all contribution(s)') ? TRUE : $entryFound;
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
class CRM_Report_Form_Contribute_Repeat extends CRM_Report_Form {
protected $_amountClauseWithAND = NULL;
+ protected $_customGroupExtends = array(
+ 'Contact',
+ 'Individual',
+ );
+
public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
- /**
- */
/**
*/
public function __construct() {
),
),
'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
+ ),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ ),
+ 'gender_id' => array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
+ ),
),
'civicrm_phone' => array(
'dao' => 'CRM_Core_DAO_Phone',
'barChart' => 'Bar Chart',
'pieChart' => 'Pie Chart',
);
+
+ protected $_customGroupExtends = array(
+ 'Contact',
+ 'Individual',
+ 'Contribution'
+ );
+
public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
- /**
- */
/**
*/
public function __construct() {
'no_display' => TRUE,
'required' => TRUE,
),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ ),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ ),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
+ ),
+ 'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
+ ),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
+ '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'),
+ ),
'contact_type' => array(
'title' => ts('Contact Type'),
),
'name' => 'sort_name',
'title' => ts('Soft Credit Name'),
),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
+ ),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
- 'grouping' => 'contact-fields',
),
'civicrm_email' => array(
'dao' => 'CRM_Core_DAO_Email',
$row['civicrm_contribution_soft_soft_credit_type_id']);
}
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
'barChart' => 'Bar Chart',
'pieChart' => 'Pie Chart',
);
+
+ protected $_customGroupExtends = array(
+ 'Contact',
+ 'Individual',
+ 'Contribution'
+ );
+
public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
/**
*/
public function __construct() {
+ $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
$yearsInPast = 10;
$yearsInFuture = 1;
$date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, $yearsInFuture);
'first_name' => array(
'title' => ts('First Name'),
),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
'last_name' => array(
'title' => ts('Last Name'),
),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
+ ),
+ 'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
+ ),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
+ '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'),
+ ),
'contact_type' => array(
'title' => ts('Contact Type'),
),
'title' => ts('Donor Name'),
'operator' => 'like',
),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
+ ),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
),
'civicrm_email' => array(
$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, 'contribute/detail', 'List all contribution(s)') ? TRUE : $entryFound;
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form {
protected $_summary = NULL;
+ protected $_customGroupExtends = array(
+ 'Contact',
+ 'Individual',
+ 'Contribution'
+ );
public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report');
/**
*/
public function __construct() {
+ $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
$this->_columns = array(
'civicrm_contact' => array(
'dao' => 'CRM_Contact_DAO_Contact',
'fields' => array(
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
'display_name' => array(
'title' => ts('Contact Name'),
'required' => TRUE,
'first_name' => array(
'title' => ts('First Name'),
),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
'last_name' => array(
'title' => ts('Last Name'),
),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
'contact_type' => array(
'title' => ts('Contact Type'),
),
),
),
'filters' => array(
+ 'sort_name' => array(
+ 'title' => ts('Participant Name'),
+ 'operator' => 'like',
+ ),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
+ ),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
'receive_date' => array(
'default' => 'this.year',
'operatorType' => CRM_Report_Form::OP_DATE,
}
$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, 'contribute/detail', 'List all contribution(s)') ? TRUE : $entryFound;
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
public $_drilldownReport = array('event/income' => 'Link to Detail Report');
- /**
- */
/**
*/
public function __construct() {
'no_repeat' => TRUE,
'required' => TRUE,
),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ ),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ ),
'id' => array(
'no_display' => TRUE,
'required' => TRUE,
),
+ 'gender_id' => array(
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'title' => ts('Birth Date'),
+ ),
+ 'age' => array(
+ 'title' => ts('Age'),
+ 'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
- 'grouping' => 'contact-fields',
'filters' => array(
'sort_name' => array(
'title' => ts('Participant Name'),
'operator' => 'like',
),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
+ ),
+ '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' => ts('Birth Date'),
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
+ ),
+ 'grouping' => 'contact-fields',
+ 'order_bys' => array(
+ 'sort_name' => array(
+ 'title' => ts('Last Name, First Name'),
+ 'default' => '1',
+ 'default_weight' => '0',
+ 'default_order' => 'ASC',
+ ),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
+ 'gender_id' => array(
+ 'name' => 'gender_id',
+ 'title' => ts('Gender'),
+ ),
+ 'birth_date' => array(
+ 'name' => 'birth_date',
+ 'title' => ts('Birth Date'),
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
),
'civicrm_employer' => array(
$entryFound = TRUE;
}
+ //handle gender
+ if (array_key_exists('civicrm_contact_gender_id', $row)) {
+ if ($value = $row['civicrm_contact_gender_id']) {
+ $gender = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
+ $rows[$rowNum]['civicrm_contact_gender_id'] = $gender[$value];
+ }
+ $entryFound = TRUE;
+ }
+
+ // display birthday in the configured custom format
+ if (array_key_exists('civicrm_contact_birth_date', $row)) {
+ $birthDate = $row['civicrm_contact_birth_date'];
+ if ($birthDate) {
+ $rows[$rowNum]['civicrm_contact_birth_date'] = CRM_Utils_Date::customFormat($birthDate, '%Y%m%d');
+ }
+ $entryFound = TRUE;
+ }
+
// skip looking further in rows, if first row itself doesn't
// have the column we need
if (!$entryFound) {
'first_name' => array(
'title' => ts('First Name'),
),
+ 'middle_name' => array(
+ 'title' => ts('Middle Name'),
+ ),
'last_name' => array(
'title' => ts('Last Name'),
),
'no_display' => TRUE,
'required' => TRUE,
),
+ 'employer_id' => array(
+ 'title' => ts('Organization'),
+ ),
'gender_id' => array(
'title' => ts('Gender'),
),
'title' => ts('Age at Event'),
'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, event_civireport.start_date)',
),
- 'employer_id' => array(
- 'title' => ts('Organization'),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
),
),
'grouping' => 'contact-fields',
'default_weight' => '0',
'default_order' => 'ASC',
),
+ 'first_name' => array(
+ 'name' => 'first_name',
+ 'title' => ts('First Name'),
+ ),
'gender_id' => array(
'name' => 'gender_id',
'title' => ts('Gender'),
'name' => 'age_at_event',
'title' => ts('Age at Event'),
),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
+ ),
),
'filters' => array(
'sort_name' => array(
'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
),
'birth_date' => array(
- 'title' => 'Birth Date',
+ 'title' => ts('Birth Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
- 'type' => CRM_Utils_Type::T_DATE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
),
),
),