From fbfd63ecd88f6d9eb086cde99aa7460a8e856d20 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 28 Oct 2014 08:24:36 +1300 Subject: [PATCH] CRM-15509 towards refactoring control of payment fields to the payment processors This doesn't do much in itself but moves a small piece of the logic out of the tpl where it can be more easily overrided. However, this is not expected to be the final resting place of this assignment --- CRM/Core/Payment/Form.php | 11 +++++++++++ templates/CRM/Core/BillingBlock.tpl | 8 ++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index b611d8bc4f..af79441885 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -185,6 +185,11 @@ class CRM_Core_Payment_Form { 'attributes' => $creditCardType, 'is_required' => FALSE, ); + //CRM-15509 this is probably a temporary resting place for these form assignments but we are working towards putting this + // in an option group & having php / payment processors define the billing form rather than the tpl + $smarty = CRM_Core_Smarty::singleton(); + $smarty->assign('paymentTypeName', 'credit_card'); + $smarty->assign('paymentTypeLabel', ts('Credit Card Information')); } /** @@ -256,6 +261,12 @@ class CRM_Core_Payment_Form { 'attributes' => array('size' => 20, 'maxlength' => 64, 'autocomplete' => 'off'), 'is_required' => TRUE, ); + //CRM-15509 this is probably a temporary resting place for these form assignments but we are working towards putting this + // in an option group & having php / payment processors define the billing form rather than the tpl + $smarty = CRM_Core_Smarty::singleton(); + // replace these payment type names with an option group - moving name & label assumptions out of the tpl is a step towards that + $smarty->assign('paymentTypeName', 'direct_debit'); + $smarty->assign('paymentTypeLabel', ts('Direct Debit Information')); } /** diff --git a/templates/CRM/Core/BillingBlock.tpl b/templates/CRM/Core/BillingBlock.tpl index 794f329a84..eb40dd9ff3 100644 --- a/templates/CRM/Core/BillingBlock.tpl +++ b/templates/CRM/Core/BillingBlock.tpl @@ -33,13 +33,9 @@ {if $form.credit_card_number or $form.bank_account_number}
-
+
- {if $paymentProcessor.payment_type & 2} - {ts}Direct Debit Information{/ts} - {else} - {ts}Credit Card Information{/ts} - {/if} + {$paymentTypeLabel} {if $paymentProcessor.billing_mode & 2 and !$hidePayPalExpress }
-- 2.25.1