From b52a8f03b2c6fb52ec2b241b52329f125237f2ee Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Wed, 7 Aug 2013 15:54:51 +0530 Subject: [PATCH] -- added formrule for CRM-12055 ---------------------------------------- * CRM-12055: Allow users to change label used for Contribution Amounts in online contribution page w/o switching to a price set http://issues.civicrm.org/jira/browse/CRM-12055 --- CRM/Contribute/Form/ContributionPage/Amount.php | 4 ++++ templates/CRM/Contribute/Form/ContributionPage/Amount.tpl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php index 579e2e2711..b5a41c9cc9 100644 --- a/CRM/Contribute/Form/ContributionPage/Amount.php +++ b/CRM/Contribute/Form/ContributionPage/Amount.php @@ -310,6 +310,10 @@ SELECT id } } + //check for the amount label (mandatory) + if (CRM_Utils_Array::value('amount_block_is_active', $fields) && empty($fields['amount_label'])) { + $errors['amount_label'] = ts('Please enter the contribution amount label.'); + } $minAmount = CRM_Utils_Array::value('min_amount', $fields); $maxAmount = CRM_Utils_Array::value('max_amount', $fields); if (!empty($minAmount) && !empty($maxAmount)) { diff --git a/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl b/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl index 9d2fe99cce..3da42b3069 100644 --- a/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl +++ b/templates/CRM/Contribute/Form/ContributionPage/Amount.tpl @@ -159,7 +159,7 @@ {/if} - {$form.amount_label.label} + {$form.amount_label.label} * {$form.amount_label.html} {$form.is_allow_other_amount.label} -- 2.25.1