Ejemplo n.º 1
0
  /**
   * Class constructor.
   */
  public function __construct() {
    $this->_customGroupExtended['civicrm_event'] = array(
      'extends' => array('Event'),
      'filters' => TRUE,
      'title' => ts('Event'),
    );
    $this->_customGroupExtended['civicrm_participant'] = array(
      'extends' => array('Participant'),
      'filters' => TRUE,
      'title' => ts('Participant'),
    );

    $this->_columns = $this->getColumns('Event', array(
          'fields' => FALSE,
        )
      )
      + $this->getColumns('Participant', array('fields' => FALSE,))
      + $this->getColumns('Contact', array('fields' => FALSE,));
    $this->_columns['civicrm_event']['fields']['id']['required'] = TRUE;
    $this->_columns['civicrm_event']['fields']['id']['alter_display'] = 'alterEventID';
    $this->_columns['civicrm_event']['fields']['id']['title'] = 'Event';

    $this->_aggregateRowFields = array(
      'event:id' => 'Event',
    );

    $this->_aggregateColumnHeaderFields = array(
      'participant:status_id' => ts('Participant Status'),
    );
    $this->_groupFilter = TRUE;
    parent::__construct();
  }
Ejemplo n.º 2
0
  /**
   * Class constructor.
   */
  public function __construct() {
    $this->_customGroupExtended['civicrm_contribution'] = array(
      'extends' => array('Contribution'),
      'filters' => TRUE,
      'title' => ts('Contribution'),
    );

    $this->_columns = $this->getColumns('Contribution', array(
        'fields' => FALSE,
    )) +
    $this->_columns = $this->getColumns('Contact', array(
      'fields' => FALSE,
    )) + $this->_columns = $this->getColumns('Address', array(
       'fields' => FALSE,
    ));

    $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();
  }
Ejemplo n.º 3
0
  /**
   *
   */
  function __construct() {
    $this->_customGroupExtended['civicrm_activity'] = array(
      'extends' => array('Activity'),
      'filters' => TRUE,
      'title' => ts('Activity'),
    );

    $this->_columns = $this->getColumns('Activity', array(
        'fields' => FALSE,
      )
    )//   + $this->getColumns('Contact', array())
    ;
    //    $this->_columns['civicrm_contact']['fields']['id']['required'] = true;
    //    $this->_columns['civicrm_contact']['fields']['gender_id']['no_display'] = true;
    //    $this->_columns['civicrm_contact']['fields']['gender_id']['title'] = 'Gender';

    $this->_aggregateRowFields = array(
      'activity:activity_activity_type_id' => 'Activity Type',
      'activity: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_activity_status_id' => 'Activity Status',
    );
    parent::__construct();
  }
Ejemplo n.º 4
0
 /**
  * Class constructor.
  */
 public function __construct() {
   $this->_templates = array(
     'default' => 'default template',
     'PhoneBank' => 'Phone Bank template - Phone.tpl',
   );
   $this->_columns = $this->getColumns('Contact', array(
         'fields' => TRUE,
         'order_by' => FALSE,
       )
     ) +
     $this->getColumns('Address', array(
         'fields' => TRUE,
         'order_by' => FALSE,
       )
     ) +
     $this->getColumns('Email', array(
         'fields' => TRUE,
         'order_by' => FALSE,
       )
     ) +
     $this->getColumns('LatestActivity', array(
         'filters' => FALSE,
         'fields' => array('activity_type' => array('title' => 'Latest Activity')),
     )) +
     $this->getColumns('Tag') +
     $this->getColumns('Phone');
   $this->_columns['civicrm_contact']['fields']['id']['required'] = TRUE;
   $this->addTemplateSelector();
   $this->_groupFilter = TRUE;
   parent::__construct();
 }
