コード例 #1
0
ファイル: Attendance.php プロジェクト: pzingg/sfschool
 function __construct()
 {
     $this->_columns = array();
     $query = "\nSELECT column_name, label , option_group_id\nFROM civicrm_custom_field\nWHERE is_active = 1 AND column_name = '{$this->_colMapper['dayOfWeek']}'";
     $dao_column = CRM_Core_DAO::executeQuery($query);
     $this->_optionFields = array();
     while ($dao_column->fetch()) {
         if ($dao_column->option_group_id) {
             $query = "\nSELECT label , value\nFROM   civicrm_option_value \nWHERE  option_group_id = {$dao_column->option_group_id}\nAND    is_active = 1\n";
             $dao = CRM_Core_DAO::executeQuery($query);
             while ($dao->fetch()) {
                 $this->_optionFields[$dao_column->column_name][$dao->value] = $dao->label;
             }
         }
     }
     $query = "\nSELECT distinct {$this->_colMapper['sessionName']} as session_name \nFROM   sfschool_extended_care_source value_extended_care_2_civireport\nWHERE  is_active = 1\nAND    term = %1\n";
     require_once 'SFS/Utils/ExtendedCare.php';
     $params = array(1 => array(SFS_Utils_ExtendedCare::getTerm(), 'String'));
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     $sOptions = array();
     while ($dao->fetch()) {
         $sOptions[$dao->session_name] = $dao->session_name;
     }
     $this->_columns[$this->_customTable] = array('dao' => 'CRM_Contact_DAO_Contact', 'filters' => array('weekday' => array('title' => ts('Day Of Week'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $this->_optionFields[$this->_colMapper['dayOfWeek']])));
     parent::__construct();
 }
コード例 #2
0
ファイル: Demographics.php プロジェクト: hguru/224Civi
 function __construct()
 {
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'required' => TRUE, 'no_repeat' => TRUE), 'gender_id' => array('title' => ts('Gender'), 'default' => TRUE), 'birth_date' => array('title' => ts('Birthdate'), 'default' => FALSE), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Contact Name'), 'operatorType' => CRM_Report_Form::OP_STRING), 'contact_type' => array('title' => ts('Contact Type'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('-select-'), 'Individual' => ts('Individual'), 'Organization' => ts('Organization'), 'Household' => ts('Household')), 'default' => 'Individual'), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'grouping' => 'contact-fields', 'fields' => array('street_address' => array('default' => FALSE), 'city' => array('default' => TRUE), 'postal_code' => NULL, 'state_province_id' => array('title' => ts('State/Province')), 'country_id' => array('title' => ts('Country'), 'default' => FALSE))), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => NULL), 'grouping' => 'contact-fields'), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('id' => array('title' => ts('Activity ID'), 'no_display' => TRUE, 'required' => TRUE))), 'civicrm_case' => array('dao' => 'CRM_Case_DAO_Case', 'fields' => array('id' => array('title' => ts('Case ID'), 'required' => TRUE), 'start_date' => array('title' => ts('Case Start'), 'required' => TRUE), 'end_date' => array('title' => ts('Case End'), 'required' => TRUE)), 'filters' => array('case_id_filter' => array('name' => 'id', 'title' => ts('Cases?'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array(1 => ts('Exclude non-case'), 2 => ts('Exclude cases'), 3 => ts('Include Both')), 'default' => 3), 'start_date' => array('title' => ts('Case Start'), 'operatorType' => CRM_Report_Form::OP_DATE), 'end_date' => array('title' => ts('Case End'), 'operatorType' => CRM_Report_Form::OP_DATE))), '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->_tagFilter = TRUE;
     $open_case_val = CRM_Core_OptionGroup::getValue('activity_type', 'Open Case', 'name');
     $crmDAO =& CRM_Core_DAO::executeQuery("SELECT cg.table_name, cg.extends AS ext, cf.label, cf.column_name FROM civicrm_custom_group cg INNER JOIN civicrm_custom_field cf ON cg.id = cf.custom_group_id\nwhere (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_column_value='{$open_case_val}') AND cg.is_active=1 AND cf.is_active=1 ORDER BY cg.table_name");
     $curTable = '';
     $curExt = '';
     $curFields = array();
     while ($crmDAO->fetch()) {
         if ($curTable == '') {
             $curTable = $crmDAO->table_name;
             $curExt = $crmDAO->ext;
         } elseif ($curTable != $crmDAO->table_name) {
             // dummy DAO
             $this->_columns[$curTable] = array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => $curFields, 'ext' => $curExt);
             $curTable = $crmDAO->table_name;
             $curExt = $crmDAO->ext;
             $curFields = array();
         }
         $curFields[$crmDAO->column_name] = array('title' => $crmDAO->label);
     }
     if (!empty($curFields)) {
         // dummy DAO
         $this->_columns[$curTable] = array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => $curFields, 'ext' => $curExt);
     }
     $this->_genders = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'gender_id');
     parent::__construct();
 }
コード例 #3
0
ファイル: Repeat.php プロジェクト: nganivet/civicrm-core
 /**
  */
 public function __construct()
 {
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'grouping' => 'contact-fields', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'no_repeat' => TRUE, 'default' => TRUE), 'display_name' => array('title' => ts('Display Name'), 'no_repeat' => TRUE), 'addressee_display' => array('title' => ts('Addressee Name'), 'no_repeat' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE), 'contact_type' => array('title' => ts('Contact Type'), 'no_repeat' => TRUE), 'contact_sub_type' => array('title' => ts('Contact Subtype'), 'no_repeat' => TRUE)), 'filters' => array('percentage_change' => array('title' => ts('Percentage Change'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_INT, 'name' => 'percentage_change', 'dbAlias' => '( ( contribution_civireport2.total_amount_sum - contribution_civireport1.total_amount_sum ) * 100 / contribution_civireport1.total_amount_sum )')), 'group_bys' => array('id' => array('title' => ts('Contact'), 'default' => TRUE))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields', 'order_bys' => array('sort_name' => array('title' => ts('Last Name, First Name'), 'default' => '1', 'default_weight' => '0', 'default_order' => 'ASC'), 'first_name' => array('title' => ts('First Name')), 'gender_id' => array('name' => 'gender_id', 'title' => ts('Gender')), 'birth_date' => array('name' => 'birth_date', 'title' => ts('Birth Date')), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype')))), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Phone'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'grouping' => 'contact-fields', 'fields' => array('street_address' => array('title' => ts('Street Address')), 'supplemental_address_1' => array('title' => ts('Supplemental Address 1')), 'city' => array('title' => ts('City')), 'country_id' => array('title' => ts('Country')), 'state_province_id' => array('title' => ts('State/Province')), 'postal_code' => array('title' => ts('Postal Code'))), 'group_bys' => array('country_id' => array('title' => ts('Country')), 'state_province_id' => array('title' => ts('State/Province')))), 'civicrm_financial_type' => array('dao' => 'CRM_Financial_DAO_FinancialType', 'fields' => array('financial_type' => array('title' => ts('Financial Type'))), 'grouping' => 'contri-fields', 'group_bys' => array('financial_type' => array('name' => 'id', 'title' => ts('Financial Type')))), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contribution_source' => NULL, 'total_amount1' => array('name' => 'total_amount', 'alias' => 'contribution1', 'title' => ts('Range One Stat'), 'type' => CRM_Utils_Type::T_MONEY, 'default' => TRUE, 'required' => TRUE, 'clause' => 'contribution_civireport1.total_amount_count as contribution1_total_amount_count, contribution_civireport1.total_amount_sum as contribution1_total_amount_sum'), 'total_amount2' => array('name' => 'total_amount', 'alias' => 'contribution2', 'title' => ts('Range Two Stat'), 'type' => CRM_Utils_Type::T_MONEY, 'default' => TRUE, 'required' => TRUE, 'clause' => 'contribution_civireport2.total_amount_count as contribution2_total_amount_count, contribution_civireport2.total_amount_sum as contribution2_total_amount_sum')), 'grouping' => 'contri-fields', 'filters' => array('receive_date1' => array('title' => ts('Initial Date Range'), 'default' => 'previous.year', 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE, 'name' => 'receive_date'), 'receive_date2' => array('title' => ts('Second Date Range'), 'default' => 'this.year', 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE, 'name' => 'receive_date'), 'total_amount1' => array('title' => ts('Range One Amount'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_INT, 'name' => 'total_amount'), 'total_amount2' => array('title' => ts('Range Two Amount'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_INT, 'name' => 'total_amount'), 'financial_type_id' => array('title' => ts('Financial Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::financialType()), 'contribution_status_id' => array('title' => ts('Contribution Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array('1'))), 'group_bys' => array('contribution_source' => NULL)));
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     parent::__construct();
 }
コード例 #4
0
 /**
  */
 public function __construct()
 {
     $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('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Donor Name'), 'required' => TRUE, 'no_repeat' => TRUE), 'first_name' => array('title' => ts('First Name'), 'no_repeat' => TRUE), 'last_name' => array('title' => ts('Last Name'), 'no_repeat' => TRUE), 'contact_type' => array('title' => ts('Contact Type'), 'no_repeat' => TRUE), 'contact_sub_type' => array('title' => ts('Contact Subtype'), 'no_repeat' => TRUE), 'do_not_email' => array('title' => ts('Do Not Email'), 'no_repeat' => TRUE), 'is_opt_out' => array('title' => ts('No Bulk Email(Is Opt Out)'), 'no_repeat' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE, 'csv_display' => TRUE, 'title' => ts('Contact ID'))), 'filters' => array('sort_name' => array('title' => ts('Donor Name'), 'operator' => 'like'), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Donor Email'), 'default' => TRUE, 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Donor Phone'), 'default' => TRUE, 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'first_donation' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('first_donation_date' => array('title' => ts('First Contribution Date'), 'base_field' => 'receive_date', 'no_repeat' => TRUE), 'first_donation_amount' => array('title' => ts('First Contribution Amount'), 'base_field' => 'total_amount', 'no_repeat' => TRUE))), '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'), 'default' => TRUE), 'contribution_recur_id' => array('title' => ts('Recurring Contribution Id'), 'name' => 'contribution_recur_id', 'required' => TRUE, 'no_display' => TRUE, 'csv_display' => TRUE), '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, 'receive_date' => array('default' => TRUE), 'receipt_date' => NULL, 'fee_amount' => NULL, 'net_amount' => NULL, 'total_amount' => array('title' => ts('Amount'), 'required' => TRUE)), 'filters' => array('receive_date' => array('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' => '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' => array(1)), 'total_amount' => array('title' => ts('Contribution Amount'))), 'grouping' => 'contri-fields'), 'civicrm_product' => array('dao' => 'CRM_Contribute_DAO_Product', 'fields' => array('product_name' => array('name' => 'name', 'title' => ts('Premium')))), 'civicrm_contribution_product' => array('dao' => 'CRM_Contribute_DAO_ContributionProduct', 'fields' => array('product_id' => array('no_display' => TRUE), 'product_option' => array('title' => ts('Premium Option')), 'fulfilled_date' => array('title' => ts('Premium Fulfilled Date')), 'contribution_id' => array('no_display' => TRUE))), 'civicrm_contribution_ordinality' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'alias' => 'cordinality', 'filters' => array('ordinality' => array('title' => ts('Contribution Ordinality'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => array(0 => 'First by Contributor', 1 => 'Second or Later by Contributor')))), 'civicrm_membership' => array('dao' => 'CRM_Member_DAO_Membership', 'fields' => array('membership_type_id' => array('title' => ts('Membership Type'), 'required' => TRUE, 'no_repeat' => TRUE), 'membership_start_date' => array('title' => ts('Start Date'), 'default' => TRUE), 'membership_end_date' => array('title' => ts('End Date'), 'default' => TRUE), 'join_date' => array('title' => ts('Join Date'), 'default' => TRUE), 'source' => array('title' => ts('Membership Source'))), 'filters' => array('join_date' => array('operatorType' => CRM_Report_Form::OP_DATE), 'membership_start_date' => array('operatorType' => CRM_Report_Form::OP_DATE), 'membership_end_date' => array('operatorType' => CRM_Report_Form::OP_DATE), 'owner_membership_id' => array('title' => ts('Membership Owner ID'), 'operatorType' => CRM_Report_Form::OP_INT), 'tid' => array('name' => 'membership_type_id', 'title' => ts('Membership Types'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipType())), 'grouping' => 'member-fields'), 'civicrm_membership_status' => array('dao' => 'CRM_Member_DAO_MembershipStatus', 'alias' => 'mem_status', 'fields' => array('membership_status_name' => array('name' => 'name', 'title' => ts('Membership Status'), 'default' => TRUE)), 'filters' => array('sid' => array('name' => 'id', 'title' => ts('Membership Status'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'))), 'grouping' => 'member-fields'), 'civicrm_note' => array('dao' => 'CRM_Core_DAO_Note', 'fields' => array('contribution_note' => array('name' => 'note', 'title' => ts('Contribution Note'))), 'filters' => array('note' => array('name' => 'note', 'title' => ts('Contribution Note'), 'operator' => 'like', 'type' => CRM_Utils_Type::T_STRING)))) + $this->addAddressFields(FALSE);
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     // Don't show Batch display column and filter unless batches are being used
     $this->_allBatches = CRM_Batch_BAO_Batch::getBatches();
     if (!empty($this->_allBatches)) {
         $this->_columns['civicrm_batch']['dao'] = 'CRM_Batch_DAO_Batch';
         $this->_columns['civicrm_batch']['fields']['batch_id'] = array('name' => 'id', 'title' => ts('Batch Name'));
         $this->_columns['civicrm_batch']['filters']['bid'] = array('name' => 'id', 'title' => ts('Batch Name'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->_allBatches);
         $this->_columns['civicrm_entity_batch']['dao'] = 'CRM_Batch_DAO_EntityBatch';
         $this->_columns['civicrm_entity_batch']['fields']['entity_batch_id'] = array('name' => 'batch_id', 'default' => TRUE, 'no_display' => TRUE);
     }
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
         $this->_columns['civicrm_contribution']['fields']['campaign_id'] = array('title' => ts('Campaign'), 'default' => 'false');
         $this->_columns['civicrm_contribution']['filters']['campaign_id'] = array('title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns);
         $this->_columns['civicrm_contribution']['order_bys']['campaign_id'] = array('title' => ts('Campaign'));
     }
     $this->_currencyColumn = 'civicrm_contribution_currency';
     parent::__construct();
 }
