From 2b3fa30d0660ba5bbaeb59e6b5cda7be16973dfe Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Fri, 14 Nov 2014 12:49:29 -0800 Subject: [PATCH] CRM-15555 - Fix bug in addPaypalExpressCode function. Clean up Billing required label and add inline help. Fix issue where PayPal fields not picked up on page load in event/register due to missing change in Register.tpl. ---------------------------------------- * CRM-15555: https://issues.civicrm.org/jira/browse/CRM-15555 --- CRM/Contribute/Form/ContributionPage/Amount.php | 2 +- CRM/Core/Payment/Form.php | 2 +- CRM/Event/Form/ManageEvent/Fee.php | 2 +- templates/CRM/Contribute/Form/ContributionPage/Amount.tpl | 4 +++- templates/CRM/Event/Form/ManageEvent/Fee.tpl | 8 +++++--- templates/CRM/Event/Form/Registration/Register.tpl | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php index 366004c917..9258d0a64d 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -141,7 +141,7 @@ SELECT id FALSE ); $this->addWysiwyg('pay_later_receipt', ts('Pay Later Instructions'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'pay_later_receipt')); - $this->addElement('checkbox', 'is_billing_required', ts('Is billing block required')); + $this->addElement('checkbox', 'is_billing_required', ts('Billing address required')); //add partial payment options diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index e33623631f..38feff59f1 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -299,7 +299,7 @@ class CRM_Core_Payment_Form { */ protected static function addPaypalExpressCode(&$form) { if (empty($form->isBackOffice)) { - if (CRM_Utils_Array::value('billing_mode', $form->_paymentProcessor) ==4 + if (CRM_Utils_Array::value('billing_mode', $form->_paymentProcessor) == 3 ) { $form->_expressButtonName = $form->getButtonName('upload', 'express'); $form->assign('expressButtonName', $form->_expressButtonName); diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php index bfe253f22c..c3710506ce 100644 --- a/CRM/Event/Form/ManageEvent/Fee.php +++ b/CRM/Event/Form/ManageEvent/Fee.php @@ -288,7 +288,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent { ); $this->addWysiwyg('pay_later_receipt', ts('Pay Later Instructions'), CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'pay_later_receipt')); - $this->addElement('checkbox', 'is_billing_required', ts('Is billing block required')); + $this->addElement('checkbox', 'is_billing_required', ts('Billing address required')); $this->add('text', 'fee_label', ts('Fee Label')); $price = CRM_Price_BAO_PriceSet::getAssoc(FALSE, 'CiviEvent'); diff --git a/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl b/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl index 163536f25b..397bd81052 100644 --- a/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl +++ b/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl @@ -66,7 +66,9 @@ {ts}Instructions added to Confirmation and Thank-you pages, as well as the confirmation email, when the user selects the 'pay later' option (e.g. 'Mail your check to ... within 3 business days.').{/ts} {$form.is_billing_required.label} - {$form.is_billing_required.html} + {$form.is_billing_required.html}
+ {ts}Check this box to require users who select the pay later option to provide billing name and address.{/ts} + diff --git a/templates/CRM/Event/Form/ManageEvent/Fee.tpl b/templates/CRM/Event/Form/ManageEvent/Fee.tpl index 930aaffc11..90d599d33a 100644 --- a/templates/CRM/Event/Form/ManageEvent/Fee.tpl +++ b/templates/CRM/Event/Form/ManageEvent/Fee.tpl @@ -96,15 +96,17 @@ {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='pay_later_receipt' id=$id}{/if}{$form.pay_later_receipt.html|crmAddClass:big} - +   {ts}Instructions added to Confirmation and Thank-you pages when the user selects the 'pay later' option (e.g. 'Mail your check to ... within 3 business days.').{/ts} - {$form.is_billing_required.html} - {$form.is_billing_required.label} + + {$form.is_billing_required.label}
+ {ts}Check this box to require users who select the pay later option to provide billing name and address.{/ts} + diff --git a/templates/CRM/Event/Form/Registration/Register.tpl b/templates/CRM/Event/Form/Registration/Register.tpl index 611c7b3b33..4b534f50a7 100644 --- a/templates/CRM/Event/Form/Registration/Register.tpl +++ b/templates/CRM/Event/Form/Registration/Register.tpl @@ -154,7 +154,7 @@
{* If we have a payment processor, load it - otherwise it happens via ajax *} - {if $ppType or $isBillingAddressRequiredForPayLater} + {if $paymentProcessorID or $isBillingAddressRequiredForPayLater} {include file="CRM/Event/Form/Registration/Register.tpl" snippet=4} {/if}
-- 2.25.1