當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Pledge_BAO_PledgePayment::buildOptions方法代碼示例

本文整理匯總了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));
 }
開發者ID:nielosz,項目名稱:civicrm-core,代碼行數:50,代碼來源:Query.php


注:本文中的CRM_Pledge_BAO_PledgePayment::buildOptions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。