Ejemplo n.º 1
0
 /**
  * Class constructor.
  */
 public function __construct()
 {
     $this->_columns = array();
     $this->_columns['civicrm_contact'] = array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('id' => array('title' => ts('Contact ID'), 'required' => TRUE), 'sort_name' => array('title' => ts('Contact Name'), 'required' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Contact Name')), 'source' => array('title' => ts('Contact Source'), 'type' => CRM_Utils_Type::T_STRING), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE)), 'order_bys' => array('sort_name' => array('title' => ts('Contact Name'), 'default' => TRUE, 'default_order' => 'ASC')), 'grouping' => 'contact-fields');
     $this->_columns['civicrm_mailing'] = array('dao' => 'CRM_Mailing_DAO_Mailing', 'fields' => array('mailing_name' => array('name' => 'name', 'title' => ts('Mailing'), 'default' => TRUE), 'mailing_name_alias' => array('name' => 'name', 'required' => TRUE, 'no_display' => TRUE)), 'filters' => array('mailing_id' => array('name' => 'id', 'title' => ts('Mailing'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'type' => CRM_Utils_Type::T_INT, 'options' => CRM_Mailing_BAO_Mailing::getMailingsList(), 'operator' => 'like')), 'order_bys' => array('mailing_name' => array('name' => 'name', 'title' => ts('Mailing'))), 'grouping' => 'mailing-fields');
     $this->_columns['civicrm_email'] = array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'order_bys' => array('email' => array('title' => ts('Email'), 'default_order' => 'ASC')), 'grouping' => 'contact-fields');
     $this->_columns['civicrm_phone'] = array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => NULL), 'grouping' => 'contact-fields');
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     parent::__construct();
 }
Ejemplo n.º 2
0
 function __construct()
 {
     $this->_columns = array();
     $this->_columns['civicrm_contact'] = array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('id' => array('name' => 'id', 'title' => ts('Contact ID'), 'required' => TRUE, 'no_display' => TRUE), 'sort_name' => array('title' => ts('Contact Name'), 'required' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Contact Name')), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE)), 'order_bys' => array('sort_name' => array('title' => ts('Contact Name'), 'default' => TRUE, 'default_order' => 'ASC')), 'grouping' => 'contact-fields');
     $this->_columns['civicrm_mailing'] = array('dao' => 'CRM_Mailing_DAO_Mailing', 'fields' => array('mailing_name' => array('name' => 'name', 'title' => ts('Mailing'), 'default' => TRUE)), 'filters' => array('mailing_id' => array('name' => 'id', 'title' => ts('Mailing'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'type' => CRM_Utils_Type::T_INT, 'options' => CRM_Mailing_BAO_Mailing::getMailingsList())), 'order_bys' => array('mailing_name' => array('name' => 'name', 'title' => ts('Mailing'))), 'grouping' => 'mailing-fields');
     // adding dao just to have alias
     $this->_columns['civicrm_mailing_event_bounce'] = array('dao' => 'CRM_Mailing_Event_DAO_Bounce');
     $this->_columns['civicrm_mailing_event_delivered'] = array('dao' => 'CRM_Mailing_Event_DAO_Delivered', 'fields' => array('delivery_id' => array('name' => 'id', 'title' => ts('Delivery Status'), 'default' => TRUE)), 'filters' => array('delivery_status' => array('name' => 'delivery_status', 'title' => ts('Delivery Status'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'type' => CRM_Utils_Type::T_STRING, 'options' => array('' => 'Any', 'successful' => 'Successful', 'bounced' => 'Bounced'))), 'grouping' => 'mailing-fields');
     $this->_columns['civicrm_mailing_event_unsubscribe'] = array('dao' => 'CRM_Mailing_Event_DAO_Unsubscribe', 'fields' => array('unsubscribe_id' => array('name' => 'id', 'title' => ts('Unsubscribe'), 'default' => TRUE), 'optout_id' => array('name' => 'id', 'title' => ts('Opt-out'), 'default' => TRUE, 'alias' => 'mailing_event_unsubscribe_civireport2')), 'filters' => array('is_unsubscribed' => array('name' => 'id', 'title' => ts('Unsubscribed'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('Any'), '0' => ts('No'), '1' => ts('Yes')), 'clause' => 'mailing_event_unsubscribe_civireport.id IS NULL'), 'is_optout' => array('title' => ts('Opted-out'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('Any'), '0' => ts('No'), '1' => ts('Yes')), 'clause' => 'mailing_event_unsubscribe_civireport2.id IS NULL')), 'grouping' => 'mailing-fields');
     $this->_columns['civicrm_mailing_event_reply'] = array('dao' => 'CRM_Mailing_Event_DAO_Reply', 'fields' => array('reply_id' => array('name' => 'id', 'title' => ts('Reply'))), 'filters' => array('is_replied' => array('name' => 'id', 'title' => ts('Replied'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('Any'), '0' => ts('No'), '1' => ts('Yes')), 'clause' => 'mailing_event_reply_civireport.id IS NULL')), 'grouping' => 'mailing-fields');
     $this->_columns['civicrm_mailing_event_forward'] = array('dao' => 'CRM_Mailing_Event_DAO_Forward', 'fields' => array('forward_id' => array('name' => 'id', 'title' => ts('Forwarded to Email'))), 'filters' => array('is_forwarded' => array('name' => 'id', 'title' => ts('Forwarded'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('Any'), '0' => ts('No'), '1' => ts('Yes')), 'clause' => 'mailing_event_forward_civireport.id IS NULL')), 'grouping' => 'mailing-fields');
     $this->_columns['civicrm_email'] = array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'required' => TRUE)), 'grouping' => 'contact-fields');
     $this->_columns['civicrm_phone'] = array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => NULL), 'grouping' => 'contact-fields');
     $this->_columns['civicrm_group'] = array('dao' => 'CRM_Contact_DAO_Group', 'alias' => 'cgroup', 'filters' => array('gid' => array('name' => 'group_id', 'title' => ts('Group'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'group' => TRUE, 'options' => CRM_Core_PseudoConstant::group())));
     parent::__construct();
 }