コード例 #5
0
 function __construct()
 {
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'no_repeat' => TRUE), 'postal_greeting_display' => array('title' => ts('Postal Greeting')), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'grouping' => 'contact-fields', 'group_bys' => array('id' => array('title' => ts('Contact ID')), 'sort_name' => array('title' => ts('Contact Name')))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('no_repeat' => TRUE, 'title' => ts('email'))), 'grouping' => 'contact-fields'), 'civicrm_pledge' => array('dao' => 'CRM_Pledge_DAO_Pledge', 'fields' => array('id' => array('no_display' => TRUE, 'required' => FALSE), 'currency' => array('required' => TRUE, 'no_display' => TRUE), 'amount' => array('title' => ts('Pledge Amount'), 'required' => TRUE, 'type' => CRM_Utils_Type::T_MONEY, 'statistics' => array('sum' => ts('Aggregate Amount Pledged'), 'count' => ts('Pledges'), 'avg' => ts('Average'))), 'frequency_unit' => array('title' => ts('Frequency Unit')), 'installments' => array('title' => ts('Installments')), 'pledge_create_date' => array('title' => ts('Pledge Made Date')), 'start_date' => array('title' => ts('Pledge Start Date'), 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('Pledge End Date'), 'type' => CRM_Utils_Type::T_DATE), 'status_id' => array('title' => ts('Pledge Status'))), 'filters' => array('pledge_create_date' => array('title' => 'Pledge Made Date', 'operatorType' => CRM_Report_Form::OP_DATE), 'pledge_amount' => array('title' => ts('Pledged Amount'), 'operatorType' => CRM_Report_Form::OP_INT), '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), 'sid' => array('name' => 'status_id', 'title' => ts('Pledge Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('contribution_status'))), 'group_bys' => array('pledge_create_date' => array('frequency' => TRUE, 'default' => TRUE, 'chart' => TRUE), 'frequency_unit' => array('title' => ts('Frequency Unit')), 'status_id' => array('title' => ts('Pledge Status')))), 'civicrm_pledge_payment' => array('dao' => 'CRM_Pledge_DAO_PledgePayment', 'fields' => array('total_paid' => array('title' => ts('Total Amount Paid'), 'type' => CRM_Utils_Type::T_STRING, 'dbAlias' => 'sum(pledge_payment_civireport.actual_amount)'))), '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->addAddressFields();
     $this->_tagFilter = TRUE;
     $this->_currencyColumn = 'civicrm_pledge_currency';
     parent::__construct();
 }
コード例 #6
0
 /**
  * Class constructor.
  */
 public function __construct()
 {
     // There could be multiple contacts. We not clear on which contact id to display.
     // Lets hide it for now.
     $this->_exposeContactID = FALSE;
     $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->engagementLevels = CRM_Campaign_PseudoConstant::engagementLevel();
     }
     $this->activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, FALSE, FALSE, 'label', TRUE);
     asort($this->activityTypes);
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('contact_source' => array('name' => 'sort_name', 'title' => ts('Source Contact Name'), 'alias' => 'civicrm_contact_source', 'no_repeat' => TRUE), 'contact_assignee' => array('name' => 'sort_name', 'title' => ts('Assignee Contact Name'), 'alias' => 'civicrm_contact_assignee', 'dbAlias' => "civicrm_contact_assignee.sort_name", 'default' => TRUE), 'contact_target' => array('name' => 'sort_name', 'title' => ts('Target Contact Name'), 'alias' => 'civicrm_contact_target', 'dbAlias' => "civicrm_contact_target.sort_name", 'default' => TRUE), 'contact_source_id' => array('name' => 'id', 'alias' => 'civicrm_contact_source', 'dbAlias' => "civicrm_contact_source.id", 'no_display' => TRUE, 'default' => TRUE, 'required' => TRUE), 'contact_assignee_id' => array('name' => 'id', 'alias' => 'civicrm_contact_assignee', 'dbAlias' => "civicrm_contact_assignee.id", 'no_display' => TRUE, 'default' => TRUE, 'required' => TRUE), 'contact_target_id' => array('name' => 'id', 'alias' => 'civicrm_contact_target', 'dbAlias' => "civicrm_contact_target.id", 'no_display' => TRUE, 'default' => TRUE, 'required' => TRUE)), 'filters' => array('contact_source' => array('name' => 'sort_name', 'alias' => 'civicrm_contact_source', 'title' => ts('Source Contact Name'), 'operator' => 'like', 'type' => CRM_Report_Form::OP_STRING), 'contact_assignee' => array('name' => 'sort_name', 'alias' => 'civicrm_contact_assignee', 'title' => ts('Assignee Contact Name'), 'operator' => 'like', 'type' => CRM_Report_Form::OP_STRING), 'contact_target' => array('name' => 'sort_name', 'alias' => 'civicrm_contact_target', 'title' => ts('Target Contact Name'), 'operator' => 'like', 'type' => CRM_Report_Form::OP_STRING), 'current_user' => array('name' => 'current_user', 'title' => ts('Limit To Current User'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('0' => ts('No'), '1' => ts('Yes')))), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('contact_source_email' => array('name' => 'email', 'title' => ts('Source Contact Email'), 'alias' => 'civicrm_email_source'), 'contact_assignee_email' => array('name' => 'email', 'title' => ts('Assignee Contact Email'), 'alias' => 'civicrm_email_assignee'), 'contact_target_email' => array('name' => 'email', 'title' => ts('Target Contact Email'), 'alias' => 'civicrm_email_target')), 'order_bys' => array('source_contact_email' => array('name' => 'email', 'title' => ts('Source Contact Email'), 'dbAlias' => 'civicrm_email_contact_source_email'))), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('id' => array('no_display' => TRUE, 'title' => ts('Activity ID'), 'required' => TRUE), 'source_record_id' => array('no_display' => TRUE, 'required' => TRUE), 'activity_type_id' => array('title' => ts('Activity Type'), 'required' => TRUE, 'type' => CRM_Utils_Type::T_STRING), 'activity_subject' => array('title' => ts('Subject'), 'default' => TRUE), 'activity_date_time' => array('title' => ts('Activity Date'), 'required' => TRUE), 'status_id' => array('title' => ts('Activity Status'), 'default' => TRUE, 'type' => CRM_Utils_Type::T_STRING), 'duration' => array('title' => ts('Duration'), 'type' => CRM_Utils_Type::T_INT), 'details' => array('title' => ts('Activity Details'))), 'filters' => array('activity_date_time' => array('default' => 'this.month', 'operatorType' => CRM_Report_Form::OP_DATE), 'activity_subject' => array('title' => ts('Activity Subject')), 'activity_type_id' => array('title' => ts('Activity Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activityTypes), 'status_id' => array('title' => ts('Activity Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::activityStatus()), 'details' => array('title' => ts('Activity Details'), 'type' => CRM_Utils_Type::T_TEXT)), 'order_bys' => array('activity_date_time' => array('title' => ts('Activity Date'), 'default_weight' => '1', 'dbAlias' => 'civicrm_activity_activity_date_time'), 'activity_type_id' => array('title' => ts('Activity Type'), 'default_weight' => '2', 'dbAlias' => "option_value_civireport")), 'grouping' => 'activity-fields', 'alias' => 'activity'), 'civicrm_activity_contact' => array('dao' => 'CRM_Activity_DAO_ActivityContact', 'fields' => array()), 'civicrm_option_value' => array('dao' => 'CRM_Core_DAO_OptionValue', 'fields' => array(), 'status_id' => array('title' => ts('Activity Status'), 'default' => TRUE, 'type' => CRM_Utils_Type::T_STRING), 'duration' => array('title' => ts('Duration'), 'type' => CRM_Utils_Type::T_INT), 'location' => array('title' => ts('Location'), 'type' => CRM_Utils_Type::T_STRING), 'details' => array('title' => ts('Activity Details'))), 'filters' => array('activity_date_time' => array('default' => 'this.month', 'operatorType' => CRM_Report_Form::OP_DATE), 'activity_subject' => array('title' => ts('Activity Subject')), 'location' => array('title' => ts('Location'), 'type' => CRM_Utils_Type::T_TEXT), 'activity_type_id' => array('title' => ts('Activity Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activityTypes), 'status_id' => array('title' => ts('Activity Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::activityStatus()), 'details' => array('title' => ts('Activity Details'), 'type' => CRM_Utils_Type::T_TEXT))) + $this->addressFields(TRUE);
     if ($campaignEnabled) {
         // Add display column and filter for Survey Results, Campaign and Engagement Index if CiviCampaign is enabled
         $this->_columns['civicrm_activity']['fields']['result'] = array('title' => 'Survey Result', 'default' => 'false');
         $this->_columns['civicrm_activity']['filters']['result'] = array('title' => ts('Survey Result'), 'operator' => 'like', 'type' => CRM_Utils_Type::T_STRING);
         if (!empty($this->activeCampaigns)) {
             $this->_columns['civicrm_activity']['fields']['campaign_id'] = array('title' => 'Campaign', 'default' => 'false');
             $this->_columns['civicrm_activity']['filters']['campaign_id'] = array('title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns);
         }
         if (!empty($this->engagementLevels)) {
             $this->_columns['civicrm_activity']['fields']['engagement_level'] = array('title' => 'Engagement Index', 'default' => 'false');
             $this->_columns['civicrm_activity']['filters']['engagement_level'] = array('title' => ts('Engagement Index'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->engagementLevels);
         }
     }
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     $this->_tagFilterTable = 'civicrm_activity';
     parent::__construct();
 }
コード例 #7
0
ファイル: Detail.php プロジェクト: kidaa30/yes
 /**
  */
 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('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Donor Name'), 'required' => TRUE), 'first_name' => array('title' => ts('First Name')), 'middle_name' => array('title' => ts('Middle 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())'), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype'))), 'filters' => array('sort_name' => array('title' => ts('Donor Name'), 'operator' => 'like'), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE, 'type' => CRM_Utils_Type::T_INT), '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' => ts('Birth Date'), 'operatorType' => CRM_Report_Form::OP_DATE), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype'))), 'grouping' => 'contact-fields', 'order_bys' => array('sort_name' => array('title' => ts('Last Name, First Name'), 'default' => '1', 'default_weight' => '0', 'default_order' => 'ASC'), 'first_name' => array('name' => 'first_name', 'title' => ts('First Name')), 'gender_id' => array('name' => 'gender_id', 'title' => ts('Gender')), 'birth_date' => array('name' => 'birth_date', 'title' => ts('Birth Date')), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype')))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Donor Email'), 'default' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Donor Phone'), 'default' => TRUE, 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contribution_id' => array('name' => 'id', 'no_display' => TRUE, 'required' => TRUE), 'list_contri_id' => array('name' => 'id', 'title' => ts('Contribution ID')), 'financial_type_id' => array('title' => ts('Financial Type'), 'default' => TRUE), 'contribution_status_id' => array('title' => ts('Contribution Status')), 'contribution_page_id' => array('title' => ts('Contribution Page')), 'source' => array('title' => ts('Source')), 'payment_instrument_id' => array('title' => ts('Payment Type')), 'check_number' => array('title' => ts('Check Number')), 'currency' => array('required' => TRUE, 'no_display' => TRUE), 'trxn_id' => NULL, 'receive_date' => array('default' => TRUE), 'receipt_date' => NULL, 'total_amount' => array('title' => ts('Amount'), 'required' => TRUE, 'statistics' => array('sum' => ts('Amount'))), 'fee_amount' => NULL, 'net_amount' => NULL, 'contribution_or_soft' => array('title' => ts('Contribution OR Soft Credit?'), 'dbAlias' => "'Contribution'"), 'soft_credits' => array('title' => ts('Soft Credits'), 'dbAlias' => "NULL"), 'soft_credit_for' => array('title' => ts('Soft Credit For'), 'dbAlias' => "NULL")), 'filters' => array('contribution_or_soft' => array('title' => ts('Contribution OR Soft Credit?'), 'clause' => "(1)", 'operatorType' => CRM_Report_Form::OP_SELECT, 'type' => CRM_Utils_Type::T_STRING, 'options' => array('both' => ts('Both'), 'contributions_only' => ts('Contributions Only'), 'soft_credits_only' => ts('Soft Credits Only'))), 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE), '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), 'financial_type_id' => array('title' => ts('Financial Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::financialType(), 'type' => CRM_Utils_Type::T_INT), 'contribution_page_id' => array('title' => ts('Contribution Page'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionPage(), 'type' => CRM_Utils_Type::T_INT), 'payment_instrument_id' => array('title' => ts('Payment Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::paymentInstrument(), 'type' => CRM_Utils_Type::T_INT), 'contribution_status_id' => array('title' => ts('Contribution Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array(1), 'type' => CRM_Utils_Type::T_INT), 'total_amount' => array('title' => ts('Contribution Amount'))), 'order_bys' => array('financial_type_id' => array('title' => ts('Financial Type')), 'contribution_status_id' => array('title' => ts('Contribution Status')), 'payment_instrument_id' => array('title' => ts('Payment Instrument')), 'receive_date' => array('title' => ts('Receive Date'))), 'grouping' => 'contri-fields'), 'civicrm_contribution_soft' => array('dao' => 'CRM_Contribute_DAO_ContributionSoft', 'fields' => array('soft_credit_type_id' => array('title' => ts('Soft Credit Type'))), 'filters' => array('soft_credit_type_id' => array('title' => 'Soft Credit Type', 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('soft_credit_type'), 'default' => NULL, 'type' => CRM_Utils_Type::T_STRING))), 'civicrm_contribution_ordinality' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'alias' => 'cordinality', 'filters' => array('ordinality' => array('title' => ts('Contribution Ordinality'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => array(0 => 'First by Contributor', 1 => 'Second or Later by Contributor'), 'type' => CRM_Utils_Type::T_INT))), 'civicrm_note' => array('dao' => 'CRM_Core_DAO_Note', 'fields' => array('contribution_note' => array('name' => 'note', 'title' => ts('Contribution Note'))), 'filters' => array('note' => array('name' => 'note', 'title' => ts('Contribution Note'), 'operator' => 'like', 'type' => CRM_Utils_Type::T_STRING)))) + $this->addAddressFields(FALSE);
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     // Don't show Batch display column and filter unless batches are being used
     $this->_allBatches = CRM_Batch_BAO_Batch::getBatches();
     if (!empty($this->_allBatches)) {
         $this->_columns['civicrm_batch']['dao'] = 'CRM_Batch_DAO_Batch';
         $this->_columns['civicrm_batch']['fields']['batch_id'] = array('name' => 'id', 'title' => ts('Batch Name'));
         $this->_columns['civicrm_batch']['filters']['bid'] = array('name' => 'id', 'title' => ts('Batch Name'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->_allBatches);
         $this->_columns['civicrm_entity_batch']['dao'] = 'CRM_Batch_DAO_EntityBatch';
         $this->_columns['civicrm_entity_batch']['fields']['entity_batch_id'] = array('name' => 'batch_id', 'default' => TRUE, 'no_display' => TRUE);
     }
     // If we have active campaigns add those elements to both the fields and filters
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
         $this->_columns['civicrm_contribution']['fields']['campaign_id'] = array('title' => ts('Campaign'), 'default' => 'false');
         $this->_columns['civicrm_contribution']['filters']['campaign_id'] = array('title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns);
         $this->_columns['civicrm_contribution']['order_bys']['campaign_id'] = array('title' => ts('Campaign'));
     }
     $this->_currencyColumn = 'civicrm_contribution_currency';
     parent::__construct();
 }
