systopia / de.systopia.campaign

SYSTOPIA's Google Summer of Code project: CampaignManager
https://campaignmanager.systopia.de/
Other
6 stars 19 forks source link

Basic activities reporting to campaign screen #33

Closed scardinius closed 7 years ago

scardinius commented 7 years ago

I'm working on feature which will add some basic activities reporting to campaign screen. We'd like to have a table with totals of all activities for current campaign and its children.

Requirements

Example

Result:

Type Scheduled Completed Cancelled Others Total
Bulk Email (19) 0 0 0 0 0
Meeting (1) 0 0 0 2 2
Petition Signature (32) 154 368 52 0 574
Reminder Sent (40) 0 404 0 0 404
Total 154 772 52 2 980

Draft schema

CREATE TABLE config_activity_type (
  activity_type_id INT UNSIGNED PRIMARY KEY COMMENT 'Activity type which will be displayed',
  is_fixed INT UNSIGNED DEFAULT 0 COMMENT '0 : show only when data exists, 1 : show always'
);

CREATE TABLE config_activity_status (
  activity_type_id INT UNSIGNED COMMENT '',
  status_id INT UNSIGNED COMMENT 'Status which you want to display',
  grouping VARCHAR(64) NOT NULL COMMENT 'Statuses can by grouped by label. By default grouping is equal label of status',
  PRIMARY KEY (activity_type_id, status_id),
  KEY civicrm_campaign_config_activity_status_label_ind (grouping)
);

CREATE TABLE config_status_sequence (
  grouping VARCHAR(64) PRIMARY KEY ,
  sequence INT UNSIGNED NOT NULL
);

Example configuration

config_activity_type

activity_type_id is_fixed
1 (Meeting) 0
4 (Outbound SMS) 0
19 (Bulk Email) 1
32 (Petition Signature) 0
40 (Reminder Sent) 0

config_activity_status

activity_type_id status_id grouping
1 1 Scheduled
1 2 Completed
1 3 Cancelled
1 4 Other
1 5 Other
1 6 Other
1 7 Other
1 8 Other

The same for other types

config_status_sequence

grouping sequence
Scheduled 10
Completed 20
Cancelled 30
Left Message 40
Unreachable 50
Not Required 60
Available 70
No-show 80
Other 1000

What do you think @systopia ?

bjendres commented 7 years ago

great job!