'bar_3dChart' => 'Bar Chart',
);
+ public $campaignEnabled = False;
+
function __construct() {
$this->_columns = array();
),
),
);
-
+ $config = CRM_Core_Config::singleton();
+ $this->campaignEnabled = in_array("CiviCampaign", $config->enableComponents);
+ if ($this->campaignEnabled) {
+ $this->_columns['civicrm_campaign'] = array(
+ 'dao' => 'CRM_Campaign_DAO_Campaign',
+ 'fields' => array(
+ 'title' => array(
+ 'title' => ts('Campaign Name'),
+ ),
+ ),
+ 'filters' => array(
+ 'title' => array(
+ 'type' => CRM_Utils_Type::T_STRING,
+ ),
+ ),
+ );
+ }
parent::__construct();
}
ON {$this->_aliases['civicrm_mailing_event_trackable_url_open']}.event_queue_id = {$this->_aliases['civicrm_mailing_event_queue']}.id
LEFT JOIN civicrm_mailing_event_unsubscribe {$this->_aliases['civicrm_mailing_event_unsubscribe']}
ON {$this->_aliases['civicrm_mailing_event_unsubscribe']}.event_queue_id = {$this->_aliases['civicrm_mailing_event_queue']}.id";
+
+ if ($this->campaignEnabled) {
+ $this->_from .= "
+ LEFT JOIN civicrm_campaign {$this->_aliases['civicrm_campaign']}
+ ON {$this->_aliases['civicrm_campaign']}.id = {$this->_aliases['civicrm_mailing']}.campaign_id";
+ }
+
// need group by and order by
//print_r($this->_from);
$from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params);
$to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params);
- $clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']);
+ $clause = $this->dateClause($this->_aliases[$tableName] . '.' . $field['name'], $relative, $from, $to, $field['type']);
}
else {
$op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params);