CRM-15283 - Pledge form fixes
authorColeman Watts <coleman@civicrm.org>
Sat, 13 Sep 2014 19:17:39 +0000 (15:17 -0400)
committerColeman Watts <coleman@civicrm.org>
Sat, 13 Sep 2014 19:17:39 +0000 (15:17 -0400)
templates/CRM/Pledge/Form/Pledge.tpl
templates/CRM/Pledge/Form/Selector.tpl

index 0a390d443cbd5464205632a7d29ace60c45aa331..d5b1e49e1db72240e1c4c4ad5ea52416bea36f24 100644 (file)
@@ -196,13 +196,12 @@ function loadPanes( id ) {
      <script type="text/javascript">
 
      function verify( ) {
-       var element = document.getElementsByName("is_acknowledge");
-        if ( element[0].checked ) {
+        if (cj('#is_acknowledge').is(':checked')) {
             var emailAddress = '{/literal}{$email}{literal}';
       if ( !emailAddress ) {
       var emailAddress = cj('#email-address').html();
       }
-      var message = '{/literal}{ts 1="'+emailAddress+'"}Click OK to save this Pledge record AND send an acknowledgment to %1 now{/ts}{literal}.';
+      var message = '{/literal}{ts escape="js" 1="'+emailAddress+'"}Click OK to save this Pledge record AND send an acknowledgment to %1 now{/ts}{literal}.';
             if (!confirm( message) ) {
                 return false;
             }
index 2dd8e9a3f994115822e969403c7b2c895fe2fab9..5b098166b5f297ba41d80c95102afba34e68769f 100644 (file)
 {* Build pledge payment details*}
 {literal}
 <script type="text/javascript">
-
-    function buildPaymentDetails( pledgeId, contactId )
-    {
-        var dataUrl = {/literal}"{crmURL p='civicrm/pledge/payment' h=0 q="action=browse&snippet=4&context=`$context`&pledgeId="}"{literal} + pledgeId + '&cid=' + contactId;
-        CRM.loadPage(dataUrl, {target: '#paymentDetails' + pledgeId});
-    }
+  (function($) {
+    // FIXME global function
+    window.buildPaymentDetails = function(pledgeId, contactId) {
+      var dataUrl = {/literal}"{crmURL p='civicrm/pledge/payment' h=0 q="action=browse&snippet=4&context=`$context`&pledgeId="}"{literal} + pledgeId + '&cid=' + contactId;
+      $('#paymentDetails' + pledgeId).load(dataUrl, function() {
+        $(this).trigger('crmLoad');
+      });
+    };
+  })(CRM.$);
 </script>
 {/literal}