コード例 #8
0
 function __construct()
 {
     $this->activityTypes = CRM_Core_PseudoConstant::activityType(true, true);
     asort($this->activityTypes);
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('title' => ts('Modified By'), 'required' => true), 'id' => array('no_display' => true, 'required' => true)), 'filters' => array('sort_name' => array('title' => ts('Modified By'))), 'grouping' => 'contact-fields'), 'civicrm_contact_touched' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name_touched' => array('title' => ts('Touched Contact'), 'name' => 'display_name', 'required' => true), 'id' => array('no_display' => true, 'required' => true)), 'filters' => array('sort_name_touched' => array('title' => ts('Touched Contact'), 'name' => 'sort_name')), 'grouping' => 'contact-fields'), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('id' => array('title' => ts('Activity'), 'no_display' => true, 'required' => true), 'subject' => array('title' => ts('Touched Activity'), 'required' => true), 'activity_type_id' => array('title' => ts('Activity Type'), 'required' => true), 'source_contact_id' => array('no_display' => true, 'required' => true))), 'civicrm_log' => array('dao' => 'CRM_Core_DAO_Log', 'fields' => array('modified_date' => array('title' => ts('Modified Date'), 'required' => true), 'data' => array('title' => ts('Description'))), 'filters' => array('modified_date' => array('title' => ts('Modified Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_DATE, 'default' => 'this.week'))));
     parent::__construct();
 }
コード例 #9
0
 function __construct()
 {
     $fields = array();
     $query = " \n                   SELECT column_name, label , option_group_id \n                   FROM civicrm_custom_field \n                   WHERE is_active = 1 AND column_name='" . $this->_gradeField['column_name'] . "' AND custom_group_id = ( SELECT id FROM civicrm_custom_group WHERE table_name='{$this->_customTable}' ) ";
     $dao_column = CRM_Core_DAO::executeQuery($query);
     $this->_optionFields = $this->_textFields = array();
     while ($dao_column->fetch()) {
         $fields[$dao_column->column_name] = array('required' => true, 'title' => $dao_column->label, 'no_display' => true);
         $this->_gradeField['op_group_id'] = $dao_column->option_group_id;
     }
     $filters = array();
     // filter for Grade
     $options = array();
     $query = "SELECT label , value FROM civicrm_option_value WHERE option_group_id =" . $this->_gradeField['op_group_id'] . "  AND is_active=1";
     $dao = CRM_Core_DAO::executeQuery($query);
     while ($dao->fetch()) {
         $options[$dao->value] = $dao->label;
     }
     $filters[$this->_gradeField['column_name']] = array('title' => ts('Grade'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => '-select-') + $options, 'type' => CRM_Utils_Type::T_STRING);
     //get teacher with relatioship
     $this->teacherOptions = array();
     $query = " SELECT DISTINCT(contact.id) ,contact.display_name \n                   FROM civicrm_contact contact \n                   INNER JOIN civicrm_relationship relationship \n                         ON ( contact.id=relationship.{$this->_teacherRelContact} AND relationship.is_active=1 )  \n                   INNER JOIN {$this->_customTable} school_information\n                         ON ( school_information.entity_id = contact.id AND (school_information.subtype='Staff' OR school_information.subtype='Parent') )\n                   WHERE relationship.relationship_type_id={$this->_teacherRelationship} ";
     $dao = CRM_Core_DAO::executeQuery($query);
     while ($dao->fetch()) {
         $this->teacherOptions[$dao->id] = $dao->display_name;
     }
     $this->_columns = array('civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('activity_date_time' => array('title' => ts('Date'), 'no_display' => true, 'required' => true, 'type' => CRM_Utils_Type::T_TIME))), $this->_customTable => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => $fields, 'filters' => $filters), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('no_display' => true, 'required' => true, 'title' => ts('Advisor')), 'id' => array('no_display' => true, 'required' => true)), 'filters' => array('id_teacher' => array('name' => 'id', 'title' => ts('Advisor'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => '-select-') + $this->teacherOptions, 'type' => CRM_Utils_Type::T_INT))), 'civicrm_contact_student' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('no_display' => true, 'required' => true, 'title' => ts('Student')), 'id' => array('no_display' => true, 'required' => true))), 'civicrm_contact_parent' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('no_display' => true, 'required' => true, 'title' => ts('Parent')), 'id' => array('no_display' => true, 'required' => true))));
     parent::__construct();
 }
コード例 #10
0
ファイル: Repeat.php プロジェクト: bhirsch/voipdev
    function __construct()
    {
        $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'grouping' => 'contact-fields', 'fields' => array('display_name' => array('title' => ts('Contact Name'), 'no_repeat' => true, 'default' => true), 'id' => array('no_display' => true, 'required' => true)), 'group_bys' => array('id' => array('title' => ts('Contact'), 'default' => true))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => true)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Phone'), 'no_repeat' => true)), 'grouping' => 'contact-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'grouping' => 'contact-fields', 'fields' => array('country_id' => array('title' => ts('Country')), 'state_province_id' => array('title' => ts('State/Province'))), 'group_bys' => array('country_id' => array('title' => ts('Country')), 'state_province_id' => array('title' => ts('State/Province')))), 'civicrm_contribution_type' => array('dao' => 'CRM_Contribute_DAO_ContributionType', 'fields' => array('contribution_type' => null), 'grouping' => 'contri-fields', 'group_bys' => array('contribution_type' => array('name' => 'id'))), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contribution_source' => null, 'total_amount1' => array('name' => 'total_amount', 'alias' => 'contribution1', 'title' => ts('Range One Stat'), 'type' => CRM_Utils_Type::T_MONEY, 'default' => true, 'required' => true, 'statistics' => array('sum' => ts('Total Amount'), 'count' => ts('Count')), 'clause' => '
contribution1_total_amount_count, contribution1_total_amount_sum'), 'total_amount2' => array('name' => 'total_amount', 'alias' => 'contribution2', 'title' => ts('Range Two Stat'), 'type' => CRM_Utils_Type::T_MONEY, 'default' => true, 'required' => true, 'statistics' => array('sum' => ts('Total Amount'), 'count' => ts('Count')), 'clause' => '
contribution2_total_amount_count, contribution2_total_amount_sum')), 'grouping' => 'contri-fields', 'filters' => array('receive_date1' => array('title' => ts('Date Range One'), 'default' => 'previous.year', 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE, 'name' => 'receive_date', 'alias' => 'contribution1'), 'receive_date2' => array('title' => ts('Date Range Two'), 'default' => 'this.year', 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE, 'name' => 'receive_date', 'alias' => 'contribution2'), 'total_amount1' => array('title' => ts('Range One Amount'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_INT, 'name' => 'receive_date', 'dbAlias' => 'contribution1_total_amount_sum'), 'total_amount2' => array('title' => ts('Range Two Amount'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_INT, 'name' => 'receive_date', 'dbAlias' => 'contribution2_total_amount_sum'), 'contribution_status_id' => array('operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array('1'))), 'group_bys' => array('contribution_source' => null)), '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()))), 'civicrm_tag' => array('dao' => 'CRM_Core_DAO_Tag', 'filters' => array('tid' => array('name' => 'tag_id', 'title' => ts('Tag'), 'tag' => true, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::tag()))));
        parent::__construct();
    }
