CRM-14666 - add conditional explanation for recurring contributions.
authorDave Greenberg <dave@civicrm.org>
Sat, 10 May 2014 01:11:30 +0000 (18:11 -0700)
committerDave Greenberg <dave@civicrm.org>
Sat, 10 May 2014 01:11:30 +0000 (18:11 -0700)
----------------------------------------
* CRM-14666:
  https://issues.civicrm.org/jira/browse/CRM-14666

templates/CRM/Contribute/Form/Contribution/Main.tpl

index 48bcf53b20fb1b93300416650533d32e1a244cdb..dfd3d1909903179cd22a9f8864e5dab74b9d5671 100644 (file)
         {$form.frequency_unit.html}
       {/if}
       {if $is_recur_installments}
+        <span id="recur_installments_num">
         {ts}for{/ts} {$form.installments.html} {$form.installments.label}
+        </span>
       {/if}
+      <div id="recurHelp" class="description">
+                               {ts}Your recurring contribution will be processed automatically.{/ts}
+                               {if $is_recur_installments}
+                                       {ts}You can specify the number of installments, or you can leave the number of installments blank if you want to make an open-ended commitment. In either case, you can choose to cancel at any time.{/ts}
+                               {/if}
+        {if $is_email_receipt}
+          {ts}You will receive an email receipt for each recurring contribution.{/ts}
+        {/if}
+      </div>
     </div>
     <div class="clear"></div>
   </div>
     }
   }
 
+       cj('input[id="is_recur"]').on('change', function() {
+               showRecurHelp();
+       });
+
+  function showRecurHelp( ) {
+    var showHelp = cj('input[id="is_recur"]:checked'); 
+    if ( showHelp.val() > 0) {
+      cj('#recurHelp').show();
+    }
+    else {
+      cj('#recurHelp').hide();
+    }
+  }
+       
   function pcpAnonymous( ) {
     // clear nickname field if anonymous is true
     if (document.getElementsByName("pcp_is_anonymous")[1].checked) {
   CRM.$(function($) {
     toggleConfirmButton();
                enableHonorType();
+               showRecurHelp();
   });
 
   function showHidePayPalExpressOption() {