Ejemplo n.º 5
0
  /**
   * Class constructor.
   */
  public function __construct() {
    $this->_customGroupExtended['civicrm_membership'] = array(
      'extends' => array('Membership'),
      'filters' => TRUE,
      'title' => ts('Membership'),
    );
    $this->_columns = $this->getColumns('membership', array(
        'fields' => FALSE,
        'order_by' => FALSE,
      )
    ) + $this->getColumns('contact', array(
        'fields' => FALSE,
        'order_by' => FALSE,
      )
    );
    $this->_columns['civicrm_membership']['fields']['id']['required'] = TRUE;

    $this->_aggregateRowFields = array(
      'membership:membership_membership_type_id' => 'Membership Type',
      'membership:membership_membership_status_id' => 'Membership Status',
    );
    $this->_aggregateColumnHeaderFields = array(
      'membership:membership_membership_type_id' => 'Membership Type',
      'membership:membership_membership_status_id' => 'Membership Status',
    );
    parent::__construct();
  }
Ejemplo n.º 6
0
 /**
  * Class constructor.
  */
 public function __construct() {
   $this->_columns = $this->getColumns('Event');
   $this->_columns['civicrm_event']['fields']['id'] = array(
     'title' => 'id',
     'required' => TRUE,
   );
   parent::__construct();
 }
Ejemplo n.º 7
0
 /**
  * Class constructor.
  */
 public function __construct() {
   $this->_columns = $this->getColumns('Contact', array(
       'fields' => FALSE,
       'order_by' => FALSE,
     )
   );
   $this->_columns['civicrm_contact']['fields']['id']['required'] = TRUE;
   parent::__construct();
 }
Ejemplo n.º 8
0
 /**
  * Class constructor.
  */
 public function __construct() {
   $this->_columns
     = $this->getColumns('Contact')
     + $this->getColumns('Contribution')
     + $this->getColumns('PriceField')
     + $this->getColumns('PriceFieldValue')
     + $this->getColumns('LineItem');
   parent::__construct();
 }
Ejemplo n.º 9
0
 /**
  * Class constructor.
  */
 public function __construct() {
   $this->_columns = $this->getColumns('Activity')
     + $this->getColumns('Contact', array('prefix' => 'target_',));
   $this->_columns['civicrm_activity']['fields']['id'] = array(
     'title' => 'id',
     'required' => TRUE,
   );
   parent::__construct();
 }
Ejemplo n.º 10
0
 /**
  * Class constructor.
  */
 public function __construct() {
   $this->_columns
     = $this->getColumns('Contact', array('order_by' => TRUE))
     + $this->getColumns('Event')
     + $this->getColumns('Participant')
     + $this->getColumns('Contribution', array('order_by' => TRUE))
     + $this->getColumns('PriceField', array('order_by' => TRUE))
     + $this->getColumns('PriceFieldValue' , array('order_by' => TRUE))
     + $this->getColumns('LineItem', array('order_by' => TRUE));
   parent::__construct();
 }
Ejemplo n.º 11
0
  /**
   * constructor
   * @todo allow filtering on other contacts
   */
  function __construct() {
    $this->_columns = $this->getColumns('Contact', array(
          'prefix' => '',
          'prefix_label' => 'Source Contact ::',
          'filters' => TRUE,
        ))
      + $this->getColumns('Contact', array(
          'prefix' => 'target_',
          'group_by' => TRUE,
          'prefix_label' => 'Target Contact ::',
          'filters' => FALSE,
        ))
      + $this->getColumns('Contact', array(
          'prefix' => 'assignee_',
          'prefix_label' => 'Assignee Contact ::',
          'filters' => FALSE,
        ))

      + $this->getColumns('Activity');
    parent::__construct();
  }