コード例 #11
0
ファイル: Summary.php プロジェクト: hampelm/Ginsberg-CiviDemo
 function __construct()
 {
     // UI for selecting columns to appear in the report list
     // array conatining the columns, group_bys and filters build and provided to Form
     $this->_columns = array('civicrm_membership' => array('dao' => 'CRM_Member_DAO_MembershipType', 'grouping' => 'member-fields', 'fields' => array('membership_type_id' => array('title' => 'Membership Type', 'required' => true)), 'filters' => array('join_date' => array('title' => 'Member Since', 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE), 'membership_type_id' => array('title' => ts('Membership Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipType()), 'status_id' => array('title' => ts('Membership Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipStatus(null, null, 'label'))), 'group_bys' => array('join_date' => array('title' => ts('Member Since'), 'default' => true, 'frequency' => true, 'chart' => true, 'type' => 12), 'membership_type_id' => array('title' => 'Membership Type', 'default' => true, 'chart' => true))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('contact_id' => array('no_display' => true))), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('total_amount' => array('title' => ts('Amount Statistics'), 'required' => true, 'statistics' => array('sum' => ts('Total Payments Made'), 'count' => ts('Contribution Count'), 'avg' => ts('Average')))), 'filters' => array('contribution_status_id' => array('operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus())), 'grouping' => 'member-fields'));
     parent::__construct();
 }
コード例 #12
0
 function __construct()
 {
     $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'required' => TRUE, 'no_repeat' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'filters' => array('id' => array('title' => ts('Contact ID'), 'no_display' => TRUE), 'sort_name' => array('title' => ts('Contact Name'))), 'grouping' => 'contact-fields', 'order_bys' => array('sort_name' => array('title' => ts('Last Name, First Name'), 'default' => '1', 'default_weight' => '0', 'default_order' => 'ASC'))), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'grouping' => 'contact-fields', 'fields' => array('street_address' => NULL, 'city' => NULL, 'postal_code' => NULL, 'state_province_id' => array('title' => ts('State/Province'))), 'order_bys' => array('state_province_id' => array('title' => 'State/Province'), 'city' => array('title' => 'City'), 'postal_code' => array('title' => 'Postal Code'))), 'civicrm_country' => array('dao' => 'CRM_Core_DAO_Country', 'fields' => array('name' => array('title' => 'Country', 'default' => TRUE)), 'order_bys' => array('name' => array('title' => 'Country')), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields', 'order_bys' => array('email' => array('title' => ts('Email')))), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contact_id' => array('no_display' => TRUE, 'required' => TRUE), 'contribution_id' => array('title' => ts('Contribution'), 'no_repeat' => TRUE, 'default' => TRUE), 'total_amount' => array('default' => TRUE), 'contribution_type_id' => array('title' => ts('Contribution Type'), 'default' => TRUE), 'trxn_id' => NULL, 'receive_date' => array('default' => TRUE), 'receipt_date' => NULL, 'contribution_status_id' => array('title' => ts('Contribution Status'), 'default' => TRUE), 'contribution_source' => NULL)), 'civicrm_membership' => array('dao' => 'CRM_Member_DAO_Membership', 'fields' => array('contact_id' => array('no_display' => TRUE, 'required' => TRUE), 'membership_id' => array('title' => ts('Membership'), 'no_repeat' => TRUE, 'default' => TRUE), 'membership_type_id' => array('title' => ts('Membership Type'), 'default' => TRUE), 'join_date' => NULL, 'membership_start_date' => array('title' => ts('Start Date'), 'default' => TRUE), 'membership_end_date' => array('title' => ts('End Date'), 'default' => TRUE), 'membership_status_id' => array('name' => 'status_id', 'title' => ts('Membership Status'), 'default' => TRUE), 'source' => array('title' => 'Membership Source'))), 'civicrm_participant' => array('dao' => 'CRM_Event_DAO_Participant', 'fields' => array('contact_id' => array('no_display' => TRUE, 'required' => TRUE), 'participant_id' => array('title' => ts('Participant'), 'no_repeat' => TRUE, 'default' => TRUE), 'event_id' => array('default' => TRUE), 'participant_status_id' => array('name' => 'status_id', 'title' => ts('Participant Status'), 'default' => TRUE), 'role_id' => array('title' => ts('Role'), 'default' => TRUE), 'participant_register_date' => array('title' => ts('Register Date'), 'default' => TRUE), 'fee_level' => array('title' => ts('Fee Level'), 'default' => TRUE), 'fee_amount' => array('title' => ts('Fee Amount'), 'default' => TRUE))), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'fields' => array('relationship_id' => array('name' => 'id', 'title' => ts('Relationship'), 'no_repeat' => TRUE, 'default' => TRUE), 'relationship_type_id' => array('title' => ts('Relationship Type'), 'default' => TRUE), 'contact_id_b' => array('title' => ts('Relationship With'), 'default' => TRUE), 'start_date' => array('title' => 'Start Date ', 'type' => CRM_Report_Form::OP_DATE), 'end_date' => array('title' => 'End Date ', 'type' => CRM_Report_Form::OP_DATE))), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array('id' => array('title' => ts('Activity'), 'no_repeat' => TRUE, 'default' => TRUE), 'activity_type_id' => array('title' => ts('Activity Type'), 'default' => TRUE), 'subject' => array('title' => ts('Subject'), 'default' => TRUE), 'source_contact_id' => array('title' => ts('Added By'), 'default' => TRUE), 'activity_date_time' => array('title' => ts('Activity Date'), 'default' => TRUE), 'activity_status_id' => array('name' => 'status_id', 'title' => ts('Activity Status'), 'default' => TRUE)), 'grouping' => 'activity-fields'), 'civicrm_activity_target' => array('dao' => 'CRM_Activity_DAO_ActivityTarget', 'fields' => array('target_contact_id' => array('title' => ts('With Contact'), 'default' => TRUE)), 'grouping' => 'activity-fields'), 'civicrm_activity_assignment' => array('dao' => 'CRM_Activity_DAO_ActivityAssignment', 'fields' => array('assignee_contact_id' => array('title' => ts('Assigned To'), 'default' => TRUE)), 'grouping' => 'activity-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()))), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => NULL), 'grouping' => 'contact-fields'));
     $this->_tagFilter = TRUE;
     parent::__construct();
 }
コード例 #13
0
 function __construct()
 {
     $this->fetchActivityTypes();
     $this->fetchCaseStatusses();
     $rels = CRM_Core_PseudoConstant::relationshipType();
     $coach_rel_type_id = false;
     foreach ($rels as $relid => $v) {
         $this->rel_types[$relid] = $v['label_b_a'];
         if ($v['label_b_a'] == 'Coach') {
             $coach_rel_type_id = $relid;
         }
     }
     $coaches = array();
     if ($coach_rel_type_id) {
         $coaches = $this->coaches($coach_rel_type_id);
     }
     $this->_groupFilter = FALSE;
     $this->_tagFilter = FALSE;
     $this->_columns = array('civicrm_activity`' => array('dao' => 'CRM_Activity_DAO_Activity', 'fields' => array(), 'filters' => array('activity_type_id' => array('title' => ts('Activity type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('activity_type'), 'pseudofield' => true, 'default' => $this->_activityTypes), 'case_status' => array('title' => ts('Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('case_status'), 'pseudofield' => true, 'default' => $this->_openedCaseStatusses), 'case_role' => array('title' => ts('Role on case'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->rel_types), 'coach' => array('title' => ts('Coach'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $coaches, 'pseudofield' => true), 'my_cases' => array('title' => ts('My cases'), 'type' => CRM_Utils_Type::T_BOOLEAN, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('0' => ts('No'), '1' => ts('Yes')), 'default' => '1', 'pseudofield' => TRUE))));
     parent::__construct();
     $this->fetchCaseType();
     $this->fetchChequenummer();
     $this->fetchStatusGroup();
     $this->fetchCoachIdentifier();
 }
コード例 #14
0
 function __construct()
 {
     $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'required' => TRUE, 'no_repeat' => TRUE), 'first_name' => array('title' => ts('First Name')), 'last_name' => array('title' => ts('Last Name')), 'id' => array('no_display' => TRUE, 'required' => TRUE), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact SubType')), 'birth_date' => array('title' => ts('Birth Date'))), '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), 'birth_date' => array('title' => ts('Birth Date'), 'operatorType' => CRM_Report_Form::OP_DATE)), 'grouping' => 'contact-fields', 'order_bys' => array('sort_name' => array('title' => ts('Last Name, First Name'), 'default' => '1', 'default_weight' => '0', 'default_order' => 'ASC'))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields', 'order_bys' => array('email' => array('title' => ts('Email')))), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'grouping' => 'contact-fields', 'fields' => array('street_address' => array('default' => TRUE), 'city' => array('default' => TRUE), 'postal_code' => NULL, 'state_province_id' => array('title' => ts('State/Province'))), 'filters' => array('country_id' => array('title' => ts('Country'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::country()), 'state_province_id' => array('title' => ts('State / Province'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince())), 'order_bys' => array('state_province_id' => array('title' => 'State/Province'), 'city' => array('title' => 'City'), 'postal_code' => array('title' => 'Postal Code'))), 'civicrm_country' => array('dao' => 'CRM_Core_DAO_Country', 'fields' => array('name' => array('title' => 'Country', 'default' => TRUE)), 'order_bys' => array('name' => array('title' => 'Country')), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => NULL, 'phone_ext' => array('title' => ts('Phone Extension'))), 'grouping' => 'contact-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->_tagFilter = TRUE;
     parent::__construct();
 }
コード例 #15
0
 /**
  * Class constructor.
  */
 public function __construct()
 {
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'order_bys' => array('sort_name' => array('title' => ts("Last name, First name"))), 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'no_repeat' => TRUE, 'default' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Phone'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('id' => array('no_display' => TRUE, 'required' => TRUE), 'total_amount' => array('title' => ts('Amount Contributed to Date'), 'statistics' => array('sum' => ts("Total Amount Contributed"))))), 'civicrm_contribution_recur' => array('dao' => 'CRM_Contribute_DAO_ContributionRecur', 'fields' => array('id' => array('no_display' => TRUE, 'required' => TRUE), 'currency' => array('title' => ts("Currency"), 'required' => TRUE, 'no_display' => TRUE), 'contribution_status_id' => array('title' => ts('Contribution Status')), 'frequency_interval' => array('title' => ts('Frequency interval'), 'default' => TRUE), 'frequency_unit' => array('title' => ts('Frequency unit'), 'default' => TRUE), 'amount' => array('title' => ts('Installment Amount'), 'default' => TRUE), 'installments' => array('title' => ts('Installments'), 'default' => TRUE), 'start_date' => array('title' => ts('Start Date')), 'create_date' => array('title' => ts('Create Date')), 'modified_date' => array('title' => ts('Modified Date')), 'cancel_date' => array('title' => ts('Cancel Date')), 'end_date' => array('title' => ts('End Date')), 'next_sched_contribution_date' => array('title' => ts('Next Scheduled Contribution Date')), 'failure_count' => array('title' => ts('Failure Count')), 'failure_retry_date' => array('title' => ts('Failure Retry Date'))), 'filters' => array('contribution_status_id' => array('title' => ts('Contribution Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array(5), 'type' => CRM_Utils_Type::T_INT), '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), 'financial_type_id' => array('title' => ts('Financial Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::financialType(), 'type' => CRM_Utils_Type::T_INT), 'frequency_unit' => array('title' => ts('Frequency Unit'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('recur_frequency_units'), 'type' => CRM_Utils_Type::T_INT), 'frequency_interval' => array('title' => ts('Frequency Interval'), 'type' => CRM_Utils_Type::T_INT), 'amount' => array('title' => ts('Installment Amount'), 'type' => CRM_Utils_Type::T_MONEY), 'installments' => array('title' => ts('Installments'), 'type' => CRM_Utils_Type::T_INT), 'start_date' => array('title' => ts('Start Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_TIME), 'next_sched_contribution_date' => array('title' => ts('Next Scheduled Contribution Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_TIME), 'end_date' => array('title' => ts('End Date'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_TIME), 'contribution_processed_date' => array('title' => ts('Last Contribution Processed'), 'operatorType' => CRM_Report_Form::OP_DATE, 'type' => CRM_Utils_Type::T_TIME), 'calculated_end_date' => array('title' => ts('Calculated end date (either end date or date all installments will be made)'), 'description' => "does this work?", 'operatorType' => CRM_Report_Form::OP_DATE, 'pseudofield' => TRUE))));
     $this->_currencyColumn = 'civicrm_contribution_recur_currency';
     $this->_groupFilter = TRUE;
     parent::__construct();
 }
