Commit 6e31c513 authored by bgm's avatar bgm Committed by Aegir user

Update extendedreport to 5.0

parent d6c88240
......@@ -3,17 +3,17 @@
// The record will be automatically inserted, updated, or deleted from the
// database as appropriate. For more details, see "hook_civicrm_managed" at:
// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
return array(
0 => array(
'name' => 'Extended Report - Editable Activities',
'entity' => 'ReportTemplate',
'params' => array(
'version' => 3,
'label' => 'Extended Report - Editable Activities',
'description' => 'Extended Report - editable Activity Report',
'class_name' => 'CRM_Extendedreport_Form_Report_ActivityEditable',
'report_url' => 'activityeditable',
'component' => '',
),
),
);
return [
0 => [
'name' => 'Extended Report - Editable Activities',
'entity' => 'ReportTemplate',
'params' => [
'version' => 3,
'label' => 'Extended Report - Editable Activities',
'description' => 'Extended Report - editable Activity Report',
'class_name' => 'CRM_Extendedreport_Form_Report_ActivityEditable',
'report_url' => 'activityeditable',
'component' => '',
],
],
];
......@@ -4,14 +4,17 @@
* Class CRM_Extendedreport_Form_Report_ActivityExtended
*/
class CRM_Extendedreport_Form_Report_ActivityEditable extends CRM_Extendedreport_Form_Report_ExtendedReport {
/**
* @var array
*/
protected $_customGroupExtends = array('Activity');
protected $_customGroupExtends = ['Activity'];
/**
* @var bool
*/
protected $_customGroupGroupBy = FALSE;
/**
* @var string
*/
......@@ -36,8 +39,8 @@ class CRM_Extendedreport_Form_Report_ActivityEditable extends CRM_Extendedreport
* Generate From clause.
*/
function fromClauses() {
return array(
'activity_target_from_activity'
);
return [
'activity_target_from_activity',
];
}
}
......@@ -3,17 +3,17 @@
// The record will be automatically inserted, updated, or deleted from the
// database as appropriate. For more details, see "hook_civicrm_managed" at:
// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
return array(
0 => array(
return [
0 => [
'name' => 'Extended Report - Activities',
'entity' => 'ReportTemplate',
'params' => array(
'params' => [
'version' => 3,
'label' => 'Extended Report - Activities',
'description' => 'Extended Report - Activities, includes multi-contact custom fields',
'class_name' => 'CRM_Extendedreport_Form_Report_ActivityExtended',
'report_url' => 'activityextended',
'component' => '',
),
),
);
],
],
];
......@@ -33,27 +33,27 @@ class CRM_Extendedreport_Form_Report_ActivityExtended extends CRM_Extendedreport
*/
public function __construct() {
$this->_columns = $this->getColumns(
'Contact',
array(
'prefix' => '',
'prefix_label' => 'Source Contact ::',
'filters' => TRUE,
)
) + $this->getColumns(
'Contact',
array(
[
'prefix' => '',
'prefix_label' => 'Source Contact ::',
'filters' => TRUE,
]
) + $this->getColumns(
'Contact',
[
'prefix' => 'target_',
'group_by' => TRUE,
'prefix_label' => 'Target Contact ::',
'filters' => TRUE,
)
) + $this->getColumns(
'Contact', array(
]
) + $this->getColumns(
'Contact', [
'prefix' => 'assignee_',
'prefix_label' => 'Assignee Contact ::',
'filters' => TRUE,
)
) + $this->getColumns('Activity', array('group_by' => TRUE));
]
) + $this->getColumns('Activity', ['group_by' => TRUE]);
parent::__construct();
}
......
......@@ -3,17 +3,17 @@
// The record will be automatically inserted, updated, or deleted from the
// database as appropriate. For more details, see "hook_civicrm_managed" at:
// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
return array(
0 => array(
return [
0 => [
'name' => 'Extended Report - Activity Pivot Chart',
'entity' => 'ReportTemplate',
'params' => array(
'params' => [
'version' => 3,
'label' => 'Extended Report - Activity Pivot Chart',
'description' => 'Extended Report - Activity Pivot Chart',
'class_name' => 'CRM_Extendedreport_Form_Report_ActivityPivot',
'report_url' => 'activity/pivot',
'component' => '',
),
),
);
],
],
];
......@@ -4,16 +4,27 @@
* Class CRM_Extendedreport_Form_Report_ActivityPivot
*/
class CRM_Extendedreport_Form_Report_ActivityPivot extends CRM_Extendedreport_Form_Report_ExtendedReport {
protected $_baseTable = 'civicrm_activity';
protected $_customGroupExtends = ['Activity'];
protected $skipACL = FALSE;
protected $isPivot = TRUE;
protected $_customGroupAggregates = TRUE;
protected $_aggregatesIncludeNULL = TRUE;
protected $_aggregatesAddTotal = TRUE;
protected $_rollup = 'WITH ROLLUP';
public $_drilldownReport = [];
protected $_potentialCriteria = [];
protected $_noFields = TRUE;
/**
......
......@@ -3,17 +3,17 @@
// The record will be automatically inserted, updated, or deleted from the
// database as appropriate. For more details, see "hook_civicrm_managed" at:
// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
return array(
0 => array(
return [
0 => [
'name' => 'Extended Report - Campaign progress',
'entity' => 'ReportTemplate',
'params' => array(
'params' => [
'version' => 3,
'label' => 'Extended Report - Campaign progress',
'description' => 'Extended Report - Campaign progress',
'class_name' => 'CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport',
'report_url' => 'campaign/progress',
'component' => 'CiviCampaign',
),
),
);
],
],
];
......@@ -9,12 +9,17 @@
*/
class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM_Extendedreport_Form_Report_ExtendedReport {
protected $_summary = NULL;
protected $_totalPaid = FALSE;
protected $_customGroupExtends = array(
protected $_customGroupExtends = [
'Campaign',
);
];
protected $_baseTable = 'civicrm_campaign';
protected $_customGroupGroupBy = TRUE;
/**
......@@ -40,7 +45,7 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'title' => ts('Raised'),
'type' => CRM_Utils_Type::T_MONEY,
'operatorType' => CRM_Report_Form::OP_FLOAT,
'statistics' => array('sum' => ts('Total Raised')),
'statistics' => ['sum' => ts('Total Raised')],
'is_fields' => TRUE,
'is_filters' => FALSE,
'is_group_bys' => FALSE,
......@@ -53,7 +58,7 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'title' => ts('Amount received'),
'type' => CRM_Utils_Type::T_MONEY,
'operatorType' => CRM_Report_Form::OP_FLOAT,
'statistics' => array('sum' => ts('Total Received')),
'statistics' => ['sum' => ts('Total Received')],
'is_fields' => TRUE,
'is_filters' => FALSE,
'is_group_bys' => FALSE,
......@@ -62,24 +67,24 @@ class CRM_Extendedreport_Form_Report_Campaign_CampaignProgressReport extends CRM
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
],
'balance_amount' => [
'balance_amount' => [
'title' => ts('Amount outstanding'),
'type' => CRM_Utils_Type::T_MONEY,
'operatorType' => CRM_Report_Form::OP_FLOAT,
'statistics' => array('sum' => ts('Pledges Outstanding')),
'statistics' => ['sum' => ts('Pledges Outstanding')],
'is_fields' => TRUE,
'is_filters' => FALSE,
'is_group_bys' => FALSE,
'is_order_bys' => FALSE,
'is_join_filters' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
'is_aggregate_columns' => FALSE,
'is_aggregate_rows' => FALSE,
],
'is_pledge' => [
'title' => ts('Type'),
'type' => CRM_Utils_Type::T_BOOLEAN,
'operatorType' => CRM_Report_Form::OP_SELECT,
'options' => array(0 => ts('Payment'), 1 => ts('Pledge')),
'options' => [0 => ts('Payment'), 1 => ts('Pledge')],
'alter_display' => 'alterIsPledge',
'is_fields' => TRUE,
'is_filters' => FALSE,
......@@ -226,7 +231,7 @@ LEFT JOIN
* @return string
*/
function alterIsPledge($value) {
return str_replace(array(0, 1), array(ts('Payment without pledge'),ts('Pledge')), $value);
return str_replace([0, 1], [ts('Payment without pledge'), ts('Pledge')], $value);
}
/**
......@@ -290,9 +295,9 @@ LEFT JOIN
*/
function getOperationPair($type = "string", $fieldName = NULL) {
if ($type == self::OP_SINGLEDATE) {
return array(
return [
'to' => ts('Until Date'),
);
];
}
return parent::getOperationPair($type, $fieldName);
}
......
......@@ -3,17 +3,17 @@
// The record will be automatically inserted, updated, or deleted from the
// database as appropriate. For more details, see "hook_civicrm_managed" at:
// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
return array(
0 => array(
return [
0 => [
'name' => 'Extended Report - Activity Pivot Chart (CiviCase)',
'entity' => 'ReportTemplate',
'params' => array(
'params' => [
'version' => 3,
'label' => 'Extended Report - Activity Pivot Chart (CiviCase)',
'description' => 'Extended Report - Activity Pivot Chart',
'class_name' => 'CRM_Extendedreport_Form_Report_Case_ActivityPivot',
'report_url' => 'case/activity/pivot',
'component' => 'CiviCase',
),
),
);
],
],
];
......@@ -4,41 +4,52 @@
* Class CRM_Extendedreport_Form_Report_Case_ActivityPivot
*/
class CRM_Extendedreport_Form_Report_Case_ActivityPivot extends CRM_Extendedreport_Form_Report_ExtendedReport {
protected $_baseTable = 'civicrm_activity';
protected $skipACL = FALSE;
protected $_customGroupAggregates = TRUE;
protected $_aggregatesIncludeNULL = TRUE;
protected $_aggregatesAddTotal = TRUE;
protected $_rollup = 'WITH ROLLUP';
protected $_aggregatesAddPercentage = TRUE;
public $_drilldownReport = array();
protected $_potentialCriteria = array();
public $_drilldownReport = [];
protected $_potentialCriteria = [];
protected $isPivot = TRUE;
protected $_noFields = TRUE;
/**
* Class constructor.
*/
public function __construct() {
$this->_customGroupExtended['civicrm_case'] = array(
'extends' => array('Case'),
$this->_customGroupExtended['civicrm_case'] = [
'extends' => ['Case'],
'filters' => TRUE,
'title' => ts('Case'),
);
$this->_customGroupExtended['civicrm_activity'] = array(
'extends' => array('Activity'),
];
$this->_customGroupExtended['civicrm_activity'] = [
'extends' => ['Activity'],
'filters' => TRUE,
'title' => ts('Activity'),
);
];
$this->_columns = $this->getColumns('Activity', array(
$this->_columns = $this->getColumns('Activity', [
'fields' => FALSE,
)
]
)
+ $this->getColumns('Contact', array())
+ $this->getColumns('Case', array(
+ $this->getColumns('Contact', [])
+ $this->getColumns('Case', [
'fields' => FALSE,
)
]
);
$this->_columns['civicrm_contact']['fields']['gender_id']['no_display'] = TRUE;
......@@ -53,9 +64,9 @@ class CRM_Extendedreport_Form_Report_Case_ActivityPivot extends CRM_Extendedrepo
* @return array
*/
function fromClauses() {
return array(
return [
'case_from_activity',
'contact_from_case',
);
];
}
}
......@@ -3,17 +3,17 @@
// The record will be automatically inserted, updated, or deleted from the
// database as appropriate. For more details, see "hook_civicrm_managed" at:
// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
return array(
0 => array(
return [
0 => [
'name' => 'Extended Report - Case Pivot Chart',
'entity' => 'ReportTemplate',
'params' => array(
'params' => [
'version' => 3,
'label' => 'Extended Report - Case Pivot Chart',
'description' => 'Extended Report - Case Pivot Chart',
'class_name' => 'CRM_Extendedreport_Form_Report_Case_CasePivot',
'report_url' => 'case/pivot',
'component' => 'CiviCase',
),
),
);
],
],
];
......@@ -4,18 +4,31 @@
* Class CRM_Extendedreport_Form_Report_Case_CasePivot
*/
class CRM_Extendedreport_Form_Report_Case_CasePivot extends CRM_Extendedreport_Form_Report_ExtendedReport {
protected $_baseTable = 'civicrm_case';
protected $skipACL = FALSE;
protected $_skipACLContactDeletedClause = TRUE;
protected $_customGroupAggregates = TRUE;
protected $_aggregatesIncludeNULL = TRUE;
protected $_aggregatesAddTotal = TRUE;
protected $_aggregatesAddPercentage = TRUE;
protected $_rollup = 'WITH ROLLUP';
public $_drilldownReport = array();
protected $_potentialCriteria = array();
public $_drilldownReport = [];
protected $_potentialCriteria = [];
protected $isPivot = TRUE;
protected $_noFields = TRUE;
protected $_customGroupExtends = ['Case'];
/**
......@@ -23,10 +36,10 @@ class CRM_Extendedreport_Form_Report_Case_CasePivot extends CRM_Extendedreport_F
*/
public function __construct() {
$this->_columns = $this->getColumns('Case', array(
$this->_columns = $this->getColumns('Case', [
'fields' => FALSE,
)
) + $this->getColumns('Contact', array('fields' => FALSE));
]
) + $this->getColumns('Contact', ['fields' => FALSE]);
// $this->_columns['civicrm_case']['fields']['id']['alter_display'] = 'alterCaseID';
$this->_columns['civicrm_case']['fields']['case_civireport_id']['title'] = 'Case';
......@@ -40,13 +53,25 @@ class CRM_Extendedreport_Form_Report_Case_CasePivot extends CRM_Extendedreport_F
$this->_columns['civicrm_case']['fields']['case_civireport_id']
);
$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_aggregate_columns' => TRUE],
[
'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']['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_aggregate_columns' => 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']
);
......@@ -61,8 +86,8 @@ class CRM_Extendedreport_Form_Report_Case_CasePivot extends CRM_Extendedreport_F
* @return array
*/
public function fromClauses() {
return array(
return [
'contact_from_case',
);
];
}
}
......@@ -3,11 +3,11 @@
// The record will be automatically inserted, updated, or deleted from the
// database as appropriate. For more details, see "hook_civicrm_managed" at:
// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
return array(
0 => array(
return [
0 => [
'name' => 'Extended Report - Activity Pivot Chart (CiviCase) (starting from Case)',
'entity' => 'ReportTemplate',
'params' => array(
'params' => [
'version' => 3,
'label' => 'Extended Report - Case with Activity Pivot Chart',
'description' => 'Pivot Report for Cases + activities. This report will allow you to filter by activity without filtering out cases that
......@@ -15,6 +15,6 @@ return array(
'class_name' => 'CRM_Extendedreport_Form_Report_Case_CaseWithActivityPivot',
'report_url' => 'case/activity2/pivot',
'component' => 'CiviCase',
),
),
);
],
],
];
......@@ -4,24 +4,39 @@
* Class CRM_Extendedreport_Form_Report_Case_CaseWithActivityPivot
*/
class CRM_Extendedreport_Form_Report_Case_CaseWithActivityPivot extends CRM_Extendedreport_Form_Report_ExtendedReport {
protected $_baseTable = 'civicrm_case';
protected $skipACL = FALSE;
protected $_customGroupAggregates = TRUE;
protected $_aggregatesIncludeNULL = TRUE;
protected $_aggregatesAddTotal = TRUE;
protected $_rollup = 'WITH ROLLUP';
protected $_temporary = ' TEMPORARY ';
protected $_aggregatesAddPercentage = TRUE;
public $_drilldownReport = array();
public $_drilldownReport = [];
protected $isPivot = TRUE;
protected $_noFields = TRUE;
protected $_customGroupExtends = ['Case', 'Activity'];
/**
* PreConstrain means the query gets run twice - the first time for generating temp tables
* which go in the from the second time around
*
* @var unknown
*/
protected $_preConstrain = TRUE;
/**
* Name of table that links activities to cases. The 'real' table is replaced with the name of a filtered
* temp table during processing
......@@ -29,20 +44,21 @@ class CRM_Extendedreport_Form_Report_Case_CaseWithActivityPivot extends CRM_Exte
* @var unknown
*/
protected $_caseActivityTable = 'civicrm_case_activity';
protected $_potentialCriteria = array();
protected $_potentialCriteria = [];
/**
*
*/