本文整理汇总了PHP中CRM_Pledge_BAO_PledgePayment::buildOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Pledge_BAO_PledgePayment::buildOptions方法的具体用法?PHP CRM_Pledge_BAO_PledgePayment::buildOptions怎么用?PHP CRM_Pledge_BAO_PledgePayment::buildOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Pledge_BAO_PledgePayment
的用法示例。
在下文中一共展示了CRM_Pledge_BAO_PledgePayment::buildOptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
$form->add('select', 'pledge_status_id', ts('Pledge Status'), CRM_Pledge_BAO_Pledge::buildOptions('status_id'), FALSE, array('class' => 'crm-select2', 'multiple' => 'multiple'));
$form->addYesNo('pledge_acknowledge_date_is_not_null', ts('Acknowledgement sent?'), TRUE);
$form->add('text', 'pledge_installments_low', ts('From'), array('size' => 8, 'maxlength' => 8));
$form->addRule('pledge_installments_low', ts('Please enter a number'), 'integer');
$form->add('text', 'pledge_installments_high', ts('To'), array('size' => 8, 'maxlength' => 8));
$form->addRule('pledge_installments_high', ts('Please enter number.'), 'integer');
$form->add('select', 'pledge_payment_status_id', ts('Pledge Payment Status'), CRM_Pledge_BAO_PledgePayment::buildOptions('status_id'), 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, TRUE);
}
}
}
CRM_Campaign_BAO_Campaign::addCampaignInComponentSearch($form, 'pledge_campaign_id');
$form->assign('validCiviPledge', TRUE);
$form->setDefaults(array('pledge_test' => 0));
}