コード例 #16
0
 /**
  */
 public function __construct()
 {
     //filter options for survey activity status.
     $responseStatus = array('' => '- Any -');
     self::$_surveyRespondentStatus = array();
     $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
     if ($statusId = array_search('Scheduled', $activityStatus)) {
         $responseStatus[$statusId] = ts('Reserved');
         self::$_surveyRespondentStatus[$statusId] = 'Reserved';
     }
     if ($statusId = array_search('Completed', $activityStatus)) {
         $responseStatus[$statusId] = ts('Interviewed');
         self::$_surveyRespondentStatus[$statusId] = 'Interviewed';
     }
     $optionGroups = CRM_Campaign_BAO_Survey::getResultSets('name');
     $resultOptions = array();
     foreach ($optionGroups as $gid => $name) {
         if ($name) {
             $value = array();
             $value = CRM_Core_OptionGroup::values($name);
             if (!empty($value)) {
                 $value = array_combine($value, $value);
             }
             $resultOptions = $resultOptions + $value;
         }
     }
     asort($resultOptions);
     //get all interviewers.
     $allSurveyInterviewers = CRM_Campaign_BAO_Survey::getInterviewers();
     $this->_columns = array('civicrm_activity_contact' => array('dao' => 'CRM_Activity_DAO_ActivityContact', 'fields' => array('contact_id' => array('title' => ts('Interviewer Name'))), 'filters' => array('contact_id' => array('name' => 'contact_id', 'title' => ts('Interviewer Name'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('- any interviewer -')) + $allSurveyInterviewers)), 'grouping' => 'survey-interviewer-fields'), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('id' => array('title' => ts('Contact ID'), 'no_display' => TRUE, 'required' => TRUE), 'sort_name' => array('title' => ts('Respondent Name'), 'required' => TRUE, 'no_repeat' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Respondent Name'), 'operator' => 'like')), 'grouping' => 'contact-fields', 'order_bys' => array('sort_name' => array('title' => ts('Respondent Name'), 'required' => TRUE))), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('name' => 'phone', 'title' => ts('Phone'))), 'grouping' => 'location-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'fields' => array('street_number' => array('name' => 'street_number', 'title' => ts('Street Number'), 'type' => 1), 'street_name' => array('name' => 'street_name', 'title' => ts('Street Name'), 'type' => 1), 'street_unit' => array('name' => 'street_unit', 'title' => ts('Street Unit'), 'type' => 1), 'postal_code' => array('name' => 'postal_code', 'title' => ts('Postal Code'), 'type' => 1), 'city' => array('name' => 'city', 'title' => ts('City'), 'type' => 1), 'state_province_id' => array('name' => 'state_province_id', 'title' => ts('State/Province')), 'country_id' => array('name' => 'country_id', 'title' => ts('Country'))), 'filters' => array('street_number' => array('title' => ts('Street Number'), 'type' => 1, 'name' => 'street_number'), 'street_name' => array('title' => ts('Street Name'), 'name' => 'street_name', 'operator' => 'like'), 'postal_code' => array('title' => ts('Postal Code'), 'type' => 1, 'name' => 'postal_code'), 'city' => array('title' => ts('City'), 'operator' => 'like', 'name' => 'city'), 'state_province_id' => array('name' => 'state_province_id', 'title' => ts('State/Province'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince()), 'country_id' => array('name' => 'country_id', 'title' => ts('Country'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::country())), 'order_bys' => array('street_name' => array('title' => ts('Street Name')), 'street_number_odd_even' => array('title' => ts('Odd / Even Street Number'), 'name' => 'street_number', 'dbAlias' => 'address_civireport.street_number%2'), 'street_number' => array('title' => 'Street Number')), 'grouping' => 'location-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('name' => 'email', 'title' => ts('Email'))), 'grouping' => 'location-fields'), 'civicrm_activity' => array('dao' => 'CRM_Activity_DAO_Activity', 'alias' => 'survey_activity', 'fields' => array('survey_id' => array('name' => 'source_record_id', 'title' => ts('Survey'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Campaign_BAO_Survey::getSurveys()), 'survey_response' => array('name' => 'survey_response', 'title' => ts('Survey Responses')), 'details' => array('name' => 'details', 'title' => ts('Note'), 'type' => 1), 'result' => array('name' => 'result', 'required' => TRUE, 'title' => ts('Survey Result'))), 'filters' => array('survey_id' => array('name' => 'source_record_id', 'title' => ts('Survey'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Campaign_BAO_Survey::getSurveys()), 'status_id' => array('name' => 'status_id', 'title' => ts('Respondent Status'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $responseStatus), 'result' => array('title' => ts('Survey Result'), 'type' => CRM_Utils_Type::T_STRING, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $resultOptions)), 'grouping' => 'survey-activity-fields'));
     parent::__construct();
 }
コード例 #17
0
ファイル: History.php プロジェクト: hyebahi/civicrm-core
 /**
  */
 public function __construct()
 {
     $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
     $yearsInPast = 4;
     $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, 0);
     $count = $date['maxYear'];
     $optionYear = array('' => ts('- select -'));
     $this->_yearStatisticsFrom = $date['minYear'];
     $this->_yearStatisticsTo = $date['maxYear'];
     while ($date['minYear'] <= $count) {
         $optionYear[$date['minYear']] = $date['minYear'];
         $date['minYear']++;
     }
     $relationTypeOp = array();
     $relationshipTypes = CRM_Core_PseudoConstant::relationshipType();
     foreach ($relationshipTypes as $rid => $rtype) {
         if ($rtype['label_a_b'] != $rtype['label_b_a']) {
             $relationTypeOp[$rid] = "{$rtype['label_a_b']}/{$rtype['label_b_a']}";
         } else {
             $relationTypeOp[$rid] = $rtype['label_a_b'];
         }
     }
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'default' => TRUE, 'required' => TRUE, 'no_repeat' => TRUE), 'first_name' => array('title' => ts('First Name')), 'middle_name' => array('title' => ts('Middle Name')), 'last_name' => array('title' => ts('Last Name')), 'id' => array('no_display' => TRUE, 'default' => 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())'), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype'))), 'grouping' => 'contact-fields', 'order_bys' => array('sort_name' => array('title' => ts('Last Name, First Name'), 'default' => '1', 'default_weight' => '0', 'default_order' => 'ASC'), 'first_name' => array('name' => 'first_name', 'title' => ts('First Name')), 'gender_id' => array('name' => 'gender_id', 'title' => ts('Gender')), 'birth_date' => array('name' => 'birth_date', 'title' => ts('Birth Date')), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype'))), 'filters' => array('sort_name' => array('title' => ts('Contact Name')), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE), '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' => ts('Birth Date'), 'operatorType' => CRM_Report_Form::OP_DATE), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype')))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Phone'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields')) + $this->addAddressFields(FALSE, FALSE, FALSE, array()) + array('civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'fields' => array('relationship_type_id' => array('title' => ts('Relationship Type'), 'default' => TRUE), 'contact_id_a' => array('no_display' => TRUE), 'contact_id_b' => array('no_display' => TRUE)), 'filters' => array('relationship_type_id' => array('title' => ts('Relationship Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $relationTypeOp, 'type' => CRM_Utils_Type::T_STRING)))) + array('civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('total_amount' => array('title' => ts('Amount Statistics'), 'default' => TRUE, 'required' => TRUE, 'no_display' => TRUE, 'statistics' => array('sum' => ts('Aggregate Amount'))), 'receive_date' => array('required' => TRUE, 'default' => TRUE, 'no_display' => TRUE)), 'grouping' => 'contri-fields', 'filters' => array('this_year' => array('title' => ts('This Year'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $optionYear, 'default' => ''), 'other_year' => array('title' => ts('Other Years'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $optionYear, 'default' => ''), '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)), 'financial_type_id' => array('title' => ts('Financial Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::financialType()), 'total_amount' => array('title' => ts('Contribution Amount')), 'total_sum' => array('title' => ts('Aggregate Amount'), 'type' => CRM_Report_Form::OP_INT, 'dbAlias' => 'civicrm_contribution_total_amount_sum', 'having' => TRUE))));
     $this->_columns['civicrm_contribution']['fields']['civicrm_upto_' . $this->_yearStatisticsFrom] = array('title' => ts('Up To %1 Donation', array(1 => $this->_yearStatisticsFrom)), 'default' => TRUE, 'type' => CRM_Utils_Type::T_MONEY, 'is_statistics' => TRUE);
     $yearConter = $this->_yearStatisticsFrom;
     $yearConter++;
     while ($yearConter <= $this->_yearStatisticsTo) {
         $this->_columns['civicrm_contribution']['fields'][$yearConter] = array('title' => ts('%1 Donation', array(1 => $yearConter)), 'default' => TRUE, 'type' => CRM_Utils_Type::T_MONEY, 'is_statistics' => TRUE);
         $yearConter++;
     }
     $this->_columns['civicrm_contribution']['fields']['aggregate_amount'] = array('title' => ts('Aggregate Amount'), 'type' => CRM_Utils_Type::T_MONEY, 'is_statistics' => TRUE);
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     parent::__construct();
 }
コード例 #18
0
 /**
  *
  */
 function __construct()
 {
     // UI for selecting columns to appear in the report list
     // Array containing the columns, group_bys and filters build and provided to Form
     // 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_membership' => array('dao' => 'CRM_Member_DAO_MembershipType', 'grouping' => 'member-fields', 'fields' => array('membership_type_id' => array('title' => 'Membership Type', 'required' => TRUE)), 'filters' => array('join_date' => array('title' => ts('Member Since'), 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE), 'membership_start_date' => array('name' => 'start_date', 'title' => ts('Membership Start Date'), 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE), 'membership_end_date' => array('name' => 'end_date', 'title' => ts('Membership End Date'), 'type' => CRM_Utils_Type::T_DATE, 'operatorType' => CRM_Report_Form::OP_DATE), 'owner_membership_id' => array('title' => ts('Membership Owner ID'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_INT), 'membership_type_id' => array('title' => ts('Membership Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipType()), 'status_id' => array('title' => ts('Membership Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'))), 'group_bys' => array('join_date' => array('title' => ts('Member Since'), 'default' => TRUE, 'frequency' => TRUE, 'chart' => TRUE, 'type' => 12), 'membership_type_id' => array('title' => 'Membership Type', 'default' => TRUE, 'chart' => TRUE))), 'civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('contact_id' => array('no_display' => TRUE), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact SubType')))), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('currency' => array('required' => TRUE, 'no_display' => TRUE), 'total_amount' => array('title' => ts('Amount Statistics'), 'required' => TRUE, 'statistics' => array('sum' => ts('Total Payments Made'), 'count' => ts('Contribution Count'), 'avg' => ts('Average')))), 'filters' => array('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), 'contribution_status_id' => array('title' => ts('Contribution Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus())), 'grouping' => 'member-fields'));
     $this->_tagFilter = TRUE;
     // If we have a campaign, build out the relevant elements
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
         $this->_columns['civicrm_membership']['fields']['campaign_id'] = array('title' => 'Campaign', 'default' => 'false');
         $this->_columns['civicrm_membership']['filters']['campaign_id'] = array('title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns);
         $this->_columns['civicrm_membership']['grouping']['campaign_id'] = 'contri-fields';
         $this->_columns['civicrm_membership']['group_bys']['campaign_id'] = array('title' => ts('Campaign'));
     }
     $this->_groupFilter = TRUE;
     $this->_currencyColumn = 'civicrm_contribution_currency';
     parent::__construct();
 }
コード例 #19
0
 function __construct()
 {
     $contact_type = CRM_Contact_BAO_ContactType::getSelectElements(false, true, '_');
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name_a' => array('title' => ts('Contact A'), 'name' => 'display_name', 'required' => true), 'id' => array('no_display' => true, 'required' => true)), 'filters' => array('sort_name_a' => array('title' => ts('Contact A'), 'name' => 'sort_name', 'operator' => 'like', 'type' => CRM_Report_Form::OP_STRING)), 'grouping' => 'conact_a_fields'), 'civicrm_contact_b' => array('dao' => 'CRM_Contact_DAO_Contact', 'alias' => 'contact_b', 'fields' => array('display_name_b' => array('title' => ts('Contact B'), 'name' => 'display_name', 'required' => true), 'id' => array('no_display' => true, 'required' => true)), 'filters' => array('sort_name_b' => array('title' => ts('Contact B'), 'name' => 'sort_name', 'operator' => 'like', 'type' => CRM_Report_Form::OP_STRING)), 'grouping' => 'conact_b_fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email_a' => array('title' => ts('Email of Contact A'), 'name' => 'email')), 'grouping' => 'conact_a_fields'), 'civicrm_email_b' => array('dao' => 'CRM_Core_DAO_Email', 'alias' => 'email_b', 'fields' => array('email_b' => array('title' => ts('Email of Contact B'), 'name' => 'email')), 'grouping' => 'conact_b_fields'), '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' => $contact_type, 'type' => CRM_Utils_Type::T_STRING), 'contact_type_b' => array('title' => ts('Contact Type  B'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $contact_type, 'type' => CRM_Utils_Type::T_STRING)), 'grouping' => 'relation-fields'), 'civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'fields' => array('start_date' => array('title' => ts('Relationship Start Date')), 'end_date' => array('title' => ts('Relationship End Date')), 'description' => array('title' => ts('Description'))), 'filters' => array('is_active' => array('title' => ts('Relationship Status'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => '- Any -', 1 => 'Active', 0 => 'Inactive'), 'type' => CRM_Utils_Type::T_INT), 'relationship_type_id' => array('title' => ts('Relationship'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => '- any relationship type -') + CRM_Contact_BAO_Relationship::getContactRelationshipType(null, 'null', null, null, true), 'type' => CRM_Utils_Type::T_INT)), 'grouping' => 'relation-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'filters' => array('country_id' => array('title' => ts('Country'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::country()), 'state_province_id' => array('title' => ts('State/Province'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince())), 'grouping' => 'contact-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->_tagFilter = true;
     parent::__construct();
 }
コード例 #20
0
 function __construct()
 {
     $yearsInPast = 4;
     $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, 0);
     $count = $date['maxYear'];
     $optionYear = array('' => ts('-- select --'));
     $this->_yearStatisticsFrom = $date['minYear'];
     $this->_yearStatisticsTo = $date['maxYear'];
     while ($date['minYear'] <= $count) {
         $optionYear[$date['minYear']] = $date['minYear'];
         $date['minYear']++;
     }
     $relationTypeOp = array();
     $relationshipTypes = CRM_Core_PseudoConstant::relationshipType();
     foreach ($relationshipTypes as $rid => $rtype) {
         if ($rtype['label_a_b'] != $rtype['label_b_a']) {
             $relationTypeOp[$rid] = "{$rtype['label_a_b']}/{$rtype['label_b_a']}";
         } else {
             $relationTypeOp[$rid] = $rtype['label_a_b'];
         }
     }
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'default' => TRUE, 'required' => TRUE, 'no_repeat' => TRUE), 'id' => array('no_display' => TRUE, 'default' => TRUE, 'required' => TRUE)), 'grouping' => 'contact-fields', 'filters' => array('sort_name' => array('title' => ts('Contact Name')), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Phone'), 'no_repeat' => TRUE)), 'grouping' => 'contact-fields')) + $this->addAddressFields(FALSE, FALSE, FALSE, array()) + array('civicrm_relationship' => array('dao' => 'CRM_Contact_DAO_Relationship', 'fields' => array('relationship_type_id' => array('title' => ts('Relationship Type'), 'default' => TRUE), 'contact_id_a' => array('no_display' => TRUE), 'contact_id_b' => array('no_display' => TRUE)), 'filters' => array('relationship_type_id' => array('title' => ts('Relationship Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $relationTypeOp, 'type' => CRM_Utils_Type::T_STRING)))) + array('civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('total_amount' => array('title' => ts('Amount Statistics'), 'default' => TRUE, 'required' => TRUE, 'no_display' => TRUE, 'statistics' => array('sum' => ts('Aggregate Amount'))), 'receive_date' => array('required' => TRUE, 'default' => TRUE, 'no_display' => TRUE)), 'grouping' => 'contri-fields', 'filters' => array('this_year' => array('title' => ts('This Year'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $optionYear, 'default' => ''), 'other_year' => array('title' => ts('Other Years'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $optionYear, 'default' => ''), 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE), 'contribution_status_id' => array('title' => ts('Donation Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array(1)), 'contribution_type_id' => array('title' => ts('Contribution Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionType()), 'total_amount' => array('title' => ts('Donation Amount')), 'total_sum' => array('title' => ts('Aggregate Amount'), 'type' => CRM_Report_Form::OP_INT, 'dbAlias' => 'civicrm_contribution_total_amount_sum', 'having' => TRUE)))) + array('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->_columns['civicrm_contribution']['fields']['civicrm_upto_' . $this->_yearStatisticsFrom] = array('title' => ts('Up To %1 Donation', array(1 => $this->_yearStatisticsFrom)), 'default' => TRUE, 'type' => CRM_Utils_Type::T_MONEY, 'is_statistics' => TRUE);
     $yearConter = $this->_yearStatisticsFrom;
     $yearConter++;
     while ($yearConter <= $this->_yearStatisticsTo) {
         $this->_columns['civicrm_contribution']['fields'][$yearConter] = array('title' => ts('%1 Donation', array(1 => $yearConter)), 'default' => TRUE, 'type' => CRM_Utils_Type::T_MONEY, 'is_statistics' => TRUE);
         $yearConter++;
     }
     $this->_columns['civicrm_contribution']['fields']['aggregate_amount'] = array('title' => ts('Aggregate Amount'), 'type' => CRM_Utils_Type::T_MONEY, 'is_statistics' => TRUE);
     $this->_tagFilter = TRUE;
     parent::__construct();
 }
コード例 #21
0
 function __construct()
 {
     // UI for selecting columns to appear in the report list
     // array conatining the columns, group_bys and filters build and provided to Form
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Member Name'), 'no_repeat' => TRUE, 'required' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'group_bys' => array('id' => array('title' => ts('Contact ID')), 'display_name' => array('title' => ts('Contact Name'))), 'grouping' => 'contact-fields'), 'civicrm_membership_type' => array('dao' => 'CRM_Member_DAO_MembershipType', 'grouping' => 'member-fields', 'filters' => array('gid' => array('name' => 'id', 'title' => ts('Membership Types'), 'type' => CRM_Utils_Type::T_INT + CRM_Utils_Type::T_ENUM, 'options' => CRM_Member_PseudoConstant::membershipType()))), 'civicrm_membership' => array('dao' => 'CRM_Member_DAO_Membership', 'grouping' => 'member-fields', 'fields' => array('membership_type_id' => array('title' => 'Membership Type', 'required' => TRUE), 'join_date' => NULL, 'start_date' => array('title' => ts('Current Cycle Start Date')), 'end_date' => array('title' => ts('Current Cycle End Date'))), 'group_bys' => array('membership_type_id' => array('title' => ts('Membership Type'))), 'filters' => array('join_date' => array('type' => CRM_Utils_Type::T_DATE))), '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'), 'default' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => NULL), 'grouping' => 'contact-fields'), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'filters' => array('total_amount' => array('title' => ts('Contribution Amount')))));
     parent::__construct();
 }
コード例 #22
0
ファイル: Lapse.php プロジェクト: bhirsch/voipdev
 function __construct()
 {
     // UI for selecting columns to appear in the report list
     // array conatining the columns, group_bys and filters build and provided to Form
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('title' => ts('Member Name'), 'no_repeat' => true, 'required' => true), 'id' => array('no_display' => true, 'required' => true)), 'grouping' => 'contact-fields'), 'civicrm_membership_type' => array('dao' => 'CRM_Member_DAO_MembershipType', 'grouping' => 'member-fields', 'filters' => array('tid' => array('name' => 'id', 'title' => ts('Membership Types'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipType()))), 'civicrm_membership' => array('dao' => 'CRM_Member_DAO_Membership', 'grouping' => 'member-fields', 'fields' => array('membership_type_id' => array('title' => 'Membership Type', 'required' => true, 'type' => CRM_Utils_Type::T_STRING), 'membership_start_date' => array('title' => ts('Current Cycle Start Date')), 'membership_end_date' => array('title' => ts('Membership Lapse Date'), 'required' => true)), 'filters' => array('membership_end_date' => array('title' => 'Lapsed Memberships', 'operatorType' => CRM_Report_Form::OP_DATE))), 'civicrm_membership_status' => array('dao' => 'CRM_Member_DAO_MembershipStatus', 'alias' => 'mem_status', 'fields' => array('name' => array('title' => ts('Current Status'), 'required' => true)), 'grouping' => 'member-fields'), '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'), 'default' => true)), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => null), 'grouping' => 'contact-fields'), '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()))), 'civicrm_tag' => array('dao' => 'CRM_Core_DAO_Tag', 'filters' => array('tagid' => array('name' => 'tag_id', 'title' => ts('Tag'), 'tag' => true, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::tag()))));
     parent::__construct();
 }
