Commit fde96e00 authored by Mathieu Lutfy's avatar Mathieu Lutfy Committed by Aegir user

Update extendedreports ext

parent ee525db0
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
* Class CRM_Extendedreport_Form_Report_ActivityExtended * Class CRM_Extendedreport_Form_Report_ActivityExtended
*/ */
class CRM_Extendedreport_Form_Report_ActivityEditable extends CRM_Extendedreport_Form_Report_ExtendedReport { class CRM_Extendedreport_Form_Report_ActivityEditable extends CRM_Extendedreport_Form_Report_ExtendedReport {
//todo move def to getActivityColumns
/** /**
* @var array * @var array
*/ */
...@@ -26,13 +25,10 @@ class CRM_Extendedreport_Form_Report_ActivityEditable extends CRM_Extendedreport ...@@ -26,13 +25,10 @@ class CRM_Extendedreport_Form_Report_ActivityEditable extends CRM_Extendedreport
* Class constructor. * Class constructor.
*/ */
public function __construct() { public function __construct() {
$this->_columns = $this->getColumns('Activity', array('fields_defaults' => array('activity_type_id', 'details', 'subject'))) $this->_columns = $this->getColumns('Activity', ['fields_defaults' => ['activity_type_id', 'details', 'subject']])
+ $this->getColumns('Contact', array('prefix' => 'target_')); + $this->getColumns('Contact', ['prefix' => 'target_']);
$this->_columns['civicrm_activity']['fields']['id'] = array( $this->_columns['civicrm_activity']['metadata']['activity_id']['required'] = TRUE;
'title' => 'id', $this->_columns['civicrm_activity']['metadata']['activity_id']['no_display'] = TRUE;
'required' => TRUE,
'type' => CRM_Utils_Type::T_INT,
);
parent::__construct(); parent::__construct();
} }
......
...@@ -11,37 +11,25 @@ class CRM_Extendedreport_Form_Report_ActivityPivot extends CRM_Extendedreport_Fo ...@@ -11,37 +11,25 @@ class CRM_Extendedreport_Form_Report_ActivityPivot extends CRM_Extendedreport_Fo
protected $_aggregatesIncludeNULL = TRUE; protected $_aggregatesIncludeNULL = TRUE;
protected $_aggregatesAddTotal = TRUE; protected $_aggregatesAddTotal = TRUE;
protected $_rollup = 'WITH ROLLUP'; protected $_rollup = 'WITH ROLLUP';
public $_drilldownReport = array(); public $_drilldownReport = [];
protected $_potentialCriteria = array(); protected $_potentialCriteria = [];
protected $_noFields = TRUE; protected $_noFields = TRUE;
/** /**
* Class constructor. * Class constructor.
*/ */
public function __construct() { public function __construct() {
$this->_customGroupExtended['civicrm_activity'] = array( $this->_customGroupExtended['civicrm_activity'] = [
'extends' => array('Activity'), 'extends' => ['Activity'],
'filters' => TRUE, 'filters' => TRUE,
'title' => ts('Activity'), 'title' => ts('Activity'),
); ];
$this->_columns = $this->getColumns('Activity', array( $this->_columns = $this->getColumns('Activity', [
'fields' => FALSE, 'fields' => FALSE,
) ]
)// + $this->getColumns('Contact', array()) )// + $this->getColumns('Contact', array())
; ;
$this->_aggregateRowFields = array(
'activity:activity_activity_type_id' => 'Activity Type',
'activity:activity_status_id' => 'Activity Status',
'activity:activity_result' => 'Activity Result',
'activity:activity_subject' => 'Activity Subject',
// 'civicrm_contact_civireport:gender_id' => 'Gender',
);
$this->_aggregateColumnHeaderFields = array(
'activity:activity_activity_type_id' => 'Activity Type',
'activity:activity_status_id' => 'Activity Status',
);
parent::__construct(); parent::__construct();
} }
...@@ -51,6 +39,6 @@ class CRM_Extendedreport_Form_Report_ActivityPivot extends CRM_Extendedreport_Fo ...@@ -51,6 +39,6 @@ class CRM_Extendedreport_Form_Report_ActivityPivot extends CRM_Extendedreport_Fo
* @return array * @return array
*/ */
public function fromClauses() { public function fromClauses() {
return array(); return [];
} }
} }
...@@ -32,6 +32,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM ...@@ -32,6 +32,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'is_group_bys' => TRUE, 'is_group_bys' => TRUE,
'is_order_bys' => FALSE, 'is_order_bys' => FALSE,
'is_join_filters' => FALSE, 'is_join_filters' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
'options' => $this->_getOptions('Contribution', 'financial_type_id'), 'options' => $this->_getOptions('Contribution', 'financial_type_id'),
], ],
'total_amount' => [ 'total_amount' => [
...@@ -44,6 +46,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM ...@@ -44,6 +46,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'is_group_bys' => FALSE, 'is_group_bys' => FALSE,
'is_order_bys' => FALSE, 'is_order_bys' => FALSE,
'is_join_filters' => FALSE, 'is_join_filters' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
], ],
'paid_amount' => [ 'paid_amount' => [
'title' => ts('Amount received'), 'title' => ts('Amount received'),
...@@ -55,6 +59,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM ...@@ -55,6 +59,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'is_group_bys' => FALSE, 'is_group_bys' => FALSE,
'is_order_bys' => FALSE, 'is_order_bys' => FALSE,
'is_join_filters' => FALSE, 'is_join_filters' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
], ],
'balance_amount' => [ 'balance_amount' => [
'title' => ts('Amount outstanding'), 'title' => ts('Amount outstanding'),
...@@ -66,6 +72,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM ...@@ -66,6 +72,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'is_group_bys' => FALSE, 'is_group_bys' => FALSE,
'is_order_bys' => FALSE, 'is_order_bys' => FALSE,
'is_join_filters' => FALSE, 'is_join_filters' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
], ],
'is_pledge' => [ 'is_pledge' => [
'title' => ts('Type'), 'title' => ts('Type'),
...@@ -88,6 +96,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM ...@@ -88,6 +96,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'is_group_bys' => FALSE, 'is_group_bys' => FALSE,
'is_order_bys' => FALSE, 'is_order_bys' => FALSE,
'is_join_filters' => FALSE, 'is_join_filters' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
], ],
'effective_date' => [ 'effective_date' => [
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
...@@ -99,6 +109,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM ...@@ -99,6 +109,8 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'is_group_bys' => FALSE, 'is_group_bys' => FALSE,
'is_order_bys' => FALSE, 'is_order_bys' => FALSE,
'is_join_filters' => FALSE, 'is_join_filters' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
], ],
]; ];
......
...@@ -44,13 +44,6 @@ class CRM_Extendedreport_Form_Report_Case_ActivityPivot extends CRM_Extendedrepo ...@@ -44,13 +44,6 @@ class CRM_Extendedreport_Form_Report_Case_ActivityPivot extends CRM_Extendedrepo
$this->_columns['civicrm_contact']['fields']['gender_id']['no_display'] = TRUE; $this->_columns['civicrm_contact']['fields']['gender_id']['no_display'] = TRUE;
$this->_columns['civicrm_contact']['fields']['gender_id']['title'] = 'Gender'; $this->_columns['civicrm_contact']['fields']['gender_id']['title'] = 'Gender';
$this->_aggregateRowFields = array(
'case_civireport:id' => 'Case',
'civicrm_contact_civireport:gender_id' => 'Gender',
);
$this->_aggregateColumnHeaderFields = array(
'civicrm_contact_civireport:gender_id' => 'Gender',
);
$this->_tagFilter = TRUE; $this->_tagFilter = TRUE;
$this->_groupFilter = TRUE; $this->_groupFilter = TRUE;
parent::__construct(); parent::__construct();
......
...@@ -40,27 +40,20 @@ class CRM_Extendedreport_Form_Report_Case_CasePivot extends CRM_Extendedreport_F ...@@ -40,27 +40,20 @@ class CRM_Extendedreport_Form_Report_Case_CasePivot extends CRM_Extendedreport_F
$this->_columns['civicrm_case']['filters']['case_civireport_is_deleted']['default'] = 0; $this->_columns['civicrm_case']['filters']['case_civireport_is_deleted']['default'] = 0;
$this->_columns['civicrm_case']['metadata']['case_civireport_id'] = array_merge( $this->_columns['civicrm_case']['metadata']['case_civireport_id'] = array_merge(
['is_fields' => FALSE, 'is_filters' => FALSE, 'is_group_bys' => FALSE, 'is_order_bys' => FALSE, 'is_join_filters' => FALSE], ['is_fields' => FALSE, 'is_filters' => FALSE, 'is_group_bys' => FALSE, 'is_order_bys' => FALSE, 'is_join_filters' => FALSE, 'is_aggregate_columns' => FALSE],
$this->_columns['civicrm_case']['fields']['case_civireport_id'] $this->_columns['civicrm_case']['fields']['case_civireport_id']
); );
$this->_columns['civicrm_case']['metadata']['case_civireport_status_id'] = array_merge( $this->_columns['civicrm_case']['metadata']['case_civireport_status_id'] = array_merge(
['is_fields' => FALSE, 'is_filters' => FALSE, 'is_group_bys' => FALSE, 'is_order_bys' => FALSE, 'is_join_filters' => FALSE], ['is_fields' => FALSE, 'is_filters' => FALSE, 'is_group_bys' => FALSE, 'is_order_bys' => FALSE, 'is_join_filters' => FALSE,
'is_aggregate_columns' => TRUE],
$this->_columns['civicrm_case']['fields']['case_civireport_status_id'] $this->_columns['civicrm_case']['fields']['case_civireport_status_id']
); );
$this->_columns['civicrm_case']['metadata']['case_civireport_is_deleted'] = array_merge( $this->_columns['civicrm_case']['metadata']['case_civireport_is_deleted'] = array_merge(
['is_fields' => FALSE, 'is_filters' => FALSE, 'is_group_bys' => FALSE, 'is_order_bys' => FALSE, 'is_join_filters' => FALSE], ['is_fields' => FALSE, 'is_filters' => FALSE, 'is_group_bys' => FALSE, 'is_order_bys' => FALSE, 'is_join_filters' => FALSE,
'is_aggregate_columns' => FALSE],
$this->_columns['civicrm_case']['filters']['case_civireport_is_deleted'] $this->_columns['civicrm_case']['filters']['case_civireport_is_deleted']
); );
$this->_aggregateRowFields = array(
'case_civireport:id' => 'Case',
'case_civireport:status_id' => 'Case Status',
'civicrm_contact:gender_id' => 'Gender',
);
$this->_aggregateColumnHeaderFields = array(
'civicrm_contact:gender_id' => 'Gender',
'case_civireport:status_id' => 'Case Status',
);
$this->_tagFilter = TRUE; $this->_tagFilter = TRUE;
$this->_groupFilter = TRUE; $this->_groupFilter = TRUE;
parent::__construct(); parent::__construct();
......
...@@ -61,13 +61,6 @@ class CRM_Extendedreport_Form_Report_Case_CaseWithActivityPivot extends CRM_Exte ...@@ -61,13 +61,6 @@ class CRM_Extendedreport_Form_Report_Case_CaseWithActivityPivot extends CRM_Exte
$this->_columns['civicrm_contact']['fields']['gender_id']['no_display'] = TRUE; $this->_columns['civicrm_contact']['fields']['gender_id']['no_display'] = TRUE;
$this->_columns['civicrm_contact']['fields']['gender_id']['title'] = 'Gender'; $this->_columns['civicrm_contact']['fields']['gender_id']['title'] = 'Gender';
$this->_aggregateRowFields = array(
'case_civireport:id' => 'Case',
'civicrm_contact_civireport:gender_id' => 'Gender',
);
$this->_aggregateColumnHeaderFields = array(
'civicrm_contact_civireport:gender_id' => 'Gender',
);
$this->_tagFilter = TRUE; $this->_tagFilter = TRUE;
$this->_groupFilter = TRUE; $this->_groupFilter = TRUE;
parent::__construct(); parent::__construct();
......
...@@ -27,93 +27,71 @@ class CRM_Extendedreport_Form_Report_Contact_AddressHistory extends CRM_Extended ...@@ -27,93 +27,71 @@ class CRM_Extendedreport_Form_Report_Contact_AddressHistory extends CRM_Extended
* *
* @var array * @var array
*/ */
protected $mergedContacts = array(); protected $mergedContacts = [];
public function __construct() { public function __construct() {
$this->_columns = $this->getColumns('Address', array( $addressColumns = $this->getColumns('Address', [
'fields' => TRUE, 'fields' => TRUE,
'order_by' => FALSE, 'order_bys' => FALSE,
//'fields_defaults' => array('address_name', 'street_address', 'supplemental_address_1', 'supplemental_address_2', 'city', 'state_province_id', 'country_id', 'postal_code', 'county_id'), //'fields_defaults' => array('address_name', 'street_address', 'supplemental_address_1', 'supplemental_address_2', 'city', 'state_province_id', 'country_id', 'postal_code', 'county_id'),
'fields_defaults' => array('display_address'), 'fields_defaults' => ['display_address'],
) ]
); )['civicrm_address']['metadata'];
$this->_columns['log_civicrm_address'] = $this->_columns['civicrm_address']; $logMetaData = array_merge($addressColumns, [
unset($this->_columns['civicrm_address']); 'id' => [
$logMetaData = array(
'id' => array(
'name' => 'id', 'name' => 'id',
'title' => ts('Address ID'), 'title' => ts('Address ID'),
'type' => CRM_Utils_Type::T_INT, 'type' => CRM_Utils_Type::T_INT,
'is_fields' => TRUE, 'is_fields' => TRUE,
'no_display' => TRUE, 'no_display' => TRUE,
), ],
'contact_id' => array( 'contact_id' => [
'name' => 'contact_id', 'name' => 'contact_id',
'title' => ts('Contact ID'), 'title' => ts('Contact ID'),
'type' => CRM_Utils_Type::T_INT, 'type' => CRM_Utils_Type::T_INT,
'is_fields' => TRUE, 'is_fields' => TRUE,
'is_filters' => TRUE, 'is_filters' => TRUE,
), 'is_contact_filter' => TRUE,
'log_date' => array( ],
'log_date' => [
'name' => 'log_date', 'name' => 'log_date',
'title' => ts('Change Date'), 'title' => ts('Change Date'),
'type' => CRM_Utils_Type::T_TIMESTAMP, 'type' => CRM_Utils_Type::T_TIMESTAMP,
'is_fields' => TRUE, 'is_fields' => TRUE,
'default' => 1, ],
), 'log_conn_id' => [
'log_conn_id' => array(
'name' => 'log_conn_id', 'name' => 'log_conn_id',
'title' => ts('Connection'), 'title' => ts('Connection'),
'type' => CRM_Utils_Type::T_STRING, 'type' => CRM_Utils_Type::T_STRING,
'is_fields' => TRUE, 'is_fields' => TRUE,
'default' => 1, ],
), 'log_user_id' => [
'log_user_id' => array(
'name' => 'log_user_id', 'name' => 'log_user_id',
'title' => ts('Changed By'), 'title' => ts('Changed By'),
'type' => CRM_Utils_Type::T_INT, 'type' => CRM_Utils_Type::T_INT,
'is_fields' => TRUE, 'is_fields' => TRUE,
'default' => 1, 'is_contact_filter' => TRUE,
), ],
'log_action' => array( 'log_action' => [
'name' => 'log_action', 'name' => 'log_action',
'title' => ts('Change action'), 'title' => ts('Change action'),
'type' => CRM_Utils_Type::T_STRING, 'type' => CRM_Utils_Type::T_STRING,
'is_fields' => TRUE, 'is_fields' => TRUE,
'default' => 1, ],
), ]);
);
foreach ($logMetaData as $index => $field) { $this->_columns = $this->buildColumns($logMetaData, 'log_civicrm_address', NULL, 'address',
foreach (['filters', 'join_filters', 'group_bys', 'order_bys'] as $type) { ['fields_defaults' => ['address_display', 'log_action', 'log_user_id', 'log_conn_id', 'log_date']],
$logMetaData[$index]['is_' . $type] = FALSE; ['order_by' => FALSE, 'no_field_disambiguation' => TRUE]
} );
$logMetaData[$index]['dbAlias'] = $this->_columns['log_civicrm_address']['alias'] . '.' . $field['name'];
$logMetaData[$index]['alias'] = $this->_columns['log_civicrm_address']['alias'] . '_' . $field['name'];
}
$this->_columns['log_civicrm_address']['metadata'] += $logMetaData;
$this->_columns['log_civicrm_address']['fields'] += $logMetaData;
$this->_columns['log_civicrm_address']['filters']['contact_id'] = $logMetaData['contact_id'];
$activityTypes = civicrm_api3('Activity', 'getoptions', array('field' => 'activity_type_id')); $activityTypes = civicrm_api3('Activity', 'getoptions', ['field' => 'activity_type_id']);
$this->activityTypeID = array_search('Contact Deleted by Merge', $activityTypes['values']); $this->activityTypeID = array_search('Contact Deleted by Merge', $activityTypes['values']);
parent::__construct(); parent::__construct();
} }
/**
public function alterDisplay(&$rows) {
parent::alterDisplay($rows);
// Process rows in reverse order.
$oldestUnprocessedRowIndex = (count($rows) - 1);
while ($oldestUnprocessedRowIndex > -1) {
$row = &$rows[$oldestUnprocessedRowIndex];
$oldestUnprocessedRowIndex--;
}
return $rows;
}*/
/** /**
* Build order by clause. * Build order by clause.
*/ */
...@@ -136,26 +114,32 @@ class CRM_Extendedreport_Form_Report_Contact_AddressHistory extends CRM_Extended ...@@ -136,26 +114,32 @@ class CRM_Extendedreport_Form_Report_Contact_AddressHistory extends CRM_Extended
* @return null|string * @return null|string
*/ */
public function whereClause(&$field, $op, $value, $min, $max) { public function whereClause(&$field, $op, $value, $min, $max) {
if ($field['name'] === 'contact_id' && $value) { if ($field['name'] === 'contact_id' && $value) {
$this->contactID = (int) $value; $this->contactID = (int) $value;
$mergedContactIDs = $this->getContactsMergedIntoThisOne($this->contactID); $mergedContactIDs = $this->getContactsMergedIntoThisOne($this->contactID);
$clause = parent::whereClause($field, 'in', array_merge(array($this->contactID), $mergedContactIDs), $min, $max); $clause = parent::whereClause($field, 'in', array_merge([$this->contactID], $mergedContactIDs), $min, $max);
return $clause; return $clause;
} }
} }
/** /**
* Get all the contacts previously merged into the selected contact.
*
* @param int $contactID * @param int $contactID
* @return int *
* @return array
*/ */
protected function getContactsMergedIntoThisOne($contactID) { protected function getContactsMergedIntoThisOne($contactID) {
// @todo get api joins working properly. // @todo get api joins working properly.
$result = civicrm_api3('Activity', 'get', array( $result = civicrm_api3('Activity', 'get', [
'assignee_contact_id' => $contactID, 'assignee_contact_id' => $contactID,
'return' => 'id', 'return' => 'id',
'activity_type_id' => $this->activityTypeID, 'activity_type_id' => $this->activityTypeID,
'api.ActivityContact.get' => array('record_type_id' => 'Activity Targets', 'return' => 'contact_id') 'api.ActivityContact.get' => [
)); 'record_type_id' => 'Activity Targets',
'return' => 'contact_id',
],
]);
if ($result['count']) { if ($result['count']) {
foreach ($result['values'] as $resultRow) { foreach ($result['values'] as $resultRow) {
if (!empty($resultRow['api.ActivityContact.get'])) { if (!empty($resultRow['api.ActivityContact.get'])) {
......
...@@ -6,35 +6,35 @@ ...@@ -6,35 +6,35 @@
class CRM_Extendedreport_Form_Report_Contact_Basiccontact extends CRM_Extendedreport_Form_Report_ExtendedReport { class CRM_Extendedreport_Form_Report_Contact_Basiccontact extends CRM_Extendedreport_Form_Report_ExtendedReport {
protected $_baseTable = 'civicrm_contact'; protected $_baseTable = 'civicrm_contact';
protected $skipACL = FALSE; protected $skipACL = FALSE;
protected $_joinFilters = array('address_from_contact' => array('civicrm_address' => 'is_primary = 1 ')); protected $_joinFilters = ['address_from_contact' => ['civicrm_address' => 'is_primary = 1 ']];
/** /**
* Class constructor. * Class constructor.
*/ */
public function __construct() { public function __construct() {
$this->_templates = array( $this->_templates = [
'default' => 'default template', 'default' => 'default template',
'PhoneBank' => 'Phone Bank template - Phone.tpl', 'PhoneBank' => 'Phone Bank template - Phone.tpl',
); ];
$this->_columns = $this->getColumns('Contact', array( $this->_columns = $this->getColumns('Contact', [
'fields' => TRUE, 'fields' => TRUE,
'order_by' => FALSE, 'order_by' => FALSE,
) ]
) + ) +
$this->getColumns('Address', array( $this->getColumns('Address', [
'fields' => TRUE, 'fields' => TRUE,
'order_by' => FALSE, 'order_by' => FALSE,
) ]
) + ) +
$this->getColumns('Email', array( $this->getColumns('Email', [
'fields' => TRUE, 'fields' => TRUE,
'order_by' => FALSE, 'order_by' => FALSE,
) ]
) + ) +
$this->getColumns('LatestActivity', array( $this->getColumns('LatestActivity', [
'filters' => FALSE, 'filters' => FALSE,
'fields' => array('activity_type' => array('title' => 'Latest Activity')), 'fields' => ['activity_type' => ['title' => 'Latest Activity']],
)) + ]) +
$this->getColumns('Tag') + $this->getColumns('Tag') +
$this->getColumns('Phone'); $this->getColumns('Phone');
$this->_columns['civicrm_contact']['fields']['id']['required'] = TRUE; $this->_columns['civicrm_contact']['fields']['id']['required'] = TRUE;
...@@ -47,13 +47,13 @@ class CRM_Extendedreport_Form_Report_Contact_Basiccontact extends CRM_Extendedre ...@@ -47,13 +47,13 @@ class CRM_Extendedreport_Form_Report_Contact_Basiccontact extends CRM_Extendedre
* @return array * @return array
*/ */
function fromClauses() { function fromClauses() {
return array( return [
'address_from_contact', 'address_from_contact',
'email_from_contact', 'email_from_contact',
'phone_from_contact', 'phone_from_contact',
'latestactivity_from_contact', 'latestactivity_from_contact',
'entitytag_from_contact', 'entitytag_from_contact',
); ];
} }
function groupBy() { function groupBy() {
......
...@@ -18,18 +18,12 @@ class CRM_Extendedreport_Form_Report_Contact_Extendedcontact extends CRM_Extende ...@@ -18,18 +18,12 @@ class CRM_Extendedreport_Form_Report_Contact_Extendedcontact extends CRM_Extende
* Class constructor. * Class constructor.
*/ */
public function __construct() { public function __construct() {
$this->_columns = $this->getColumns('Contact', array( $this->_columns = $this->getColumns('Contact', [
'fields' => FALSE, 'fields' => FALSE,
'order_by' => FALSE, 'order_by' => FALSE,
) ]
); );
$this->_columns['civicrm_contact']['fields']['id']['required'] = TRUE; $this->_columns['civicrm_contact']['fields']['id']['required'] = TRUE;
$this->_aggregateColumnHeaderFields = array(
'civicrm_contact:gender_id' => 'Gender',
);
$this->_aggregateRowFields = array(
'civicrm_contact:gender_id' => 'Gender',
);
parent::__construct(); parent::__construct();
} }
} }
...@@ -32,18 +32,8 @@ class CRM_Extendedreport_Form_Report_Contribute_ContributionPivot extends CRM_Ex ...@@ -32,18 +32,8 @@ class CRM_Extendedreport_Form_Report_Contribute_ContributionPivot extends CRM_Ex
'fields' => FALSE, 'fields' => FALSE,
)) + $this->_columns = $this->getColumns('Address', array( )) + $this->_columns = $this->getColumns('Address', array(
'fields' => FALSE, 'fields' => FALSE,
'aggregate_rows' => TRUE,
)); ));
$this->_aggregateRowFields = array(
'contribution:contribution_campaign_id' => 'Campaign',
'address:address_county_id' => 'County',
'address:address_city' => 'City',
'contribution:contribution_financial_type_id' => 'Financial Type',
);
$this->_aggregateColumnHeaderFields = array(
'contribution:contribution_financial_type_id' => 'Financial Type',
'contribution:contribution_campaign_id' => 'Campaign',
);
parent::__construct(); parent::__construct();
} }
......
...@@ -89,6 +89,8 @@ class CRM_Extendedreport_Form_Report_Contribute_DetailExtended extends CRM_Exten ...@@ -89,6 +89,8 @@ class CRM_Extendedreport_Form_Report_Contribute_DetailExtended extends CRM_Exten
'is_fields' => FALSE, 'is_fields' => FALSE,
'is_group_bys' => FALSE, 'is_group_bys' => FALSE,
'is_order_bys' => FALSE, 'is_order_bys' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
'type' => CRM_Utils_Type::T_INT, 'type' => CRM_Utils_Type::T_INT,
'alias' => 'cordinality_cordinality' 'alias' => 'cordinality_cordinality'
]], ]],
......
...@@ -59,6 +59,8 @@ class CRM_Extendedreport_Form_Report_Contribute_LoggingSummary extends CRM_Exten ...@@ -59,6 +59,8 @@ class CRM_Extendedreport_Form_Report_Contribute_LoggingSummary extends CRM_Exten
'type' => CRM_Utils_Type::T_INT, 'type' => CRM_Utils_Type::T_INT,
'is_fields' => TRUE, 'is_fields' => TRUE,
'no_display' => FALSE, 'no_display' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
); );