Ejemplo n.º 3
0
 /**
  * Add all the elements shared between Mailing search and advnaced search.
  *
  *
  * @param CRM_Core_Form $form
  */
 public static function buildSearchForm(&$form)
 {
     // mailing selectors
     $mailings = CRM_Mailing_BAO_Mailing::getMailingsList();
     if (!empty($mailings)) {
         $form->add('select', 'mailing_id', ts('Mailing Name(s)'), $mailings, FALSE, array('id' => 'mailing_id', 'multiple' => 'multiple', 'class' => 'crm-select2'));
     }
     CRM_Core_Form_Date::buildDateRange($form, 'mailing_date', 1, '_low', '_high', ts('From'), FALSE);
     $form->addElement('hidden', 'mailing_date_range_error');
     $form->addFormRule(array('CRM_Mailing_BAO_Query', 'formRule'), $form);
     $mailingJobStatuses = array('' => ts('- select -'), 'Complete' => 'Complete', 'Scheduled' => 'Scheduled', 'Running' => 'Running', 'Canceled' => 'Canceled');
     $form->addElement('select', 'mailing_job_status', ts('Mailing Job Status'), $mailingJobStatuses, FALSE);
     $mailingBounceTypes = CRM_Core_PseudoConstant::get('CRM_Mailing_Event_DAO_Bounce', 'bounce_type_id', array('keyColumn' => 'id', 'labelColumn' => 'name'));
     $form->add('select', 'mailing_bounce_types', ts('Bounce Types'), $mailingBounceTypes, FALSE, array('id' => 'mailing_bounce_types', 'multiple' => 'multiple', 'class' => 'crm-select2'));
     // event filters
     $form->addRadio('mailing_delivery_status', ts('Delivery Status'), CRM_Mailing_PseudoConstant::yesNoOptions('delivered'), array('allowClear' => TRUE));
     $form->addRadio('mailing_open_status', ts('Trackable Opens'), CRM_Mailing_PseudoConstant::yesNoOptions('open'), array('allowClear' => TRUE));
     $form->addRadio('mailing_click_status', ts('Trackable URLs'), CRM_Mailing_PseudoConstant::yesNoOptions('click'), array('allowClear' => TRUE));
     $form->addRadio('mailing_reply_status', ts('Trackable Replies'), CRM_Mailing_PseudoConstant::yesNoOptions('reply'), array('allowClear' => TRUE));
     $form->add('checkbox', 'mailing_unsubscribe', ts('Unsubscribe Requests'));
     $form->add('checkbox', 'mailing_optout', ts('Opt-out Requests'));
     $form->add('checkbox', 'mailing_forward', ts('Forwards'));
     // Campaign select field
     CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'mailing_campaign_id');
     $form->assign('validCiviMailing', TRUE);
 }
Ejemplo n.º 4
0
 /**
  * add all the elements shared between Mailing search and advnaced search
  *
  * @access public
  *
  * @return void
  * @static
  */
 static function buildSearchForm(&$form)
 {
     // mailing selectors
     $mailings = CRM_Mailing_BAO_Mailing::getMailingsList();
     if (!empty($mailings)) {
         $form->add('select', 'mailing_id', ts('Mailing Name(s)'), $mailings, FALSE, array('id' => 'mailing_id', 'multiple' => 'multiple', 'title' => ts('- select -')));
     }
     CRM_Core_Form_Date::buildDateRange($form, 'mailing_date', 1, '_low', '_high', ts('From'), FALSE, FALSE);
     // event filters
     $form->addRadio('mailing_delivery_status', ts('Delivery Status'), CRM_Mailing_PseudoConstant::yesNoOptions('delivered'));
     $form->addRadio('mailing_open_status', ts('Trackable Opens'), CRM_Mailing_PseudoConstant::yesNoOptions('open'));
     $form->addRadio('mailing_click_status', ts('Trackable URLs'), CRM_Mailing_PseudoConstant::yesNoOptions('click'));
     $form->addRadio('mailing_reply_status', ts('Trackable Replies'), CRM_Mailing_PseudoConstant::yesNoOptions('reply'));
     $form->add('checkbox', 'mailing_unsubscribe', ts('Unsubscribe Requests'));
     $form->add('checkbox', 'mailing_optout', ts('Opt-out Requests'));
     $form->add('checkbox', 'mailing_forward', ts('Forwards'));
     $form->assign('validCiviMailing', TRUE);
     $form->addFormRule(array('CRM_Mailing_BAO_Query', 'formRule'), $form);
 }