Ejemplo n.º 12
0
  /**
   *
   */
  function __construct() {
    $this->_customGroupExtended['civicrm_case'] = array(
      'extends' => array('Case'),
      'filters' => TRUE,
      'title' => ts('Case'),
    );

    $this->_columns = $this->getColumns('Case', array(
          'fields' => FALSE,
        )
      )
      + $this->getColumns('Contact', array());
    $this->_columns['civicrm_case']['fields']['id']['required'] = TRUE;
    $this->_columns['civicrm_contact']['fields']['id']['required'] = TRUE;
    //  $this->_columns['civicrm_case']['fields']['id']['alter_display'] = 'alterCaseID';
    $this->_columns['civicrm_case']['fields']['id']['title'] = 'Case';
    $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']['alter_display'] = 'alterGenderID';
    $this->_columns['civicrm_case']['fields']['case_status_id']['title'] = ts('Case Status');
    $this->_columns['civicrm_case']['fields']['case_status_id']['options'] = CRM_Case_BAO_Case::buildOptions('status_id');
    $this->_columns['civicrm_contact']['fields']['case_status_id']['no_display'] = TRUE;
    $this->_columns['civicrm_case']['fields']['case_status_id']['name'] = 'status_id';
    $this->_columns['civicrm_case']['filters']['case_is_deleted']['default'] = 0;


    $this->_aggregateRowFields = array(
      'case_civireport:id' => 'Case',
      'case_civireport:case_status_id' => 'Case Status',
      'civicrm_contact_civireport:gender_id' => 'Gender',
    );
    $this->_aggregateColumnHeaderFields = array(
      'civicrm_contact_civireport:gender_id' => 'Gender',
      'case_civireport:case_status_id' => 'Case Status',
    );
    $this->_tagFilter = TRUE;
    $this->_groupFilter = TRUE;
    parent::__construct();
  }
Ejemplo n.º 13
0
  /**
   *
   */
  function __construct() {
    $this->_customGroupExtended['civicrm_case'] = array(
      'extends' => array('Case'),
      'filters' => TRUE,
      'title' => ts('Case'),
    );
    $this->_customGroupExtended['civicrm_activity'] = array(
      'extends' => array('Activity'),
      'filters' => TRUE,
      'title' => ts('Activity'),
    );

    $this->_columns = $this->getColumns('Case', array(
          'fields' => FALSE,
        )
      )
      + $this->getColumns('Contact', array())
      + $this->_columns = $this->getColumns('Activity', array(
          'fields' => FALSE,
        )
      );
    $this->_columns['civicrm_case']['fields']['id']['required'] = TRUE;
    $this->_columns['civicrm_contact']['fields']['id']['required'] = TRUE;
    //  $this->_columns['civicrm_case']['fields']['id']['alter_display'] = 'alterCaseID';
    $this->_columns['civicrm_case']['fields']['id']['title'] = 'Case';
    $this->_columns['civicrm_contact']['fields']['gender_id']['no_display'] = TRUE;
    $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->_groupFilter = TRUE;
    parent::__construct();
  }