コード例 #23
0
ファイル: Sybunt.php プロジェクト: hguru/224Civi
 function __construct()
 {
     $yearsInPast = 10;
     $yearsInFuture = 1;
     $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, $yearsInFuture);
     $count = $date['maxYear'];
     while ($date['minYear'] <= $count) {
         $optionYear[$date['minYear']] = $date['minYear'];
         $date['minYear']++;
     }
     // 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('dao' => 'CRM_Contact_DAO_Contact', 'grouping' => 'contact-field', 'fields' => array('sort_name' => array('title' => ts('Donor Name'), 'required' => TRUE), 'first_name' => array('title' => ts('First Name')), 'last_name' => array('title' => ts('Last Name')), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact SubType'))), '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'), 'default' => TRUE)))) + $this->addAddressFields() + array('civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contact_id' => array('title' => ts('contactId'), 'no_display' => TRUE, 'required' => TRUE, 'no_repeat' => TRUE), 'total_amount' => array('title' => ts('Total Amount'), 'no_display' => TRUE, 'required' => TRUE, 'no_repeat' => TRUE), 'receive_date' => array('title' => ts('Year'), 'no_display' => TRUE, 'required' => TRUE, 'no_repeat' => TRUE)), 'filters' => array('yid' => array('name' => 'receive_date', 'title' => ts('This Year'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $optionYear, 'default' => date('Y')), 'financial_type_id' => array('title' => ts('Financial Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::financialType()), 'contribution_status_id' => array('title' => ts('Contribution 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()))));
     // If we have a campaign, build out the relevant elements
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
         $this->_columns['civicrm_contribution']['fields']['campaign_id'] = array('title' => ts('Campaign'), 'default' => 'false');
         $this->_columns['civicrm_contribution']['filters']['campaign_id'] = array('title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns);
     }
     $this->_tagFilter = TRUE;
     parent::__construct();
 }
