本文整理汇总了PHP中CRM_Core_Form::addYesNo方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Form::addYesNo方法的具体用法?PHP CRM_Core_Form::addYesNo怎么用?PHP CRM_Core_Form::addYesNo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Form
的用法示例。
在下文中一共展示了CRM_Core_Form::addYesNo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* @param CRM_Core_Form $form
*/
public static function buildQuickForm(&$form)
{
$form->removeElement('status_id');
$form->removeElement('priority_id');
$caseId = CRM_Utils_Array::first($form->_caseId);
$form->_caseType = CRM_Case_PseudoConstant::caseType();
$form->_caseTypeId = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_Case', $caseId, 'case_type_id');
if (!in_array($form->_caseTypeId, $form->_caseType)) {
$form->_caseType[$form->_caseTypeId] = CRM_Core_DAO::getFieldValue('CRM_Case_DAO_CaseType', $form->_caseTypeId, 'title');
}
$form->add('select', 'case_type_id', ts('New Case Type'), $form->_caseType, TRUE);
// timeline
$form->addYesNo('is_reset_timeline', ts('Reset Case Timeline?'), NULL, TRUE, array('onclick' => "return showHideByValue('is_reset_timeline','','resetTimeline','table-row','radio',false);"));
$form->addDateTime('reset_date_time', ts('Reset Start Date'), FALSE, array('formatType' => 'activityDateTime'));
}
示例2: buildMailBlock
/**
* Build Email Block.
*
* @param CRM_Core_Form $form
*
*/
public function buildMailBlock(&$form)
{
$form->registerRule('emailList', 'callback', 'emailList', 'CRM_Utils_Rule');
$attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event');
$form->addYesNo('is_email_confirm', ts('Send Confirmation Email?'), NULL, NULL, array('onclick' => "return showHideByValue('is_email_confirm','','confirmEmail','block','radio',false);"));
$form->add('textarea', 'confirm_email_text', ts('Text'), $attributes['confirm_email_text']);
$form->add('text', 'cc_confirm', ts('CC Confirmation To'), CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'cc_confirm'));
$form->addRule('cc_confirm', ts('Please enter a valid list of comma delimited email addresses'), 'emailList');
$form->add('text', 'bcc_confirm', ts('BCC Confirmation To'), CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'bcc_confirm'));
$form->addRule('bcc_confirm', ts('Please enter a valid list of comma delimited email addresses'), 'emailList');
$form->add('text', 'confirm_from_name', ts('Confirm From Name'));
$form->add('text', 'confirm_from_email', ts('Confirm From Email'));
$form->addRule('confirm_from_email', ts('Email is not valid.'), 'email');
}
示例3: buildSearchForm
/**
* Add all the elements shared between grant search and advanaced search.
*
*
* @param CRM_Core_Form $form
*
* @return void
*/
public static function buildSearchForm(&$form)
{
$grantType = CRM_Core_OptionGroup::values('grant_type');
$form->add('select', 'grant_type_id', ts('Grant Type'), $grantType, FALSE, array('id' => 'grant_type_id', 'multiple' => 'multiple', 'class' => 'crm-select2'));
$grantStatus = CRM_Core_OptionGroup::values('grant_status');
$form->add('select', 'grant_status_id', ts('Grant Status'), $grantStatus, FALSE, array('id' => 'grant_status_id', 'multiple' => 'multiple', 'class' => 'crm-select2'));
$form->addDate('grant_application_received_date_low', ts('App. Received Date - From'), FALSE, array('formatType' => 'searchDate'));
$form->addDate('grant_application_received_date_high', ts('To'), FALSE, array('formatType' => 'searchDate'));
$form->addElement('checkbox', 'grant_application_received_notset', '', NULL);
$form->addDate('grant_money_transfer_date_low', ts('Money Sent Date - From'), FALSE, array('formatType' => 'searchDate'));
$form->addDate('grant_money_transfer_date_high', ts('To'), FALSE, array('formatType' => 'searchDate'));
$form->addElement('checkbox', 'grant_money_transfer_date_notset', '', NULL);
$form->addDate('grant_due_date_low', ts('Report Due Date - From'), FALSE, array('formatType' => 'searchDate'));
$form->addDate('grant_due_date_high', ts('To'), FALSE, array('formatType' => 'searchDate'));
$form->addElement('checkbox', 'grant_due_date_notset', '', NULL);
$form->addDate('grant_decision_date_low', ts('Grant Decision Date - From'), FALSE, array('formatType' => 'searchDate'));
$form->addDate('grant_decision_date_high', ts('To'), FALSE, array('formatType' => 'searchDate'));
$form->addElement('checkbox', 'grant_decision_date_notset', '', NULL);
$form->addYesNo('grant_report_received', ts('Grant report received?'), TRUE);
$form->add('text', 'grant_amount_low', ts('Minimum Amount'), array('size' => 8, 'maxlength' => 8));
$form->addRule('grant_amount_low', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('9.99', ' '))), 'money');
$form->add('text', 'grant_amount_high', ts('Maximum Amount'), array('size' => 8, 'maxlength' => 8));
$form->addRule('grant_amount_high', ts('Please enter a valid money value (e.g. %1).', array(1 => CRM_Utils_Money::format('99.99', ' '))), 'money');
// add all the custom searchable fields
$grant = array('Grant');
$groupDetails = CRM_Core_BAO_CustomGroup::getGroupDetail(NULL, TRUE, $grant);
if ($groupDetails) {
$form->assign('grantGroupTree', $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);
}
}
}
$form->assign('validGrant', TRUE);
}