本文整理汇总了PHP中CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch方法的具体用法?PHP CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch怎么用?PHP CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Campaign_BAO_Campaign
的用法示例。
在下文中一共展示了CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
public function buildQuickForm()
{
$parent = $this->controller->getParent();
$nameTextLabel = $parent->_sms ? ts('SMS Name') : ts('Mailing Name');
$this->add('text', 'mailing_name', $nameTextLabel, CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Mailing', 'title'));
CRM_Core_Form_Date::buildDateRange($this, 'mailing', 1, '_from', '_to', ts('From'), FALSE);
$this->add('text', 'sort_name', ts('Created or Sent by'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($this);
// CRM-15434 - Fix mailing search by status in non-English languages
$statusVals = CRM_Core_SelectValues::getMailingJobStatus();
foreach ($statusVals as $statusId => $statusName) {
$this->addElement('checkbox', "mailing_status[{$statusId}]", NULL, $statusName);
}
$this->addElement('checkbox', 'status_unscheduled', NULL, ts('Draft / Unscheduled'));
$this->addYesNo('is_archived', ts('Mailing is Archived'), TRUE);
// Search by language, if multi-lingual
$enabledLanguages = CRM_Core_I18n::languages(TRUE);
if (count($enabledLanguages) > 1) {
$this->addElement('select', 'language', ts('Language'), array('' => ts('- all languages -')) + $enabledLanguages, array('class' => 'crm-select2'));
}
if ($parent->_sms) {
$this->addElement('hidden', 'sms', $parent->_sms);
}
$this->add('hidden', 'hidden_find_mailings', 1);
$this->addButtons(array(array('type' => 'refresh', 'name' => ts('Search'), 'isDefault' => TRUE)));
}
示例2: buildQuickForm
/**
* Build the form object.
*
*
* @return void
*/
public function buildQuickForm()
{
$attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'title');
$attributes['style'] = 'width: 90%';
$this->add('text', 'title', ts('Find'), $attributes);
$financial_account = CRM_Contribute_PseudoConstant::financialType();
foreach ($financial_account as $contributionId => $contributionName) {
$this->addElement('checkbox', "financial_type_id[{$contributionId}]", 'Financial Type', $contributionName);
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($this);
$this->addButtons(array(array('type' => 'refresh', 'name' => ts('Search'), 'isDefault' => TRUE)));
}
示例3: buildQuickForm
/**
* Build the form object.
*
*
* @return void
*/
public function buildQuickForm()
{
$this->add('text', 'title', ts('Find'), array(CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'title')));
$this->addSelect('event_type_id', array('multiple' => TRUE, 'context' => 'search'));
$eventsByDates = array();
$searchOption = array(ts('Show Current and Upcoming Events'), ts('Search All or by Date Range'));
$this->addRadio('eventsByDates', ts('Events by Dates'), $searchOption, array('onclick' => "return showHideByValue('eventsByDates','1','id_fromToDates','block','radio',true);"), "<br />");
$this->addDate('start_date', ts('From'), FALSE, array('formatType' => 'searchDate'));
$this->addDate('end_date', ts('To'), FALSE, array('formatType' => 'searchDate'));
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($this);
$this->addButtons(array(array('type' => 'refresh', 'name' => ts('Search'), 'isDefault' => TRUE)));
}
示例4: buildQuickForm
public function buildQuickForm()
{
$parent = $this->controller->getParent();
$nameTextLabel = $parent->_sms ? ts('SMS Name') : ts('Mailing Name');
$this->add('text', 'mailing_name', $nameTextLabel, CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Mailing', 'title'));
CRM_Core_Form_Date::buildDateRange($this, 'mailing', 1, '_from', '_to', ts('From'), FALSE, FALSE);
$this->add('text', 'sort_name', ts('Created or Sent by'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($this);
foreach (array('Scheduled', 'Complete', 'Running') as $status) {
$this->addElement('checkbox', "mailing_status[{$status}]", NULL, $status);
}
if ($parent->_sms) {
$this->addElement('hidden', 'sms', $parent->_sms);
}
$this->addButtons(array(array('type' => 'refresh', 'name' => ts('Search'), 'isDefault' => TRUE)));
}
示例5: buildSearchForm
/**
* @param CRM_Core_Form $form
*/
public static function buildSearchForm(&$form)
{
$dataURLEventFee = CRM_Utils_System::url('civicrm/ajax/eventFee', "reset=1", FALSE, NULL, FALSE);
$form->assign('dataURLEventFee', $dataURLEventFee);
$form->addEntityRef('event_id', ts('Event Name'), array('entity' => 'event', 'placeholder' => ts('- any -'), 'multiple' => 1, 'select' => array('minimumInputLength' => 0)));
$form->addEntityRef('event_type_id', ts('Event Type'), array('entity' => 'option_value', 'placeholder' => ts('- any -'), 'select' => array('minimumInputLength' => 0), 'api' => array('params' => array('option_group_id' => 'event_type'))));
$obj = new CRM_Report_Form_Event_ParticipantListing();
$form->add('select', 'participant_fee_id', ts('Fee Level'), $obj->getPriceLevels(), FALSE, array('class' => 'crm-select2', 'multiple' => 'multiple', 'placeholder' => ts('- any -')));
CRM_Core_Form_Date::buildDateRange($form, 'event', 1, '_start_date_low', '_end_date_high', ts('From'), FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'participant', 1, '_register_date_low', '_register_date_high', ts('From'), FALSE);
$form->addElement('checkbox', "event_include_repeating_events", NULL, ts('Include participants from all events in the %1 series', array(1 => '<em>%1</em>')));
$form->addSelect('participant_status_id', array('entity' => 'participant', 'label' => ts('Participant Status'), 'multiple' => 'multiple', 'option_url' => NULL, 'placeholder' => ts('- any -')));
$form->addSelect('participant_role_id', array('entity' => 'participant', 'label' => ts('Participant Role'), 'multiple' => 'multiple', 'option_url' => NULL, 'placeholder' => ts('- any -')));
$form->addYesNo('participant_test', ts('Participant is a Test?'), TRUE);
$form->addYesNo('participant_is_pay_later', ts('Participant is Pay Later?'), TRUE);
$form->addElement('text', 'participant_fee_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addElement('text', 'participant_fee_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('participant_fee_amount_low', ts('Please enter a valid money value.'), 'money');
$form->addRule('participant_fee_amount_high', ts('Please enter a valid money value.'), 'money');
// add all the custom searchable fields
$extends = array('Participant', 'Event');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
if ($groupDetails) {
$form->assign('participantGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'participant_campaign_id');
$form->assign('validCiviEvent', TRUE);
$form->setDefaults(array('participant_test' => 0));
}
示例6: buildSearchForm
/**
* Build the search form.
*
* @param CRM_Core_Form $form
*/
public static function buildSearchForm(&$form)
{
$membershipStatus = CRM_Member_PseudoConstant::membershipStatus();
$form->add('select', 'membership_status_id', ts('Membership Status(s)'), $membershipStatus, FALSE, array('id' => 'membership_status_id', 'multiple' => 'multiple', 'class' => 'crm-select2'));
$form->addEntityRef('membership_type_id', ts('Membership Type(s)'), array('entity' => 'MembershipType', 'multiple' => TRUE, 'placeholder' => ts('- any -'), 'select' => array('minimumInputLength' => 0)));
$form->addElement('text', 'member_source', ts('Source'));
CRM_Core_Form_Date::buildDateRange($form, 'member_join_date', 1, '_low', '_high', ts('From'), FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'member_start_date', 1, '_low', '_high', ts('From'), FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'member_end_date', 1, '_low', '_high', ts('From'), FALSE);
$form->addYesNo('member_is_primary', ts('Primary Member?'), TRUE);
$form->addYesNo('member_pay_later', ts('Pay Later?'), TRUE);
$form->addYesNo('member_auto_renew', ts('Auto-Renew?'), TRUE);
$form->addYesNo('member_test', ts('Membership is a Test?'), TRUE);
$form->addYesNo('member_is_override', ts('Membership Status Is Override?'), TRUE);
// add all the custom searchable fields
$extends = array('Membership');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
if ($groupDetails) {
$form->assign('membershipGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'member_campaign_id');
$form->assign('validCiviMember', TRUE);
$form->setDefaults(array('member_test' => 0));
}
示例7: buildSearchForm
/**
* Add all the elements shared between Mailing search and advnaced search.
*
*
* @param CRM_Core_Form $form
*/
public static function buildSearchForm(&$form)
{
// mailing selectors
$mailings = CRM_Mailing_BAO_Mailing::getMailingsList();
if (!empty($mailings)) {
$form->add('select', 'mailing_id', ts('Mailing Name(s)'), $mailings, FALSE, array('id' => 'mailing_id', 'multiple' => 'multiple', 'class' => 'crm-select2'));
}
CRM_Core_Form_Date::buildDateRange($form, 'mailing_date', 1, '_low', '_high', ts('From'), FALSE);
$form->addElement('hidden', 'mailing_date_range_error');
$form->addFormRule(array('CRM_Mailing_BAO_Query', 'formRule'), $form);
$mailingJobStatuses = array('' => ts('- select -'), 'Complete' => 'Complete', 'Scheduled' => 'Scheduled', 'Running' => 'Running', 'Canceled' => 'Canceled');
$form->addElement('select', 'mailing_job_status', ts('Mailing Job Status'), $mailingJobStatuses, FALSE);
$mailingBounceTypes = CRM_Core_PseudoConstant::get('CRM_Mailing_Event_DAO_Bounce', 'bounce_type_id', array('keyColumn' => 'id', 'labelColumn' => 'name'));
$form->add('select', 'mailing_bounce_types', ts('Bounce Types'), $mailingBounceTypes, FALSE, array('id' => 'mailing_bounce_types', 'multiple' => 'multiple', 'class' => 'crm-select2'));
// event filters
$form->addRadio('mailing_delivery_status', ts('Delivery Status'), CRM_Mailing_PseudoConstant::yesNoOptions('delivered'), array('allowClear' => TRUE));
$form->addRadio('mailing_open_status', ts('Trackable Opens'), CRM_Mailing_PseudoConstant::yesNoOptions('open'), array('allowClear' => TRUE));
$form->addRadio('mailing_click_status', ts('Trackable URLs'), CRM_Mailing_PseudoConstant::yesNoOptions('click'), array('allowClear' => TRUE));
$form->addRadio('mailing_reply_status', ts('Trackable Replies'), CRM_Mailing_PseudoConstant::yesNoOptions('reply'), array('allowClear' => TRUE));
$form->add('checkbox', 'mailing_unsubscribe', ts('Unsubscribe Requests'));
$form->add('checkbox', 'mailing_optout', ts('Opt-out Requests'));
$form->add('checkbox', 'mailing_forward', ts('Forwards'));
// Campaign select field
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'mailing_campaign_id');
$form->assign('validCiviMailing', TRUE);
}
示例8: buildSearchForm
/**
* Add all the elements shared between contribute search and advnaced search.
*
*
* @param CRM_Core_Form $form
*
* @return void
*/
public static function buildSearchForm(&$form)
{
// Added contribution source
$form->addElement('text', 'contribution_source', ts('Contribution Source'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution', 'source'));
CRM_Core_Form_Date::buildDateRange($form, 'contribution_date', 1, '_low', '_high', ts('From:'), FALSE);
$form->add('text', 'contribution_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addRule('contribution_amount_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
$form->add('text', 'contribution_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('contribution_amount_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
// Adding select option for curreny type -- CRM-4711
$form->add('select', 'contribution_currency_type', ts('Currency Type'), array('' => ts('- any -')) + CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'currency', array('labelColumn' => 'name')), FALSE, array('class' => 'crm-select2'));
// CRM-13848
$form->addSelect('financial_type_id', array('entity' => 'contribution', 'multiple' => 'multiple', 'context' => 'search'));
$form->add('select', 'contribution_page_id', ts('Contribution Page'), array('' => ts('- any -')) + CRM_Contribute_PseudoConstant::contributionPage(), FALSE, array('class' => 'crm-select2'));
$form->addSelect('payment_instrument_id', array('entity' => 'contribution', 'label' => ts('Payment Method'), 'option_url' => NULL, 'placeholder' => ts('- any -')));
$form->add('select', 'contribution_pcp_made_through_id', ts('Personal Campaign Page'), array('' => ts('- any -')) + CRM_Contribute_PseudoConstant::pcPage(), FALSE, array('class' => 'crm-select2'));
$status = array();
$statusValues = CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'contribution_status');
// Remove status values that are only used for recurring contributions or pledges (In Progress, Overdue).
unset($statusValues['5'], $statusValues['6']);
$form->addSelect('contribution_status_id', array('entity' => 'contribution', 'multiple' => 'multiple', 'label' => ts('Contribution Status(s)'), 'option_url' => NULL, 'placeholder' => ts('- any -')));
// Add fields for thank you and receipt
$form->addYesNo('contribution_thankyou_date_is_not_null', ts('Thank-you sent?'), TRUE);
$form->addYesNo('contribution_receipt_date_is_not_null', ts('Receipt sent?'), TRUE);
$form->addYesNo('contribution_pay_later', ts('Contribution is Pay Later?'), TRUE);
$form->addYesNo('contribution_recurring', ts('Contribution is Recurring?'), TRUE);
// Recurring contribution fields
foreach (self::getRecurringFields() as $key => $label) {
CRM_Core_Form_Date::buildDateRange($form, $key, 1, '_low', '_high');
// If data has been entered for a recurring field, tell the tpl layer to open the pane
if (!empty($form->_formValues[$key . '_relative']) || !empty($form->_formValues[$key . '_low']) || !empty($form->_formValues[$key . '_high'])) {
$form->assign('contribution_recur_pane_open', TRUE);
}
}
$form->addYesNo('contribution_test', ts('Contribution is a Test?'), TRUE);
// Add field for transaction ID search
$form->addElement('text', 'contribution_trxn_id', ts("Transaction ID"));
$form->addElement('text', 'contribution_check_number', ts('Check Number'));
// Add field for pcp display in roll search
$form->addYesNo('contribution_pcp_display_in_roll', ts('Personal Campaign Page Honor Roll?'), TRUE);
// Soft credit related fields
$options = array('only_contribs' => ts('Contributions Only'), 'only_scredits' => ts('Soft Credits Only'), 'both_related' => ts('Soft Credits with related Hard Credit'), 'both' => ts('Both'));
$form->add('select', 'contribution_or_softcredits', ts('Contributions OR Soft Credits?'), $options, FALSE, array('class' => "crm-select2"));
$form->addSelect('contribution_soft_credit_type_id', array('entity' => 'contribution_soft', 'field' => 'soft_credit_type_id', 'multiple' => TRUE, 'context' => 'search'));
// Add all the custom searchable fields
$contribution = array('Contribution');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $contribution);
if ($groupDetails) {
$form->assign('contributeGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'contribution_campaign_id');
// Add batch select
$batches = CRM_Contribute_PseudoConstant::batch();
if (!empty($batches)) {
$form->add('select', 'contribution_batch_id', ts('Batch Name'), array('' => ts('- any -')) + $batches, FALSE, array('class' => 'crm-select2'));
}
$form->assign('validCiviContribute', TRUE);
$form->setDefaults(array('contribution_test' => 0));
}
示例9: buildSearchForm
/**
* @param CRM_Core_Form $form
*/
public static function buildSearchForm(&$form)
{
// pledge related dates
CRM_Core_Form_Date::buildDateRange($form, 'pledge_start_date', 1, '_low', '_high', ts('From'), FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'pledge_end_date', 1, '_low', '_high', ts('From'), FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'pledge_create_date', 1, '_low', '_high', ts('From'), FALSE);
// pledge payment related dates
CRM_Core_Form_Date::buildDateRange($form, 'pledge_payment_date', 1, '_low', '_high', ts('From'), FALSE);
$form->addYesNo('pledge_test', ts('Pledge is a Test?'), TRUE);
$form->add('text', 'pledge_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addRule('pledge_amount_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
$form->add('text', 'pledge_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('pledge_amount_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
$statusValues = CRM_Contribute_PseudoConstant::contributionStatus();
// Remove status values that are only used for recurring contributions for now (Failed and In Progress).
unset($statusValues['4']);
$form->add('select', 'pledge_status_id', ts('Pledge Status'), $statusValues, FALSE, array('class' => 'crm-select2', 'multiple' => 'multiple'));
//unset in progress for payment
unset($statusValues['5']);
$form->add('select', 'pledge_payment_status_id', ts('Pledge Payment Status'), $statusValues, FALSE, array('class' => 'crm-select2', 'multiple' => 'multiple'));
$form->add('select', 'pledge_financial_type_id', ts('Financial Type'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType(), FALSE, array('class' => 'crm-select2'));
$form->add('select', 'pledge_contribution_page_id', ts('Contribution Page'), array('' => ts('- any -')) + CRM_Contribute_PseudoConstant::contributionPage(), FALSE, array('class' => 'crm-select2'));
//add fields for pledge frequency
$form->add('text', 'pledge_frequency_interval', ts('Every'), array('size' => 8, 'maxlength' => 8));
$form->addRule('pledge_frequency_interval', ts('Please enter valid Pledge Frequency Interval'), 'integer');
$frequencies = CRM_Core_OptionGroup::values('recur_frequency_units');
foreach ($frequencies as $val => $label) {
$freqUnitsDisplay["'{$val}'"] = ts('%1(s)', array(1 => $label));
}
$form->add('select', 'pledge_frequency_unit', ts('Pledge Frequency'), array('' => ts('- any -')) + $freqUnitsDisplay);
// add all the custom searchable fields
$pledge = array('Pledge');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $pledge);
if ($groupDetails) {
$form->assign('pledgeGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'pledge_campaign_id');
$form->assign('validCiviPledge', TRUE);
$form->setDefaults(array('pledge_test' => 0));
}
示例10: buildSearchForm
/**
* Add all the elements shared between case activity search and advanced search.
*
*
* @param CRM_Core_Form $form
* @return void
*/
public static function buildSearchForm(&$form)
{
$activityOptions = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE);
$form->addSelect('activity_type_id', array('entity' => 'activity', 'label' => 'Activity Type(s)', 'multiple' => 'multiple', 'option_url' => NULL, 'placeholder' => ts('- any -')));
CRM_Core_Form_Date::buildDateRange($form, 'activity_date', 1, '_low', '_high', ts('From'), FALSE, FALSE);
$followUpActivity = array(1 => ts('Yes'), 2 => ts('No'));
$form->addRadio('parent_id', NULL, $followUpActivity, array('allowClear' => TRUE));
$form->addRadio('followup_parent_id', NULL, $followUpActivity, array('allowClear' => TRUE));
$activityRoles = array(3 => ts('With'), 2 => ts('Assigned to'), 1 => ts('Added by'));
$form->addRadio('activity_role', NULL, $activityRoles, array('allowClear' => TRUE));
$form->setDefaults(array('activity_role' => 3));
$activityStatus = CRM_Core_PseudoConstant::get('CRM_Activity_DAO_Activity', 'status_id', array('flip' => 1, 'labelColumn' => 'name'));
$form->addSelect('status_id', array('entity' => 'activity', 'multiple' => 'multiple', 'option_url' => NULL, 'placeholder' => ts('- any -')));
$form->setDefaults(array('status_id' => array($activityStatus['Completed'], $activityStatus['Scheduled'])));
$form->addElement('text', 'activity_subject', ts('Subject'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'sort_name'));
$form->addYesNo('activity_test', ts('Activity is a Test?'));
$activity_tags = CRM_Core_BAO_Tag::getTags('civicrm_activity');
if ($activity_tags) {
foreach ($activity_tags as $tagID => $tagName) {
$form->_tagElement =& $form->addElement('checkbox', "activity_tags[{$tagID}]", NULL, $tagName);
}
}
$parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_activity');
CRM_Core_Form_Tag::buildQuickForm($form, $parentNames, 'civicrm_activity', NULL, TRUE, TRUE);
$surveys = CRM_Campaign_BAO_Survey::getSurveys(TRUE, FALSE, FALSE, TRUE);
if ($surveys) {
$form->add('select', 'activity_survey_id', ts('Survey / Petition'), array('' => ts('- none -')) + $surveys, FALSE, array('class' => 'crm-select2'));
}
$extends = array('Activity');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
if ($groupDetails) {
$form->assign('activityGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'activity_campaign_id');
//add engagement level CRM-7775
$buildEngagementLevel = FALSE;
$buildSurveyResult = FALSE;
if (CRM_Campaign_BAO_Campaign::isCampaignEnable() && CRM_Campaign_BAO_Campaign::accessCampaign()) {
$buildEngagementLevel = TRUE;
$form->addSelect('activity_engagement_level', array('entity' => 'activity', 'context' => 'search'));
// Add survey result field.
$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)) {
while (list($k, $v) = each($value)) {
$resultOptions[$v] = $v;
}
}
}
}
// If no survey result options have been created, don't build
// the field to avoid clutter.
if (count($resultOptions) > 0) {
$buildSurveyResult = TRUE;
asort($resultOptions);
$form->add('select', 'activity_result', ts("Survey Result"), $resultOptions, FALSE, array('id' => 'activity_result', 'multiple' => 'multiple', 'class' => 'crm-select2'));
}
}
$form->assign('buildEngagementLevel', $buildEngagementLevel);
$form->assign('buildSurveyResult', $buildSurveyResult);
$form->setDefaults(array('activity_test' => 0));
}
示例11: buildSearchForm
static function buildSearchForm(&$form)
{
$dataURLEvent = CRM_Utils_System::url('civicrm/ajax/event', "reset=1", FALSE, NULL, FALSE);
$dataURLEventType = CRM_Utils_System::url('civicrm/ajax/eventType', "reset=1", FALSE, NULL, FALSE);
$dataURLEventFee = CRM_Utils_System::url('civicrm/ajax/eventFee', "reset=1", FALSE, NULL, FALSE);
$form->assign('dataURLEvent', $dataURLEvent);
$form->assign('dataURLEventType', $dataURLEventType);
$form->assign('dataURLEventFee', $dataURLEventFee);
$eventId =& $form->add('text', 'event_name', ts('Event Name'));
$eventType =& $form->add('text', 'event_type', ts('Event Type'));
$participantFee =& $form->add('text', 'participant_fee_level', ts('Fee Level'));
//elements for assigning value operation
$eventNameId =& $form->add('hidden', 'event_id', '', array('id' => 'event_id'));
$eventTypeId =& $form->add('hidden', 'event_type_id', '', array('id' => 'event_type_id'));
$participantFeeId =& $form->add('hidden', 'participant_fee_id', '', array('id' => 'participant_fee_id'));
CRM_Core_Form_Date::buildDateRange($form, 'event', 1, '_start_date_low', '_end_date_high', ts('From'), FALSE, FALSE);
$status = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
asort($status);
foreach ($status as $id => $Name) {
$form->_participantStatus =& $form->addElement('checkbox', "participant_status_id[{$id}]", NULL, $Name);
}
foreach (CRM_Event_PseudoConstant::participantRole() as $rId => $rName) {
$form->_participantRole =& $form->addElement('checkbox', "participant_role_id[{$rId}]", NULL, $rName);
}
$form->addElement('checkbox', 'participant_test', ts('Find Test Participants?'));
$form->addElement('checkbox', 'participant_pay_later', ts('Find Pay Later Participants?'));
$form->addElement('text', 'participant_fee_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addElement('text', 'participant_fee_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('participant_fee_amount_low', ts('Please enter a valid money value.'), 'money');
$form->addRule('participant_fee_amount_high', ts('Please enter a valid money value.'), 'money');
// add all the custom searchable fields
$extends = array('Participant');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
if ($groupDetails) {
$form->assign('participantGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'participant_campaign_id');
$form->assign('validCiviEvent', TRUE);
}
示例12: buildSearchForm
/**
* add all the elements shared between contribute search and advnaced search
*
* @access public
*
* @return void
* @static
*/
static function buildSearchForm(&$form)
{
//added contribution source
$form->addElement('text', 'contribution_source', ts('Contribution Source'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution', 'source'));
CRM_Core_Form_Date::buildDateRange($form, 'contribution_date', 1, '_low', '_high', ts('From'), FALSE, FALSE);
$form->add('text', 'contribution_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addRule('contribution_amount_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
$form->add('text', 'contribution_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('contribution_amount_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
//adding select option for curreny type -- CRM-4711
$form->add('select', 'contribution_currency_type', ts('Currency Type'), array('' => ts('- select -')) + CRM_Core_PseudoConstant::currencySymbols('name'));
$form->add('select', 'contribution_type_id', ts('Contribution Type'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::contributionType());
$form->add('select', 'contribution_page_id', ts('Contribution Page'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::contributionPage());
$form->add('select', 'contribution_payment_instrument_id', ts('Payment Instrument'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument());
$form->add('select', 'contribution_pcp_made_through_id', ts('Personal Campaign Page'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::pcPage());
$status = array();
$statusValues = CRM_Core_OptionGroup::values("contribution_status");
// Remove status values that are only used for recurring contributions or pledges (In Progress, Overdue).
unset($statusValues['5']);
unset($statusValues['6']);
foreach ($statusValues as $key => $val) {
$status[] = $form->createElement('advcheckbox', $key, NULL, $val);
}
$form->addGroup($status, 'contribution_status_id', ts('Contribution Status'));
// add null checkboxes for thank you and receipt
$form->addElement('checkbox', 'contribution_thankyou_date_isnull', ts('Thank-you date not set?'));
$form->addElement('checkbox', 'contribution_receipt_date_isnull', ts('Receipt not sent?'));
//add fields for honor search
$form->addElement('text', 'contribution_in_honor_of', ts("In Honor Of"));
$form->addElement('checkbox', 'contribution_test', ts('Find Test Contributions?'));
$form->addElement('checkbox', 'contribution_pay_later', ts('Find Pay Later Contributions?'));
//add field for transaction ID search
$form->addElement('text', 'contribution_transaction_id', ts("Transaction ID"));
$form->addElement('checkbox', 'contribution_recurring', ts('Find Recurring Contributions?'));
$form->addElement('checkbox', 'contribution_recurring_isnull', ts('Find Non Recurring Contributions?'));
$form->addElement('text', 'contribution_check_number', ts('Check Number'));
//add field for pcp display in roll search
$form->addYesNo('contribution_pcp_display_in_roll', ts('Personal Campaign Page Honor Roll?'));
// add all the custom searchable fields
$contribution = array('Contribution');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $contribution);
if ($groupDetails) {
$form->assign('contributeGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'contribution_campaign_id');
// add batch select
$batches = CRM_Core_BAO_Batch::getBatches();
if (!empty($batches)) {
$form->add('select', 'contribution_batch_id', ts('Batch Name'), array('' => ts('- select -')) + $batches);
}
$form->assign('validCiviContribute', TRUE);
}
示例13: buildSearchForm
/**
* @param $form
*/
static function buildSearchForm(&$form)
{
foreach (CRM_Member_PseudoConstant::membershipType() as $id => $Name) {
$form->_membershipType =& $form->addElement('checkbox', "member_membership_type_id[{$id}]", NULL, $Name);
}
foreach (CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label') as $sId => $sName) {
$form->_membershipStatus =& $form->addElement('checkbox', "member_status_id[{$sId}]", NULL, $sName);
}
$form->addElement('text', 'member_source', ts('Source'));
CRM_Core_Form_Date::buildDateRange($form, 'member_join_date', 1, '_low', '_high', ts('From'), FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'member_start_date', 1, '_low', '_high', ts('From'), FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'member_end_date', 1, '_low', '_high', ts('From'), FALSE);
$form->addYesNo('member_is_primary', ts('Primary Member?'), TRUE);
$form->addYesNo('member_pay_later', ts('Pay Later?'), TRUE);
$form->addYesNo('member_auto_renew', ts('Auto-Renew?'), TRUE);
$form->addYesNo('member_test', ts('Membership is a Test?'), TRUE);
// add all the custom searchable fields
$extends = array('Membership');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
if ($groupDetails) {
$form->assign('membershipGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'member_campaign_id');
$form->assign('validCiviMember', TRUE);
$form->setDefaults(array('member_test' => 0));
}
示例14: buildSearchForm
static function buildSearchForm(&$form)
{
foreach (CRM_Member_PseudoConstant::membershipType() as $id => $Name) {
$form->_membershipType =& $form->addElement('checkbox', "member_membership_type_id[{$id}]", NULL, $Name);
}
// Option to include / exclude inherited memberships from search results (e.g. rows where owner_membership_id is NOT NULL)
$primaryValues = array(1 => ts('All Members'), 2 => ts('Primary Members Only'), 3 => ts('Related Members Only'));
$form->addRadio('member_is_primary', '', $primaryValues);
$form->setDefaults(array('member_is_primary' => 1));
foreach (CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label') as $sId => $sName) {
$form->_membershipStatus =& $form->addElement('checkbox', "member_status_id[{$sId}]", NULL, $sName);
}
$form->addElement('text', 'member_source', ts('Source'));
CRM_Core_Form_Date::buildDateRange($form, 'member_join_date', 1, '_low', '_high', ts('From'), FALSE, FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'member_start_date', 1, '_low', '_high', ts('From'), FALSE, FALSE);
CRM_Core_Form_Date::buildDateRange($form, 'member_end_date', 1, '_low', '_high', ts('From'), FALSE, FALSE);
$form->addElement('checkbox', 'member_test', ts('Find Test Memberships?'));
$form->addElement('checkbox', 'member_pay_later', ts('Find Pay Later Memberships?'));
$form->addElement('checkbox', 'member_auto_renew', ts('Find Auto-renew Memberships?'));
// add all the custom searchable fields
$extends = array('Membership');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
if ($groupDetails) {
$form->assign('membershipGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'member_campaign_id');
$form->assign('validCiviMember', TRUE);
}
示例15: buildSearchForm
/**
* @param CRM_Core_Form $form
*/
static function buildSearchForm(&$form)
{
$dataURLEventFee = CRM_Utils_System::url('civicrm/ajax/eventFee', "reset=1", FALSE, NULL, FALSE);
$form->assign('dataURLEventFee', $dataURLEventFee);
$eventId = $form->addEntityRef('event_id', ts('Event Name'), array('entity' => 'event', 'placeholder' => ts('- any -'), 'select' => array('minimumInputLength' => 0)));
$eventType = $form->addEntityRef('event_type_id', ts('Event Type'), array('entity' => 'option_value', 'placeholder' => ts('- any -'), 'select' => array('minimumInputLength' => 0), 'api' => array('params' => array('option_group_id' => 'event_type'))));
$form->add('text', 'participant_fee_id', ts('Fee Level'), array('class' => 'big crm-ajax-select'));
CRM_Core_Form_Date::buildDateRange($form, 'event', 1, '_start_date_low', '_end_date_high', ts('From'), FALSE);
$status = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
foreach ($status as $id => $Name) {
$form->_participantStatus =& $form->addElement('checkbox', "participant_status_id[{$id}]", NULL, $Name);
}
foreach (CRM_Event_PseudoConstant::participantRole() as $rId => $rName) {
$form->_participantRole =& $form->addElement('checkbox', "participant_role_id[{$rId}]", NULL, $rName);
}
$form->addYesNo('participant_test', ts('Participant is a Test?'), TRUE);
$form->addYesNo('participant_pay_later', ts('Participant is Pay Later?'), TRUE);
$form->addElement('text', 'participant_fee_amount_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addElement('text', 'participant_fee_amount_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('participant_fee_amount_low', ts('Please enter a valid money value.'), 'money');
$form->addRule('participant_fee_amount_high', ts('Please enter a valid money value.'), 'money');
// add all the custom searchable fields
$extends = array('Participant', 'Event');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $extends);
if ($groupDetails) {
$form->assign('participantGroupTree', $groupDetails);
foreach ($groupDetails as $group) {
foreach ($group['fields'] as $field) {
$fieldId = $field['id'];
$elementName = 'custom_' . $fieldId;
CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, FALSE, FALSE, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'participant_campaign_id');
$form->assign('validCiviEvent', TRUE);
$form->setDefaults(array('participant_test' => 0));
}