コード例 #24
0
 function __construct()
 {
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('id' => array('no_display' => TRUE, 'required' => TRUE), 'display_name' => array('title' => ts('Contact Name'), 'required' => TRUE, 'no_repeat' => TRUE), 'first_name' => array('title' => ts('First Name')), 'last_name' => array('title' => ts('Last Name')), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact SubType'))))) + $this->getAddressColumns() + array('civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('total_amount' => array('title' => ts('Amount Statistics'), 'required' => TRUE, 'statistics' => array('sum' => ts('Aggregate Amount'), 'count' => ts('Donations'), 'avg' => ts('Average'))), 'currency' => array('required' => TRUE, 'no_display' => TRUE)), 'filters' => array('receive_date' => array('default' => 'this.year', 'operatorType' => CRM_Report_Form::OP_DATE), '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), 'total_range' => array('title' => ts('Show no. of Top Donors'), 'type' => CRM_Utils_Type::T_INT, 'default_op' => 'eq'), 'financial_type_id' => array('name' => 'financial_type_id', 'title' => ts('Financial Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::financialType()), 'contribution_status_id' => array('title' => ts('Donation Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array(1)))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'default' => TRUE, 'no_repeat' => TRUE)), 'grouping' => 'email-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('title' => ts('Phone'), 'default' => TRUE, 'no_repeat' => TRUE)), 'grouping' => 'phone-fields'), '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::nestedGroup()))));
     $this->_tagFilter = TRUE;
     $this->_currencyColumn = 'civicrm_contribution_currency';
     parent::__construct();
 }
コード例 #25
0
ファイル: HRDetail.php プロジェクト: JoeMurray/civihr
 function __construct()
 {
     $this->_exposeContactID = $this->_emailField = FALSE;
     $this->_customGroupJoin = 'LEFT JOIN';
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Name'), 'required' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE), 'gender' => array()), 'filters' => array('sort_name' => array('title' => ts('Name'), 'operator' => 'like'), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE, 'type' => CRM_Utils_Type::T_INT), 'gender' => array()), 'order_bys' => array('sort_name' => array('title' => ts('Last Name, First Name'), 'default' => '1', 'default_weight' => '0', 'default_order' => 'ASC'), 'id' => array('title' => ts('Contact ID'), 'default' => '1', 'default_weight' => '1', 'default_order' => 'ASC')), 'grouping' => array('contact-fields' => ts('Personal Details'))), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('default' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => array('no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_address' => array('dao' => 'CRM_Core_DAO_Address', 'fields' => array('city' => array('title' => ts('Work City')), 'postal_code' => array('title' => ts('Work Postal Code')), 'state_province_id' => array('title' => ts('Work State/Province')), 'country_id' => array('title' => ts('Work Country'))), 'filters' => array('city' => array('title' => ts('Work City')), 'postal_code' => array('title' => ts('Work Postal Code')), 'state_province_id' => array('title' => ts('Work State/Province'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::stateProvince()), 'country_id' => array('title' => ts('Work Country'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_PseudoConstant::country())), 'grouping' => 'contact-fields'), '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(), 'type' => CRM_Utils_Type::T_INT))), 'civicrm_hrjobcontract' => array('dao' => 'CRM_Hrjobcontract_DAO_HRJobContract', 'fields' => array('is_primary' => array('title' => ts('Job Is Primary?'), 'no_repeat' => TRUE, 'dbAlias' => 'hrjobcontract_civireport.is_primary')), 'filters' => array('is_primary' => array('title' => ts('Job Is Primary?'), 'default' => 1, 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('Any'), '0' => ts('No'), '1' => ts('Yes'))), 'current_employee' => array('default' => NULL, 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => array('' => ts('ANY'), '0' => ts('No'), '1' => ts('Yes')), 'no_display' => TRUE)), 'grouping' => array('job-fields' => 'Job')), 'civicrm_hrjobcontract_revision' => array('dao' => 'CRM_Hrjobcontract_DAO_HRJobContractRevision', 'fields' => array('jobcontract_revision_id' => array('title' => ts('Revision ID'), 'no_repeat' => TRUE, 'name' => 'id', 'no_display' => TRUE), 'editor_uid' => array('title' => ts('Editor UID'), 'no_repeat' => TRUE, 'name' => 'editor_uid', 'no_display' => TRUE), 'created_date' => array('title' => ts('Created date'), 'no_repeat' => TRUE, 'name' => 'created_date', 'no_display' => TRUE), 'modified_date' => array('title' => ts('Modified date'), 'no_repeat' => TRUE, 'name' => 'modified_date', 'no_display' => TRUE), 'effective_date' => array('title' => ts('Effective date'), 'no_repeat' => TRUE, 'name' => 'effective_date', 'no_display' => TRUE), 'change_reason' => array('title' => ts('Change reason'), 'no_repeat' => TRUE, 'name' => 'change_reason', 'no_display' => TRUE), 'status' => array('title' => ts('Revision status'), 'no_repeat' => TRUE, 'name' => 'status', 'no_display' => TRUE)), 'grouping' => array('job-fields' => 'Job'), 'order_bys' => array('civicrm_hrjobcontract_revision_revision_id' => array('title' => ts('Revision Id'), 'dbAlias' => 'hrjobcontract_revision_civireport.id')), 'group_bys' => array('civicrm_hrjobcontract_revision_revision_id' => array('title' => ts('Revision Id'), 'dbAlias' => 'hrjobcontract_revision_civireport.id'))), 'civicrm_hrjobcontract_details' => array('dao' => 'CRM_Hrjobcontract_DAO_HRJobDetails', 'fields' => array('hrjobcontract_details_title' => array(), 'hrjobcontract_details_contract_type' => array(), 'hrjobcontract_details_location' => array(), 'hrjobcontract_details_position' => array(), 'hrjobcontract_details_period_start_date' => array(), 'hrjobcontract_details_period_end_date' => array()), 'filters' => array('hrjobcontract_details_title' => array(), 'hrjobcontract_details_contract_type' => array(), 'hrjobcontract_details_location' => array(), 'hrjobcontract_details_position' => array(), 'hrjobcontract_details_period_start_date' => array(), 'hrjobcontract_details_period_end_date' => array()), 'grouping' => array('job-fields' => 'Job')), 'civicrm_hrjobcontract_health' => array('dao' => 'CRM_Hrjobcontract_DAO_HRJobHealth', 'fields' => array('hrjobcontract_health_health_provider_life_insurance' => array(), 'hrjobcontract_health_life_insurance_plan_type' => array(), 'hrjobcontract_health_health_provider' => array(), 'hrjobcontract_health_health_plan_type' => array()), 'filters' => array('hrjobcontract_health_life_insurance_plan_type' => array(), 'hrjobcontract_health_health_plan_type' => array()), 'grouping' => array('job-fields' => 'Job')), 'civicrm_hrjobcontract_health_provider' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('organization_name' => array('title' => ts('Job Healthcare Provider'), 'no_repeat' => TRUE, 'no_display' => TRUE, 'required' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'filters' => array('organization_name' => array('title' => ts('Job Healthcare Provider'), 'operatorType' => CRM_Report_Form::OP_STRING))), 'civicrm_hrjobcontract_health_life_provider' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('display_name' => array('title' => ts('Job life insurance Provider'), 'no_repeat' => TRUE, 'no_display' => TRUE, 'required' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'filters' => array('display_name' => array('title' => ts('Job life insurance Provider'), 'operatorType' => CRM_Report_Form::OP_STRING))), 'civicrm_hrjobcontract_hour' => array('dao' => 'CRM_Hrjobcontract_DAO_HRJobHour', 'fields' => array('hrjobcontract_hour_hours_type' => array(), 'hrjobcontract_hour_hours_amount' => array(), 'hrjobcontract_hour_hours_unit' => array(), 'hrjobcontract_hour_hours_fte' => array()), 'filters' => array('hrjobcontract_hour_hours_type' => array(), 'hrjobcontract_hour_hours_amount' => array(), 'hrjobcontract_hour_hours_unit' => array(), 'hrjobcontract_hour_hours_fte' => array()), 'grouping' => array('job-fields' => 'Job')), 'civicrm_hrjobcontract_pay' => array('dao' => 'CRM_Hrjobcontract_DAO_HRJobPay', 'fields' => array('hrjobcontract_pay_is_paid' => array(), 'hrjobcontract_pay_pay_amount' => array(), 'hrjobcontract_pay_pay_unit' => array(), 'hrjobcontract_pay_pay_currency' => array(), 'hrjobcontract_pay_pay_annualized_est' => array()), 'filters' => array('hrjobcontract_pay_is_paid' => array(), 'hrjobcontract_pay_pay_amount' => array(), 'hrjobcontract_pay_pay_unit' => array(), 'hrjobcontract_pay_pay_annualized_est' => array()), 'grouping' => array('job-fields' => 'Job')), 'civicrm_hrjobcontract_pension' => array('dao' => 'CRM_Hrjobcontract_DAO_HRJobPension', 'fields' => array('hrjobcontract_pension_is_enrolled' => array()), 'filters' => array('hrjobcontract_pension_is_enrolled' => array()), 'grouping' => array('job-fields' => 'Job')), 'civicrm_hrjobcontract_role' => array('dao' => 'CRM_Hrjobcontract_DAO_HRJobRole', 'fields' => array('hrjobcontract_role_role_department' => array(), 'hrjobcontract_role_role_level_type' => array('name' => 'level_type', 'title' => ts('Role Level Types'), 'type' => CRM_Utils_Type::T_INT, 'grouping' => array('job-fields' => 'Job')), 'manager' => array('name' => 'manager_sort_name', 'title' => ts('Role Managers'), 'dbAlias' => 'manager.sort_name'), 'hrjob_role_manager_contact_id' => array('no_display' => TRUE, 'name' => 'manager_contact_id', 'title' => ts('Role Managers'), 'type' => CRM_Utils_Type::T_INT, 'grouping' => array('job-fields' => 'Job'))), 'filters' => array('hrjobcontract_role_role_department' => array(), 'hrjobcontract_role_role_level_type' => array()), 'grouping' => array('job-fields' => 'Job'))) + $this->addAddressFields(FALSE, TRUE);
     parent::__construct();
 }
コード例 #26
0
ファイル: Detail.php プロジェクト: sdekok/civicrm-core
 /**
  */
 public function __construct()
 {
     $this->_pledgeStatuses = CRM_Contribute_PseudoConstant::contributionStatus();
     // 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('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'required' => TRUE, 'no_repeat' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Contact Name')), 'id' => array('no_display' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('no_repeat' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_pledge' => array('dao' => 'CRM_Pledge_DAO_Pledge', 'fields' => array('id' => array('no_display' => TRUE, 'required' => TRUE), 'contact_id' => array('no_display' => TRUE, 'required' => TRUE), 'financial_type_id' => array('title' => ts('Financial Type')), 'amount' => array('title' => ts('Pledge Amount'), 'required' => TRUE, 'type' => CRM_Utils_Type::T_MONEY), 'currency' => array('required' => TRUE, 'no_display' => TRUE), 'frequency_unit' => array('title' => ts('Frequency Unit')), 'installments' => array('title' => ts('Installments')), 'pledge_create_date' => array('title' => ts('Pledge Made Date')), 'start_date' => array('title' => ts('Pledge Start Date'), 'type' => CRM_Utils_Type::T_DATE), 'end_date' => array('title' => ts('Pledge End Date'), 'type' => CRM_Utils_Type::T_DATE), 'status_id' => array('title' => ts('Pledge Status'), 'required' => TRUE)), 'filters' => array('pledge_create_date' => array('title' => 'Pledge Made Date', 'operatorType' => CRM_Report_Form::OP_DATE), 'pledge_amount' => array('title' => ts('Pledged Amount'), 'operatorType' => CRM_Report_Form::OP_INT), '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), 'sid' => array('name' => 'status_id', 'title' => ts('Pledge Status'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Core_OptionGroup::values('contribution_status')), 'financial_type_id' => array('title' => ts('Financial Type'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::financialType()))), 'civicrm_pledge_payment' => array('dao' => 'CRM_Pledge_DAO_PledgePayment', 'fields' => array('total_paid' => array('title' => ts('Total Amount Paid'), 'type' => CRM_Utils_Type::T_MONEY), 'balance_due' => array('title' => ts('Balance Due'), 'default' => TRUE, 'type' => CRM_Utils_Type::T_MONEY))));
     $this->_columns += $this->getAddressColumns(array('group_by' => FALSE)) + $this->getPhoneColumns();
     // If we have a campaign, build out the relevant elements
     $this->_tagFilter = TRUE;
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
         $this->_columns['civicrm_pledge']['fields']['campaign_id'] = array('title' => 'Campaign', 'default' => 'false');
         $this->_columns['civicrm_pledge']['filters']['campaign_id'] = array('title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns);
         $this->_columns['civicrm_pledge']['group_bys']['campaign_id'] = array('title' => ts('Campaign'));
     }
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     $this->_currencyColumn = 'civicrm_pledge_currency';
     parent::__construct();
 }