Ejemplo n.º 14
0
  /**
   * Class constructor.
   */
  public function __construct() {
    $this->_columns = $this->getColumns('Contact')
    + $this->getColumns('Address')
    + $this->getColumns('Phone', array('subquery' => FALSE,))
    + $this->getColumns('Email')
    + $this->getColumns('Membership')
    + $this->getColumns('FinancialAccount')
    + $this->getColumns('LineItem')
    + array(
      'civicrm_contribution' => array(
        'dao' => 'CRM_Contribute_DAO_Contribution',
        'fields' => array(
          'receive_date' => array(
            'default' => TRUE
          ),
          'invoice_id' => array(
            'title' => ts('Invoice ID'),
            'default' => TRUE,
          ),
          'contribution_status_id' => array(
            'title' => ts('Contribution Status'),
            'default' => TRUE,
          ),
          'id' => array(
            'title' => ts('Contribution #'),
            'default' => TRUE,
          ),
        ),
        'filters' => array(
          'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
          'contribution_status_id' => array(
            'title' => ts('Contribution Status'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
            'default' => array(1),
          ),
        ),
        'order_bys' => array(
          'contribution_id' => array('title' => ts('Contribution #')),
          'contribution_status_id' => array('title' => ts('Contribution Status')),
        ),
        'grouping' => 'contri-fields',
      ),)
    + array(
      'civicrm_financial_trxn' => array(
        'dao' => 'CRM_Financial_DAO_FinancialTrxn',
        'fields' => array(
          'check_number' => array(
            'title' => ts('Cheque #'),
            'default' => TRUE,
          ),
          'payment_instrument_id' => array(
            'title' => ts('Payment Instrument'),
            'default' => TRUE,
            'alter_display' => 'alterPaymentType',
          ),
          'currency' => array(
            'required' => TRUE,
            'no_display' => TRUE,
          ),
          'trxn_date' => array(
            'title' => ts('Transaction Date'),
            'default' => TRUE,
            'type' => CRM_Utils_Type::T_DATE,
          ),
          'trxn_id' => array(
            'title' => ts('Trans #'),
            'default' => TRUE,
          ),
        ),
        'filters' => array(
          'payment_instrument_id' => array(
            'title' => ts('Payment Instrument'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Contribute_PseudoConstant::paymentInstrument(),
          ),
          'currency' => array(
            'title' => 'Currency',
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
            'default' => NULL,
            'type' => CRM_Utils_Type::T_STRING,
          ),
          'trxn_date' => array(
            'title' => ts('Transaction Date'),
            'operatorType' => CRM_Report_Form::OP_DATE,
            'type' => CRM_Utils_Type::T_DATE,
          ),
        ),
        'order_bys' => array(
          'payment_instrument_id' => array('title' => ts('Payment Instrument')),
        ),
      ),
    ) + array(
      'civicrm_entity_financial_trxn' => array(
        'dao' => 'CRM_Financial_DAO_EntityFinancialTrxn',
        'fields' => array(
          'amount' => array(
            'title' => ts('Amount'),
            'default' => TRUE,
            'type' => CRM_Utils_Type::T_STRING,
          ),
        ),
        'filters' => array(
          'amount' => array('title' => ts('Amount')),
        ),
      ),
    );

    $this->_groupFilter = TRUE;
    $this->_tagFilter = TRUE;
    parent::__construct();
  }
Ejemplo n.º 15
0
 /**
  * Class constructor.
  */
 public function __construct() {
   $this->_columns = $this->getColumns('Event', array()) +
   $this->getColumns('EventSummary');
   parent::__construct();
 }
Ejemplo n.º 16
0
  /**
   * Class constructor.
   */
  public function __construct() {
    $this->_autoIncludeIndexedFieldsAsOrderBys = 1;

    // Check if CiviCampaign is a) enabled and b) has active campaigns
    $config = CRM_Core_Config::singleton();
    $campaignEnabled = in_array("CiviCampaign", $config->enableComponents);
    if ($campaignEnabled) {
      $getCampaigns = CRM_Campaign_BAO_Campaign::getPermissionedCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
      $this->activeCampaigns = $getCampaigns['campaigns'];
      asort($this->activeCampaigns);
    }

    $this->_columns = array(
      'civicrm_contact' => array_merge($this->getColumns('Contact'), array(
        'dao' => 'CRM_Contact_DAO_Contact',
        'fields' => array(
          'sort_name' => array(
            'title' => ts('Participant Name'),
            'required' => TRUE,
            'no_repeat' => TRUE,
            'dbAlias' => 'contact_civireport.sort_name',
          ),
          'first_name' => array(
            'title' => ts('First Name'),
          ),
          'last_name' => array(
            'title' => ts('Last Name'),
          ),
          'id' => array(
            'no_display' => TRUE,
            'required' => TRUE,
          ),
          'gender_id' => array(
            'title' => ts('Gender'),
          ),
          'birth_date' => array(
            'title' => ts('Birth Date'),
          ),
          'age' => array(
            'title' => ts('Age'),
            'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, CURDATE())',
          ),
          'age_at_event' => array(
            'title' => ts('Age at Event'),
            'dbAlias' => 'TIMESTAMPDIFF(YEAR, contact_civireport.birth_date, event_civireport.start_date)',
          ),
          'employer_id' => array(
            'title' => ts('Organization'),
          ),
        ),
        'grouping' => 'contact-fields',
        'order_bys' => array(
          'sort_name' => array(
            'title' => ts('Last Name, First Name'),
            'default' => '1',
            'default_weight' => '0',
            'default_order' => 'ASC',
          ),
          'gender_id' => array(
            'name' => 'gender_id',
            'title' => ts('Gender'),
          ),
          'birth_date' => array(
            'name' => 'birth_date',
            'title' => ts('Birth Date'),
          ),
          'age_at_event' => array(
            'name' => 'age_at_event',
            'title' => ts('Age at Event'),
          ),
        ),
        'filters' => array(
          'sort_name' => array(
            'title' => ts('Participant Name'),
            'operator' => 'like',
          ),
          'gender_id' => array(
            'title' => ts('Gender'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id'),
          ),
          'birth_date' => array(
            'title' => 'Birth Date',
            'operatorType' => CRM_Report_Form::OP_DATE,
            'type' => CRM_Utils_Type::T_DATE,
          ),
        ),
      )),
      'civicrm_email' => array(
        'dao' => 'CRM_Core_DAO_Email',
        'fields' => array(
          'email' => array(
            'title' => ts('Email'),
            'no_repeat' => TRUE,
          ),
        ),
        'grouping' => 'contact-fields',
        'filters' => array(
          'email' => array(
            'title' => ts('Participant E-mail'),
            'operator' => 'like',
          ),
        ),
      ),
      'civicrm_address' => array(
        'dao' => 'CRM_Core_DAO_Address',
        'fields' => array(
          'street_address' => NULL,
          'city' => NULL,
          'postal_code' => NULL,
          'state_province_id' => array(
            'title' => ts('State/Province'),
          ),
          'country_id' => array(
            'title' => ts('Country'),
          ),
        ),
        'grouping' => 'contact-fields',
      ),
      'civicrm_participant' => array(
        'dao' => 'CRM_Event_DAO_Participant',
        'fields' => array(
          'participant_id' => array('title' => 'Participant ID'),
          'participant_record' => array(
            'name' => 'id',
            'no_display' => TRUE,
            'required' => TRUE,
          ),
          'event_id' => array(
            'default' => TRUE,
            'type' => CRM_Utils_Type::T_STRING,
          ),
          'status_id' => array(
            'title' => ts('Status'),
            'default' => TRUE,
          ),
          'role_id' => array(
            'title' => ts('Role'),
            'default' => TRUE,
          ),
          'fee_currency' => array(
            'required' => TRUE,
            'no_display' => TRUE,
          ),
          'participant_fee_level' => NULL,
          'participant_fee_amount' => NULL,
          'participant_register_date' => array('title' => ts('Registration Date')),
        ),
        'grouping' => 'event-fields',
        'filters' => array(
          'event_id' => array(
            'name' => 'event_id',
            'title' => ts('Event'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => $this->getEventFilterOptions(),
          ),
          'sid' => array(
            'name' => 'status_id',
            'title' => ts('Participant Status'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'),
          ),
          'rid' => array(
            'name' => 'role_id',
            'title' => ts('Participant Role'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Event_PseudoConstant::participantRole(),
          ),
          'participant_register_date' => array(
            'title' => 'Registration Date',
            'operatorType' => CRM_Report_Form::OP_DATE,
          ),
          'fee_currency' => array(
            'title' => ts('Fee Currency'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
            'default' => NULL,
            'type' => CRM_Utils_Type::T_STRING,
          ),

        ),
        'order_bys' => array(
          'event_id' => array(
            'title' => ts('Event'),
            'default_weight' => '1',
            'default_order' => 'ASC',
          ),
        ),
      ),
    ) +
    $this->getColumns('Phone') + array(
      'civicrm_event' => array(
        'dao' => 'CRM_Event_DAO_Event',
        'fields' => array(
          'event_type_id' => array('title' => ts('Event Type')),
          'event_start_date' => array('title' => ts('Event Start Date')),
        ),
        'grouping' => 'event-fields',
        'filters' => array(
          'eid' => array(
            'name' => 'event_type_id',
            'title' => ts('Event Type'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Core_OptionGroup::values('event_type'),
          ),
          'event_start_date' => array(
            'title' => ts('Event Start Date'),
            'operatorType' => CRM_Report_Form::OP_DATE,
          ),
        ),
        'order_bys' => array(
          'event_type_id' => array(
            'title' => ts('Event Type'),
            'default_weight' => '2',
            'default_order' => 'ASC',
          ),
        ),
      ),
      'civicrm_contribution' => array(
        'dao' => 'CRM_Contribute_DAO_Contribution',
        'fields' => array(
          'contribution_id' => array(
            'name' => 'id',
            'no_display' => TRUE,
            'required' => TRUE,
            'csv_display' => TRUE,
            'title' => ts('Contribution ID'),
          ),
          'financial_type_id' => array('title' => ts('Financial Type')),
          'receive_date' => array('title' => ts('Payment Date')),
          'contribution_status_id' => array('title' => ts('Contribution Status')),
          'payment_instrument_id' => array('title' => ts('Payment Type')),
          'contribution_source' => array(
            'name' => 'source',
            'title' => ts('Contribution Source'),
          ),
          'currency' => array(
            'required' => TRUE,
            'no_display' => TRUE,
          ),
          'trxn_id' => NULL,
          'honor_type_id' => array('title' => ts('Honor Type')),
          'fee_amount' => array('title' => ts('Transaction Fee')),
          'net_amount' => NULL,
        ),
        'grouping' => 'contrib-fields',
        'filters' => array(
          'receive_date' => array(
            'title' => 'Payment Date',
            'operatorType' => CRM_Report_Form::OP_DATE,
          ),
          'financial_type_id' => array(
            'title' => ts('Financial Type'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Contribute_PseudoConstant::financialType(),
          ),
          'currency' => array(
            'title' => ts('Contribution Currency'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
            'default' => NULL,
            'type' => CRM_Utils_Type::T_STRING,
          ),
          'payment_instrument_id' => array(
            'title' => ts('Payment Type'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Contribute_PseudoConstant::paymentInstrument(),
          ),
          'contribution_status_id' => array(
            'title' => ts('Contribution Status'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
            'default' => NULL,
          ),
        ),
      ),
      'civicrm_line_item' => array(
        'dao' => 'CRM_Price_DAO_LineItem',
        'grouping' => 'priceset-fields',
        'filters' => array(
          'price_field_value_id' => array(
            'name' => 'price_field_value_id',
            'title' => ts('Fee Level'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => $this->getPriceLevels(),
          ),
        ),
      ),
    )
    + $this->getColumns('Relationship', array(
        'fields' => FALSE,
        'filters' => FALSE,
        'join_filters' => TRUE,
        'group_by' => FALSE,
    )) +
    $this->getColumns('Contact', array(
        'fields' => TRUE,
        'join_fields' => TRUE,
        'filters' => FALSE,
        'prefix' => 'related_',
        'prefix_label' => 'Related Contact ',
    )) +
    $this->getColumns('Email', array(
      'prefix' => 'related_',
      'prefix_label' => 'Related Contact ',
    )) +
    $this->getColumns('Phone', array(
      'fields' => TRUE,
      'join_fields' => TRUE,
      'filters' => FALSE,
      'prefix' => 'related_',
      'prefix_label' => 'Related Contact ',
    ));

    $this->_options = array(
      'blank_column_begin' => array(
        'title' => ts('Blank column at the Beginning'),
        'type' => 'checkbox',
      ),
      'blank_column_end' => array(
        'title' => ts('Blank column at the End'),
        'type' => 'select',
        'options' => array(
          '' => '-select-',
          1 => ts('One'),
          2 => ts('Two'),
          3 => ts('Three'),
        ),
      ),
    );

    // If we have active campaigns add those elements to both the fields and filters
    if ($campaignEnabled && !empty($this->activeCampaigns)) {
      $this->_columns['civicrm_participant']['fields']['campaign_id'] = array(
        'title' => ts('Campaign'),
        'default' => 'false',
      );
      $this->_columns['civicrm_participant']['filters']['campaign_id'] = array(
        'title' => ts('Campaign'),
        'operatorType' => CRM_Report_Form::OP_MULTISELECT,
        'options' => $this->activeCampaigns,
      );
      $this->_columns['civicrm_participant']['order_bys']['campaign_id'] = array(
        'title' => ts('Campaign'),
      );
    }

    $this->_currencyColumn = 'civicrm_participant_fee_currency';
    parent::__construct();
  }
Ejemplo n.º 17
0
  /**
   * Class constructor.
   */
  public function __construct() {
    $this->_tagFilter = TRUE;

    $this->_columns = $this->getColumns('Contact', array(
        'prefix' => 'contact_a_',
        'prefix_label' => 'Contact A ::'
      ))
      + $this->getColumns('Contact', array(
        'prefix' => 'contact_b_',
        'prefix_label' => 'Contact B ::',
      ))
      + $this->getColumns('Email', array(
        'prefix' => 'contact_a_',
        'prefix_label' => 'Contact A ::',
      ))
      + $this->getColumns('Email', array(
        'prefix' => 'contact_b_',
        'prefix_label' => 'Contact B ::',
      ))
      + $this->getColumns('Phone', array(
        'prefix' => 'contact_a_',
        'prefix_label' => 'Contact A ::',
        'subquery' => FALSE,
      ))
      + $this->getColumns('Phone', array(
        'prefix' => 'contact_b_',
        'prefix_label' => 'Contact B ::',
        'subquery' => FALSE,
      ))
      + $this->getColumns('Relationship') + array(
        'civicrm_relationship_type' => array(
          'dao' => 'CRM_Contact_DAO_RelationshipType',
          'fields' => array(
            'label_a_b' => array(
              'title' => ts('Relationship A-B '),
              'default' => TRUE
            ),
            'label_b_a' => array(
              'title' => ts('Relationship B-A '),
              'default' => TRUE
            )
          ),
          'filters' => array(
            'contact_type_a' => array(
              'title' => ts('Contact Type  A'),
              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
              'options' => $this->getContactTypeOptions(),
              'type' => CRM_Utils_Type::T_STRING
            ),
            'contact_type_b' => array(
              'title' => ts('Contact Type  B'),
              'operatorType' => CRM_Report_Form::OP_MULTISELECT,
              'options' => $this->getContactTypeOptions(),
              'type' => CRM_Utils_Type::T_STRING
            ),
          ),
          'grouping' => 'relation-fields',
        ),
        '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()
            ),
          ),
        ),
      )
      + $this->getColumns('Case')
      + $this->getColumns('Address', array(
          'prefix' => 'contact_a_',
          'prefix_label' => 'Contact A ::',
        )
      )
      + $this->getColumns('Address', array(
          'prefix' => 'contact_b_',
          'prefix_label' => 'Contact B ::',
        )
      );
    parent::__construct();
  }
Ejemplo n.º 18
0
  /**
   * Class constructor.
   */
  public function __construct() {
    $yearsInPast = 8;
    $yearsInFuture = 2;
    $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, $yearsInFuture);
    $count = $date['maxYear'];
    while ($date['minYear'] <= $count) {
      $optionYear[$date['minYear']] = $date['minYear'];
      $date['minYear']++;
    }

    $this->_columns = array(
      'civicrm_contact' => array(
        'dao' => 'CRM_Contact_DAO_Contact',
        'grouping' => 'contact-field',
        'fields' => array(
          'display_name' => array(
            'title' => ts('Donor Name'),
            'default' => TRUE,
            'required' => TRUE,
          ),
        ),
        'filters' => array(
          'sort_name' => array(
            'title' => ts('Donor Name'),
            'operator' => 'like',
          ),
        ),
      ),
      'civicrm_email' => array(
        'dao' => 'CRM_Core_DAO_Email',
        'grouping' => 'contact-field',
        'fields' => array(
          'email' => array(
            'title' => ts('Email'),
            'default' => TRUE,
          ),
        ),
      ),
      'civicrm_phone' => array(
        'dao' => 'CRM_Core_DAO_Phone',
        'grouping' => 'contact-field',
        'fields' => array(
          'phone' => array(
            'title' => ts('Phone No'),
            'default' => TRUE,
          ),
        ),
      ),
      'civicrm_pledge' => array(
        'dao' => 'CRM_Pledge_DAO_Pledge',
        'fields' => array(
          'contact_id' => array(
            'title' => ts('contactId'),
            'no_display' => TRUE,
            'required' => TRUE,
            'no_repeat' => TRUE,
          ),
          'amount' => array(
            'title' => ts('Total Amount'),
            'no_display' => TRUE,
            'required' => TRUE,
            'no_repeat' => TRUE,

          ),
          'start_date' => array(
            'title' => ts('Year'),
            'no_display' => TRUE,
            'required' => TRUE,
            'no_repeat' => TRUE,
            'type' => CRM_Utils_Type::T_INT,
          ),
        ),
        'filters' => array(
          'yid' => array(
            'name' => 'start_date',
            'title' => ts('This Year'),
            'operatorType' => CRM_Report_Form::OP_SELECT,
            'type'    => CRM_Utils_Type::T_INT,
            'options' => $optionYear,
            'default' => date('Y'),
          ),
          'status_id' => array(
            'title' => ts('Pledge status'),
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
            'default' => array('1')
          ),
        ),
      ),
      'civicrm_group' => array(
        'dao' => 'CRM_Contact_DAO_GroupContact',
        '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()
          ),
        ),
      ),
    );

    $this->_tagFilter = TRUE;
    parent::__construct();

  }
Ejemplo n.º 19
0
  /**
   * Class constructor.
   */
  public function __construct() {
    $yearsInPast = 8;
    $yearsInFuture = 2;
    $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, $yearsInFuture);
    $count = $date['maxYear'];
    while ($date['minYear'] <= $count) {
      $optionYear[$date['minYear']] = $date['minYear'];
      $date['minYear']++;
    }

    $this->_columns = array(
      'civicrm_contact' => array(
        'dao' => 'CRM_Contact_DAO_Contact',
        'grouping' => 'contact-field',
        'fields' => array(
          'display_name' => array(
            'title' => ts('Donor Name'),
            'default' => TRUE,
            'required' => TRUE,
          ),
        ),
        'filters' => array(
          'sort_name' => array(
            'title' => ts('Donor Name'),
            'operator' => 'like',
          ),
        ),
      ),
      'civicrm_email' => array(
        'dao' => 'CRM_Core_DAO_Email',
        'grouping' => 'contact-field',
        'fields' => array(
          'email' => array(
            'title' => ts('Email'),
            'default' => TRUE,
          ),
        ),
      ),
      'civicrm_phone' => array(
        'dao' => 'CRM_Core_DAO_Phone',
        'grouping' => 'contact-field',
        'fields' => array(
          'phone' => array(
            'title' => ts('Phone No'),
            'default' => TRUE,
          ),
        ),
      ),
      'civicrm_pledge' => array(
        'dao' => 'CRM_Pledge_DAO_Pledge',
        'fields' => array(
          'contact_id' => array(
            'title' => ts('contactId'),
            'required' => TRUE,
            'no_repeat' => TRUE,
            'type' => CRM_Utils_Type::T_INT,
          ),
          'amount' => array(
            'title' => ts('Total Amount'),
            'required' => TRUE,
            'no_repeat' => TRUE,
            'type' => CRM_Utils_Type::T_MONEY,
          ),
          'start_date' => array(
            'title' => ts('Start Date (within range)'),
            'required' => TRUE,
            'no_repeat' => TRUE,
            'type' => CRM_Utils_Type::T_DATE,
          ),
        ),
        'filters' => array(
          'yid' => array(
            'name' => 'start_date',
            'title' => ts('Last Pledge Start Date'),
            'type' => CRM_Utils_Type::T_DATE,
            'operatorType' => CRM_Report_Form::OP_DATE,
            'clause' => "pledge_civireport.contact_id IN
              (SELECT distinct pledge.contact_id FROM civicrm_pledge pledge
               WHERE pledge.start_date  BETWEEN '\$from' AND '\$to' AND pledge.is_test = 0
            )
            AND pledge_civireport.contact_id NOT IN
            (SELECT distinct pledge.contact_id FROM civicrm_pledge pledge
             WHERE pledge.start_date >=  ('\$to') AND pledge.is_test = 0) ",
          ),
          'status_id' => array(
            'title' => 'Pledge Status',
            'operatorType' => CRM_Report_Form::OP_MULTISELECT,
            'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
            'default' => array(
              '1',
            ),
          ),
        ),
      ),
      'civicrm_group' => array(
        'dao' => 'CRM_Contact_DAO_GroupContact',
        '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()
          )
        )
      )
    );

    $this->_tagFilter = TRUE;
    parent::__construct();
  }