-- added formrule for CRM-12055
authorPradeep Nayak <pradeep@pradeep.(none)>
Wed, 7 Aug 2013 10:24:51 +0000 (15:54 +0530)
committerPradeep Nayak <pradeep@pradeep.(none)>
Wed, 7 Aug 2013 10:24:51 +0000 (15:54 +0530)
----------------------------------------
* 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
templates/CRM/Contribute/Form/ContributionPage/Amount.tpl

index 579e2e2711619dc7e6491bb18d2b842108ae4738..b5a41c9cc9db70d562ee5c5ab425a9dd4f4e0d9e 100644 (file)
@@ -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)) {
index 9d2fe99cce8a2e790a7c403c6efc8781d51d6465..3da42b3069e26948f9a0f928ee63c860c93f2cab 100644 (file)
             {/if}
                    
            <tr class="crm-contribution-form-block-amount_label">
-              <th scope="row" class="label" width="20%">{$form.amount_label.label}</th>
+              <th scope="row" class="label" width="20%">{$form.amount_label.label}<span class="marker"> *</span></th>
              <td>{$form.amount_label.html}</td>
            </tr>
             <tr class="crm-contribution-form-block-is_allow_other_amount"><th scope="row" class="label" width="20%">{$form.is_allow_other_amount.label}</th>