コード例 #27
0
 /**
  */
 public function __construct()
 {
     $this->_rollup = 'WITH ROLLUP';
     $this->_autoIncludeIndexedFieldsAsOrderBys = 1;
     $yearsInPast = 10;
     $yearsInFuture = 1;
     $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, $yearsInFuture);
     $count = $date['maxYear'];
     while ($date['minYear'] <= $count) {
         $optionYear[$date['minYear']] = $date['minYear'];
         $date['minYear']++;
     }
     // 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('dao' => 'CRM_Contact_DAO_Contact', 'grouping' => 'contact-field', 'fields' => array('sort_name' => array('title' => ts('Donor Name'), 'required' => TRUE), 'first_name' => array('title' => ts('First Name')), 'middle_name' => array('title' => ts('Middle 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())'), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype'))), 'grouping' => 'contact-fields', 'order_bys' => array('sort_name' => array('title' => ts('Last Name, First Name'), 'default' => '1', 'default_weight' => '0', 'default_order' => 'ASC'), 'first_name' => array('name' => 'first_name', 'title' => ts('First Name')), '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')), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype'))), 'filters' => array('sort_name' => array('title' => ts('Donor Name'), 'operator' => 'like'), 'id' => array('title' => ts('Contact ID'), 'no_display' => TRUE), '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' => ts('Birth Date'), 'operatorType' => CRM_Report_Form::OP_DATE), 'contact_type' => array('title' => ts('Contact Type')), 'contact_sub_type' => array('title' => ts('Contact Subtype')))), 'civicrm_line_item' => array('dao' => 'CRM_Price_DAO_LineItem'), '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'), 'default' => TRUE))));
     $this->_columns += $this->addAddressFields();
     $this->_columns += array('civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contact_id' => array('title' => ts('contactId'), 'no_display' => TRUE, 'required' => TRUE, 'no_repeat' => TRUE), 'total_amount' => array('title' => ts('Total Amount'), 'no_display' => TRUE, 'required' => TRUE, 'no_repeat' => TRUE), 'receive_date' => array('title' => ts('Year'), 'no_display' => TRUE, 'required' => TRUE, 'no_repeat' => TRUE)), 'filters' => array('yid' => array('name' => 'receive_date', 'title' => ts('This Year'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'options' => $optionYear, 'default' => date('Y'), 'type' => CRM_Utils_Type::T_INT), 'financial_type_id' => array('title' => ts('Financial Type'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes()), 'contribution_status_id' => array('title' => ts('Contribution Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'default' => array('1')))));
     // If we have a campaign, build out the relevant elements
     if ($campaignEnabled && !empty($this->activeCampaigns)) {
         $this->_columns['civicrm_contribution']['fields']['campaign_id'] = array('title' => ts('Campaign'), 'default' => 'false');
         $this->_columns['civicrm_contribution']['filters']['campaign_id'] = array('title' => ts('Campaign'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => $this->activeCampaigns, 'type' => CRM_Utils_Type::T_INT);
     }
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     parent::__construct();
 }
コード例 #28
0
 function __construct()
 {
     $this->_columns = array('civicrm_contact' => array('dao' => 'CRM_Contact_DAO_Contact', 'fields' => array('sort_name' => array('title' => ts('Contact Name'), 'required' => TRUE, 'default' => TRUE, 'no_repeat' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE), 'first_name' => array('title' => ts('First Name'), 'no_repeat' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE), 'last_name' => array('title' => ts('Last Name'), 'no_repeat' => TRUE), 'id' => array('no_display' => TRUE, 'required' => TRUE)), 'filters' => array('sort_name' => array('title' => ts('Contact Name'), 'operator' => 'like'), 'id' => array('no_display' => TRUE)), 'grouping' => 'contact-fields'), 'civicrm_membership' => array('dao' => 'CRM_Member_DAO_Membership', 'fields' => array('membership_type_id' => array('title' => 'Membership Type', 'required' => TRUE, 'no_repeat' => TRUE), 'membership_start_date' => array('title' => ts('Start Date'), 'default' => TRUE), 'membership_end_date' => array('title' => ts('End Date'), 'default' => TRUE), 'join_date' => array('title' => ts('Join Date'), 'default' => TRUE), 'source' => array('title' => 'Source')), 'filters' => array('join_date' => array('operatorType' => CRM_Report_Form::OP_DATE), 'membership_start_date' => array('operatorType' => CRM_Report_Form::OP_DATE), 'membership_end_date' => array('operatorType' => CRM_Report_Form::OP_DATE), 'owner_membership_id' => array('title' => ts('Membership Owner ID'), 'operatorType' => CRM_Report_Form::OP_INT), 'tid' => array('name' => 'membership_type_id', 'title' => ts('Membership Types'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipType())), 'grouping' => 'member-fields'), 'civicrm_membership_status' => array('dao' => 'CRM_Member_DAO_MembershipStatus', 'alias' => 'mem_status', 'fields' => array('name' => array('title' => ts('Status'), 'default' => TRUE)), 'filters' => array('sid' => array('name' => 'id', 'title' => ts('Status'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'))), 'grouping' => 'member-fields'), '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_email' => array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => NULL), 'grouping' => 'contact-fields'), 'civicrm_phone' => array('dao' => 'CRM_Core_DAO_Phone', 'fields' => array('phone' => NULL), 'grouping' => 'contact-fields'), 'civicrm_contribution' => array('dao' => 'CRM_Contribute_DAO_Contribution', 'fields' => array('contribution_id' => array('name' => 'id', 'no_display' => TRUE, 'required' => TRUE), 'contribution_type_id' => array('title' => ts('Contribution Type')), 'contribution_status_id' => array('title' => ts('Contribution Status')), 'payment_instrument_id' => array('title' => ts('Payment Type')), 'trxn_id' => NULL, 'receive_date' => NULL, 'receipt_date' => NULL, 'fee_amount' => NULL, 'net_amount' => NULL, 'total_amount' => array('title' => ts('Payment Amount (most recent)'), 'statistics' => array('sum' => ts('Amount')))), 'filters' => array('receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE), 'contribution_type_id' => array('title' => ts('Contribution Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionType(), 'type' => CRM_Utils_Type::T_INT), 'payment_instrument_id' => array('title' => ts('Payment Type'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::paymentInstrument(), 'type' => CRM_Utils_Type::T_INT), 'contribution_status_id' => array('title' => ts('Contribution Status'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), 'type' => CRM_Utils_Type::T_INT), 'total_amount' => array('title' => ts('Contribution Amount'))), 'grouping' => 'contri-fields'));
     $this->_groupFilter = TRUE;
     $this->_tagFilter = TRUE;
     parent::__construct();
 }
コード例 #29
0
 /**
  * Class constructor.
  */
 public function __construct()
 {
     // don’t display the ‘Add these Contacts to Group’ button
     $this->_add2groupSupported = FALSE;
     $dsn = defined('CIVICRM_LOGGING_DSN') ? DB::parseDSN(CIVICRM_LOGGING_DSN) : DB::parseDSN(CIVICRM_DSN);
     $this->loggingDB = $dsn['database'];
     // used for redirect back to contact summary
     $this->cid = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
     $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name');
     $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
     $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
     $targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
     $this->_logTables = array('log_civicrm_contact' => array('fk' => 'id'), 'log_civicrm_email' => array('fk' => 'contact_id', 'log_type' => 'Contact'), 'log_civicrm_phone' => array('fk' => 'contact_id', 'log_type' => 'Contact'), 'log_civicrm_address' => array('fk' => 'contact_id', 'log_type' => 'Contact'), 'log_civicrm_note' => array('fk' => 'entity_id', 'entity_table' => TRUE, 'bracket_info' => array('table' => 'log_civicrm_note', 'column' => 'subject')), 'log_civicrm_note_comment' => array('fk' => 'entity_id', 'table_name' => 'log_civicrm_note', 'joins' => array('table' => 'log_civicrm_note', 'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'"), 'entity_table' => TRUE, 'bracket_info' => array('table' => 'log_civicrm_note', 'column' => 'subject')), 'log_civicrm_group_contact' => array('fk' => 'contact_id', 'bracket_info' => array('entity_column' => 'group_id', 'table' => 'log_civicrm_group', 'column' => 'title'), 'action_column' => 'status', 'log_type' => 'Group'), 'log_civicrm_entity_tag' => array('fk' => 'entity_id', 'bracket_info' => array('entity_column' => 'tag_id', 'table' => 'log_civicrm_tag', 'column' => 'name'), 'entity_table' => TRUE), 'log_civicrm_relationship' => array('fk' => 'contact_id_a', 'bracket_info' => array('entity_column' => 'relationship_type_id', 'table' => 'log_civicrm_relationship_type', 'column' => 'label_a_b')), 'log_civicrm_activity_for_target' => array('fk' => 'contact_id', 'table_name' => 'log_civicrm_activity', 'joins' => array('table' => 'log_civicrm_activity_contact', 'join' => "(entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$targetID})"), 'bracket_info' => array('entity_column' => 'activity_type_id', 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE)), 'log_type' => 'Activity'), 'log_civicrm_activity_for_assignee' => array('fk' => 'contact_id', 'table_name' => 'log_civicrm_activity', 'joins' => array('table' => 'log_civicrm_activity_contact', 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$assigneeID}"), 'bracket_info' => array('entity_column' => 'activity_type_id', 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE)), 'log_type' => 'Activity'), 'log_civicrm_activity_for_source' => array('fk' => 'contact_id', 'table_name' => 'log_civicrm_activity', 'joins' => array('table' => 'log_civicrm_activity_contact', 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$sourceID}"), 'bracket_info' => array('entity_column' => 'activity_type_id', 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE)), 'log_type' => 'Activity'), 'log_civicrm_case' => array('fk' => 'contact_id', 'joins' => array('table' => 'log_civicrm_case_contact', 'join' => 'entity_log_civireport.id = fk_table.case_id'), 'bracket_info' => array('entity_column' => 'case_type_id', 'options' => CRM_Case_PseudoConstant::caseType('title', FALSE))));
     $logging = new CRM_Logging_Schema();
     // build _logTables for contact custom tables
     $customTables = $logging->entityCustomDataLogTables('Contact');
     foreach ($customTables as $table) {
         $this->_logTables[$table] = array('fk' => 'entity_id', 'log_type' => 'Contact');
     }
     // build _logTables for address custom tables
     $customTables = $logging->entityCustomDataLogTables('Address');
     foreach ($customTables as $table) {
         $this->_logTables[$table] = array('fk' => 'contact_id', 'joins' => array('table' => 'log_civicrm_address', 'join' => 'entity_log_civireport.entity_id = fk_table.id'), 'log_type' => 'Contact');
     }
     // Allow log tables to be extended via report hooks.
     CRM_Report_BAO_Hook::singleton()->alterLogTables($this, $this->_logTables);
     parent::__construct();
 }
コード例 #30
0
ファイル: Bounce.php プロジェクト: hampelm/Ginsberg-CiviDemo
 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), 'first_name' => array('title' => ts('First Name'), 'required' => true, 'no_repeat' => true), 'last_name' => array('title' => ts('Last Name'), 'required' => true, 'no_repeat' => 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)), 'grouping' => 'contact-fields');
     $this->_columns['civicrm_mailing'] = array('dao' => 'CRM_Mailing_DAO_Mailing', 'fields' => array('name' => array('title' => ts('Mailing Name'), 'no_display' => true, 'required' => true)), 'filters' => array('mailing_name' => array('name' => 'name', 'title' => ts('Mailing'), 'operatorType' => CRM_Report_Form::OP_MULTISELECT, 'type' => CRM_Utils_Type::T_STRING, 'options' => self::mailing_select(), 'operator' => 'like')));
     $this->_columns['civicrm_mailing_event_bounce'] = array('dao' => 'CRM_Mailing_DAO_Mailing', 'fields' => array('bounce_reason' => array('title' => ts('Bounce Reason'))));
     $this->_columns['civicrm_mailing_bounce_type'] = array('dao' => 'CRM_Mailing_DAO_BounceType', 'fields' => array('bounce_name' => array('name' => 'name', 'title' => ts('Bounce Type'))), 'filters' => array('bounce_type_name' => array('name' => 'name', 'title' => ts('Bounce Type'), 'operatorType' => CRM_Report_Form::OP_SELECT, 'type' => CRM_Utils_Type::T_STRING, 'options' => self::bounce_type(), 'operator' => 'like')));
     $this->_columns['civicrm_email'] = array('dao' => 'CRM_Core_DAO_Email', 'fields' => array('email' => array('title' => ts('Email'), 'no_repeat' => true, 'required' => true)), 'grouping' => 'contact-fields');
     // $this->_columns['civicrm_address'] = array(
     // 'dao' => 'CRM_Core_DAO_Address',
     // 'grouping'  => 'contact-fields',
     // 'fields' => array(
     // 'street_address'  => array( 'default' => true ),
     // 'city' => array( 'default' => true ),
     // 'postal_code' => null,
     // 'state_province_id' => array( 'title'   => ts( 'State/Province' ), ),
     // ),
     // );
     // $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())));
     $this->_tagFilter = true;
     parent::__construct();
 }