本文整理汇总了PHP中CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields方法的具体用法?PHP CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields怎么用?PHP CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_BAO_ContributionSoft
的用法示例。
在下文中一共展示了CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* Build the form object.
*/
public function buildQuickForm()
{
$this->assignToTemplate();
$params = $this->_params;
// make sure we have values for it
if (!empty($this->_values['honoree_profile_id']) && !empty($params['soft_credit_type_id'])) {
$honorName = NULL;
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
$this->assign('soft_credit_type', $softCreditTypes[$params['soft_credit_type_id']]);
CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields($this, $params['honor']);
$fieldTypes = array('Contact');
$fieldTypes[] = CRM_Core_BAO_UFGroup::getContactType($this->_values['honoree_profile_id']);
$this->buildCustom($this->_values['honoree_profile_id'], 'honoreeProfileFields', TRUE, 'honor', $fieldTypes);
}
$this->assign('receiptFromEmail', CRM_Utils_Array::value('receipt_from_email', $this->_values));
$amount_block_is_active = $this->get('amount_block_is_active');
$this->assign('amount_block_is_active', $amount_block_is_active);
$invoiceSettings = Civi::settings()->get('contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
if ($invoicing) {
$getTaxDetails = FALSE;
$taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
foreach ($this->_lineItem as $key => $value) {
foreach ($value as $v) {
if (isset($v['tax_rate'])) {
if ($v['tax_rate'] != '') {
$getTaxDetails = TRUE;
}
}
}
}
$this->assign('getTaxDetails', $getTaxDetails);
$this->assign('taxTerm', $taxTerm);
$this->assign('totalTaxAmount', $params['tax_amount']);
}
if (!empty($params['selectProduct']) && $params['selectProduct'] != 'no_thanks') {
$option = CRM_Utils_Array::value('options_' . $params['selectProduct'], $params);
$productID = $params['selectProduct'];
CRM_Contribute_BAO_Premium::buildPremiumBlock($this, $this->_id, FALSE, $productID, $option);
$this->set('productID', $productID);
$this->set('option', $option);
}
$config = CRM_Core_Config::singleton();
if (in_array('CiviMember', $config->enableComponents)) {
if (isset($params['selectMembership']) && $params['selectMembership'] != 'no_thanks') {
$this->buildMembershipBlock($this->_membershipContactID, FALSE, $params['selectMembership'], FALSE);
if (!empty($params['auto_renew'])) {
$this->assign('auto_renew', TRUE);
}
} else {
$this->assign('membershipBlock', FALSE);
}
}
$this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE);
$this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE);
if (!empty($this->_values['onbehalf_profile_id']) && !empty($params['onbehalf'])) {
$fieldTypes = array('Contact', 'Organization');
$contactSubType = CRM_Contact_BAO_ContactType::subTypes('Organization');
$fieldTypes = array_merge($fieldTypes, $contactSubType);
if (is_array($this->_membershipBlock) && !empty($this->_membershipBlock)) {
$fieldTypes = array_merge($fieldTypes, array('Membership'));
} else {
$fieldTypes = array_merge($fieldTypes, array('Contribution'));
}
$this->buildCustom($this->_values['onbehalf_profile_id'], 'onbehalfProfile', TRUE, 'onbehalf', $fieldTypes);
}
$this->_separateMembershipPayment = $this->get('separateMembershipPayment');
$this->assign('is_separate_payment', $this->_separateMembershipPayment);
if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$this->assign('lineItem', $this->_lineItem);
} else {
$this->assign('is_quick_config', 1);
$this->_params['is_quick_config'] = 1;
}
$this->assign('priceSetID', $this->_priceSetId);
$paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, NULL, 'name');
if ($this->_paymentProcessor && $this->_paymentProcessor['payment_processor_type_id'] == CRM_Utils_Array::key('Google_Checkout', $paymentProcessorType) && !$this->_params['is_pay_later'] && !($this->_amount == 0)) {
$this->_checkoutButtonName = $this->getButtonName('next', 'checkout');
$this->add('image', $this->_checkoutButtonName, $this->_paymentProcessor['url_button'], array('class' => 'crm-form-submit'));
$this->addButtons(array(array('type' => 'back', 'name' => ts('Go Back'))));
} else {
// The concept of contributeMode is deprecated.
// the is_monetary concept probably should be too as it can be calculated from
// the existence of 'amount' & seems fragile.
if ($this->_contributeMode == 'notify' || !$this->_values['is_monetary'] || $this->_amount <= 0.0 || $this->_params['is_pay_later'] || $this->_separateMembershipPayment && $this->_amount <= 0.0) {
$contribButton = ts('Continue');
$this->assign('button', ts('Continue'));
} else {
$contribButton = ts('Make Contribution');
$this->assign('button', ts('Make Contribution'));
}
$this->addButtons(array(array('type' => 'next', 'name' => $contribButton, 'spacing' => ' ', 'isDefault' => TRUE, 'js' => array('onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');")), array('type' => 'back', 'name' => ts('Go Back'))));
}
$defaults = array();
$fields = array_fill_keys(array_keys($this->_fields), 1);
$fields["billing_state_province-{$this->_bltID}"] = $fields["billing_country-{$this->_bltID}"] = $fields["email-{$this->_bltID}"] = 1;
$contact = $this->_params;
//.........这里部分代码省略.........
示例2: sendMail
//.........这里部分代码省略.........
list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID);
}
//for display profile need to get individual contact id,
//hence get it from related_contact if on behalf of org true CRM-3767
//CRM-5001 Contribution/Membership:: On Behalf of Organization,
//If profile GROUP contain the Individual type then consider the
//profile is of Individual ( including the custom data of membership/contribution )
//IF Individual type not present in profile then it is consider as Organization data.
$userID = $contactID;
if ($preID = CRM_Utils_Array::value('custom_pre_id', $values)) {
if (!empty($values['related_contact'])) {
$preProfileTypes = CRM_Core_BAO_UFGroup::profileGroups($preID);
//@todo - following line should not refer to undefined $postProfileTypes? figure out way to test
if (in_array('Individual', $preProfileTypes) || in_array('Contact', $postProfileTypes)) {
//Take Individual contact ID
$userID = CRM_Utils_Array::value('related_contact', $values);
}
}
self::buildCustomDisplay($preID, 'customPre', $userID, $template, $params['custom_pre_id']);
}
$userID = $contactID;
if ($postID = CRM_Utils_Array::value('custom_post_id', $values)) {
if (!empty($values['related_contact'])) {
$postProfileTypes = CRM_Core_BAO_UFGroup::profileGroups($postID);
if (in_array('Individual', $postProfileTypes) || in_array('Contact', $postProfileTypes)) {
//Take Individual contact ID
$userID = CRM_Utils_Array::value('related_contact', $values);
}
}
self::buildCustomDisplay($postID, 'customPost', $userID, $template, $params['custom_post_id']);
}
if (isset($values['honor'])) {
$honorValues = $values['honor'];
CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields($template, $honorValues['honor_profile_values'], $honorValues['honor_profile_id'], $honorValues['honor_id']);
}
$title = isset($values['title']) ? $values['title'] : CRM_Contribute_PseudoConstant::contributionPage($values['contribution_page_id']);
// set email in the template here
$tplParams = array('email' => $email, 'receiptFromEmail' => CRM_Utils_Array::value('receipt_from_email', $values), 'contactID' => $contactID, 'displayName' => $displayName, 'contributionID' => CRM_Utils_Array::value('contribution_id', $values), 'contributionOtherID' => CRM_Utils_Array::value('contribution_other_id', $values), 'lineItem' => CRM_Utils_Array::value('lineItem', $values), 'priceSetID' => CRM_Utils_Array::value('priceSetID', $values), 'title' => $title, 'isShare' => CRM_Utils_Array::value('is_share', $values), 'thankyou_title' => CRM_Utils_Array::value('thankyou_title', $values));
if ($contributionTypeId = CRM_Utils_Array::value('financial_type_id', $values)) {
$tplParams['contributionTypeId'] = $contributionTypeId;
$tplParams['contributionTypeName'] = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialType', $contributionTypeId);
}
if ($contributionPageId = CRM_Utils_Array::value('id', $values)) {
$tplParams['contributionPageId'] = $contributionPageId;
}
// address required during receipt processing (pdf and email receipt)
if ($displayAddress = CRM_Utils_Array::value('address', $values)) {
$tplParams['address'] = $displayAddress;
}
// CRM-6976
$originalCCReceipt = CRM_Utils_Array::value('cc_receipt', $values);
// cc to related contacts of contributor OR the one who
// signs up. Is used for cases like - on behalf of
// contribution / signup ..etc
if (array_key_exists('related_contact', $values)) {
list($ccDisplayName, $ccEmail) = CRM_Contact_BAO_Contact_Location::getEmailDetails($values['related_contact']);
$ccMailId = "{$ccDisplayName} <{$ccEmail}>";
//@todo - this is the only place in this function where $values is altered - but I can't find any evidence it is used
$values['cc_receipt'] = !empty($values['cc_receipt']) ? $values['cc_receipt'] . ',' . $ccMailId : $ccMailId;
// reset primary-email in the template
$tplParams['email'] = $ccEmail;
$tplParams['onBehalfName'] = $displayName;
$tplParams['onBehalfEmail'] = $email;
$ufJoinParams = array('module' => 'onBehalf', 'entity_table' => 'civicrm_contribution_page', 'entity_id' => $values['id']);
$OnBehalfProfile = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
$profileId = $OnBehalfProfile[0];
示例3: buildQuickForm
/**
* Function to actually build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
$this->assignToTemplate();
$params = $this->_params;
$honor_block_is_active = $this->get('honor_block_is_active');
// make sure we have values for it
if ($honor_block_is_active && !empty($params['soft_credit_type_id'])) {
$honorName = null;
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
$this->assign('honor_block_is_active', $honor_block_is_active);
$this->assign('soft_credit_type', $softCreditTypes[$params['soft_credit_type_id']]);
CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields($this, $params['honor'], $params['honoree_profile_id']);
$fieldTypes = array('Contact');
$fieldTypes[] = CRM_Core_BAO_UFGroup::getContactType($params['honoree_profile_id']);
$this->buildCustom($params['honoree_profile_id'], 'honoreeProfileFields', TRUE, 'honor', $fieldTypes);
}
$this->assign('receiptFromEmail', CRM_Utils_Array::value('receipt_from_email', $this->_values));
$amount_block_is_active = $this->get('amount_block_is_active');
$this->assign('amount_block_is_active', $amount_block_is_active);
if (!empty($params['selectProduct']) && $params['selectProduct'] != 'no_thanks') {
$option = CRM_Utils_Array::value('options_' . $params['selectProduct'], $params);
$productID = $params['selectProduct'];
CRM_Contribute_BAO_Premium::buildPremiumBlock($this, $this->_id, FALSE, $productID, $option);
$this->set('productID', $productID);
$this->set('option', $option);
}
$config = CRM_Core_Config::singleton();
if (in_array('CiviMember', $config->enableComponents)) {
if (isset($params['selectMembership']) && $params['selectMembership'] != 'no_thanks') {
CRM_Member_BAO_Membership::buildMembershipBlock($this, $this->_id, $this->_membershipContactID, FALSE, $params['selectMembership'], FALSE);
} else {
$this->assign('membershipBlock', FALSE);
}
}
$this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE);
$this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE);
if (!empty($params['hidden_onbehalf_profile'])) {
$ufJoinParams = array('module' => 'onBehalf', 'entity_table' => 'civicrm_contribution_page', 'entity_id' => $this->_id);
$OnBehalfProfile = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
$profileId = $OnBehalfProfile[0];
$fieldTypes = array('Contact', 'Organization');
$contactSubType = CRM_Contact_BAO_ContactType::subTypes('Organization');
$fieldTypes = array_merge($fieldTypes, $contactSubType);
if (is_array($this->_membershipBlock) && !empty($this->_membershipBlock)) {
$fieldTypes = array_merge($fieldTypes, array('Membership'));
} else {
$fieldTypes = array_merge($fieldTypes, array('Contribution'));
}
$this->buildCustom($profileId, 'onbehalfProfile', TRUE, 'onbehalf', $fieldTypes);
}
$this->_separateMembershipPayment = $this->get('separateMembershipPayment');
$this->assign('is_separate_payment', $this->_separateMembershipPayment);
if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$this->assign('lineItem', $this->_lineItem);
} else {
$this->assign('is_quick_config', 1);
$this->_params['is_quick_config'] = 1;
}
$this->assign('priceSetID', $this->_priceSetId);
$paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(false, null, 'name');
if ($this->_paymentProcessor && $this->_paymentProcessor['payment_processor_type_id'] == CRM_Utils_Array::key('Google_Checkout', $paymentProcessorType) && !$this->_params['is_pay_later'] && !($this->_amount == 0)) {
$this->_checkoutButtonName = $this->getButtonName('next', 'checkout');
$this->add('image', $this->_checkoutButtonName, $this->_paymentProcessor['url_button'], array('class' => 'form-submit'));
$this->addButtons(array(array('type' => 'back', 'name' => ts('<< Go Back'))));
} else {
if ($this->_contributeMode == 'notify' || !$this->_values['is_monetary'] || $this->_amount <= 0.0 || $this->_params['is_pay_later'] || $this->_separateMembershipPayment && $this->_amount <= 0.0) {
$contribButton = ts('Continue >>');
$this->assign('button', ts('Continue'));
} else {
$contribButton = ts('Make Contribution');
$this->assign('button', ts('Make Contribution'));
}
$this->addButtons(array(array('type' => 'next', 'name' => $contribButton, 'spacing' => ' ', 'isDefault' => TRUE, 'js' => array('onclick' => "return submitOnce(this,'" . $this->_name . "','" . ts('Processing') . "');")), array('type' => 'back', 'name' => ts('Go Back'))));
}
$defaults = array();
$fields = array();
foreach ($this->_fields as $name => $dontCare) {
if ($name != 'onbehalf' || $name != 'honor') {
$fields[$name] = 1;
}
}
$fields["billing_state_province-{$this->_bltID}"] = $fields["billing_country-{$this->_bltID}"] = $fields["email-{$this->_bltID}"] = 1;
$contact = $this->_params;
foreach ($fields as $name => $dontCare) {
if (isset($contact[$name])) {
$defaults[$name] = $contact[$name];
if (substr($name, 0, 7) == 'custom_') {
$timeField = "{$name}_time";
if (isset($contact[$timeField])) {
$defaults[$timeField] = $contact[$timeField];
}
if (isset($contact["{$name}_id"])) {
$defaults["{$name}_id"] = $contact["{$name}_id"];
}
//.........这里部分代码省略.........
示例4: buildQuickForm
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm()
{
$this->assignToTemplate();
$productID = $this->get('productID');
$option = $this->get('option');
$membershipTypeID = $this->get('membershipTypeID');
$this->assign('receiptFromEmail', CRM_Utils_Array::value('receipt_from_email', $this->_values));
if ($productID) {
CRM_Contribute_BAO_Premium::buildPremiumBlock($this, $this->_id, FALSE, $productID, $option);
}
if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_priceSetId, 'is_quick_config')) {
$this->assign('lineItem', $this->_lineItem);
} else {
if (is_array($membershipTypeID)) {
$membershipTypeID = current($membershipTypeID);
}
$this->assign('is_quick_config', 1);
$this->_params['is_quick_config'] = 1;
}
$this->assign('priceSetID', $this->_priceSetId);
$this->assign('useForMember', $this->get('useForMember'));
$params = $this->_params;
$invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
$invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings);
if ($invoicing) {
$getTaxDetails = FALSE;
$taxTerm = CRM_Utils_Array::value('tax_term', $invoiceSettings);
foreach ($this->_lineItem as $key => $value) {
foreach ($value as $v) {
if (isset($v['tax_rate'])) {
if ($v['tax_rate'] != '') {
$getTaxDetails = TRUE;
}
}
}
}
$this->assign('getTaxDetails', $getTaxDetails);
$this->assign('taxTerm', $taxTerm);
$this->assign('totalTaxAmount', $params['tax_amount']);
}
if ($this->_honor_block_is_active && !empty($params['soft_credit_type_id'])) {
$honorName = NULL;
$softCreditTypes = CRM_Core_OptionGroup::values("soft_credit_type", FALSE);
$this->assign('honor_block_is_active', $this->_honor_block_is_active);
$this->assign('soft_credit_type', $softCreditTypes[$params['soft_credit_type_id']]);
CRM_Contribute_BAO_ContributionSoft::formatHonoreeProfileFields($this, $params['honor'], $params['honoree_profile_id']);
$fieldTypes = array('Contact');
$fieldTypes[] = CRM_Core_BAO_UFGroup::getContactType($params['honoree_profile_id']);
$this->buildCustom($params['honoree_profile_id'], 'honoreeProfileFields', TRUE, 'honor', $fieldTypes);
}
$qParams = "reset=1&id={$this->_id}";
//pcp elements
if ($this->_pcpId) {
$qParams .= "&pcpId={$this->_pcpId}";
$this->assign('pcpBlock', TRUE);
foreach (array('pcp_display_in_roll', 'pcp_is_anonymous', 'pcp_roll_nickname', 'pcp_personal_note') as $val) {
if (!empty($this->_params[$val])) {
$this->assign($val, $this->_params[$val]);
}
}
}
$this->assign('qParams', $qParams);
if ($membershipTypeID) {
$transactionID = $this->get('membership_trx_id');
$membershipAmount = $this->get('membership_amount');
$renewalMode = $this->get('renewal_mode');
$this->assign('membership_trx_id', $transactionID);
$this->assign('membership_amount', $membershipAmount);
$this->assign('renewal_mode', $renewalMode);
$this->buildMembershipBlock($this->_membershipContactID, FALSE, $membershipTypeID, TRUE, NULL);
if (!empty($params['auto_renew'])) {
$this->assign('auto_renew', TRUE);
}
}
$this->_separateMembershipPayment = $this->get('separateMembershipPayment');
$this->assign("is_separate_payment", $this->_separateMembershipPayment);
$this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE);
$this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE);
if (!empty($params['hidden_onbehalf_profile'])) {
$ufJoinParams = array('module' => 'onBehalf', 'entity_table' => 'civicrm_contribution_page', 'entity_id' => $this->_id);
$OnBehalfProfile = CRM_Core_BAO_UFJoin::getUFGroupIds($ufJoinParams);
$profileId = $OnBehalfProfile[0];
$fieldTypes = array('Contact', 'Organization');
$contactSubType = CRM_Contact_BAO_ContactType::subTypes('Organization');
$fieldTypes = array_merge($fieldTypes, $contactSubType);
if (is_array($this->_membershipBlock) && !empty($this->_membershipBlock)) {
$fieldTypes = array_merge($fieldTypes, array('Membership'));
} else {
$fieldTypes = array_merge($fieldTypes, array('Contribution'));
}
$this->buildCustom($profileId, 'onbehalfProfile', TRUE, 'onbehalf', $fieldTypes);
}
$this->assign('trxn_id', CRM_Utils_Array::value('trxn_id', $this->_params));
$this->assign('receive_date', CRM_Utils_Date::mysqlToIso(CRM_Utils_Array::value('receive_date', $this->_params)));
$defaults = array();
//.........这里部分代码省略.........