CRM-15742 - Prevent dialog from returning to an invalid state
authorColeman Watts <coleman@civicrm.org>
Tue, 13 Jan 2015 18:01:42 +0000 (13:01 -0500)
committerColeman Watts <coleman@civicrm.org>
Tue, 13 Jan 2015 18:01:42 +0000 (13:01 -0500)
js/crm.ajax.js
templates/CRM/Contribute/Form/AdditionalPayment.tpl
templates/CRM/Contribute/Form/Contribution.tpl
templates/CRM/Pledge/Page/Payment.tpl

index 0743d99aa09a59775d87368475ed81e30a44d716..3ee5394097030ed6f75b0043d9036826edd986bb 100644 (file)
         validate: true,
         refreshAction: ['next_new', 'submit_savenext', 'upload_new'],
         cancelButton: '.cancel',
-        openInline: 'a.open-inline, a.button, a.action-item',
+        openInline: 'a.open-inline, a.button, a.action-item, a.open-inline-noreturn',
         onCancel: function(event) {}
       }
     };
       if (settings.openInline) {
         settings.autoClose = $el.crmSnippet('isOriginalUrl');
         $(settings.openInline, this).not(exclude + ', .crm-popup').click(function(event) {
+          if ($(this).hasClass('open-inline-noreturn')) {
+            // Force reset of original url
+            $el.data('civiCrmSnippet')._originalUrl = $(this).attr('href');
+          }
           $el.crmSnippet('option', 'url', $(this).attr('href')).crmSnippet('refresh');
           return false;
         });
index 8504a1c90253b15a94a76eccf52c3cbbb38a39b5..ca4d8e97614f4a033f33af8df3d1c1a1a4ced22e 100644 (file)
@@ -79,7 +79,7 @@
     {/if}
     {if $paymentType eq 'owed'}
       <div class="action-link css_right crm-link-credit-card-mode">
-        <a class="open-inline crm-hover-button" href="{$ccModeLink}">&raquo; {ts}submit credit card payment{/ts}</a>
+        <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}">&raquo; {ts}submit credit card payment{/ts}</a>
       </div>
     {/if}
   {/if}
index 7c9cec2248f557d2b5193a92eec4b516c6987bc3..9ce7f2cca92ad14ee28b0e317753dfa830c8dbd7 100644 (file)
@@ -68,7 +68,7 @@
       {else}
         {capture assign=ccModeLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=add&context=standalone&mode=live"}{/capture}
       {/if}
-     <a class="open-inline crm-hover-button action-item" href="{$ccModeLink}">&raquo; {ts}submit credit card contribution{/ts}</a>
+     <a class="open-inline-noreturn action-item crm-hover-button" href="{$ccModeLink}">&raquo; {ts}submit credit card contribution{/ts}</a>
     </div>
     {/if}
   <div class="crm-submit-buttons">
index 307d0f04a0272b6d7046ec039a5617eeee2be698..29476c3fea652e0f1e463ed8aff19f5a862c87a2 100644 (file)
             <a class="crm-hover-button action-item" href="{$viewContribURL}">{ts}View Payment{/ts}</a>
         {else} {* Links to record / submit a payment. *}
             {capture assign=newContribURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&context=`$context`&ppid=`$row.id`"}{/capture}
-            <a class="crm-hover-button action-item" href="{$newContribURL}">{ts}Record Payment{/ts}</a>
+            <a class="open-inline-noreturn crm-hover-button action-item" href="{$newContribURL}">{ts}Record Payment{/ts}</a>
             {if $newCredit}
               {capture assign=newCreditURL}{crmURL p="civicrm/contact/view/contribution" q="reset=1&action=add&cid=`$contactId`&ppid=`$row.id`&context=`$context`&mode=live"}{/capture}
-              <a class="crm-hover-button action-item" href="{$newCreditURL}">{ts}Credit Card Payment{/ts}</a>
+              <a class="open-inline-noreturn action-item crm-hover-button" href="{$newCreditURL}">{ts}Credit Card Payment{/ts}</a>
             {/if}
             {capture assign=editURL}{crmURL p="civicrm/pledge/payment" q="reset=1&action=update&cid=`$contactId`&context=`$context`&ppId=`$row.id`"}{/capture}
             <a class="crm-hover-button action-item" href="{$editURL}">{ts}Edit Scheduled Payment{/ts}</a>