Skip to content

Commit

Permalink
Merge pull request #8157 from eileenmcnaughton/CRM-18424
Browse files Browse the repository at this point in the history
CRM-18424 better amount label for repeat transactions
  • Loading branch information
monishdeb committed May 18, 2016
2 parents 24fe960 + de4cd6a commit 9688aea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 36 deletions.
42 changes: 11 additions & 31 deletions templates/CRM/Contribute/Form/Contribution/Main.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -300,32 +300,6 @@
{/if}

{literal}
if ({/literal}"{$form.is_recur}"{literal}) {
if (document.getElementsByName("is_recur")[0].checked == true) {
window.onload = function() {
enablePeriod();
}
}
}

function enablePeriod ( ) {
var frqInt = {/literal}"{$form.frequency_interval}"{literal};
if ( document.getElementsByName("is_recur")[0].checked == true ) {
//get back to auto renew settings.
var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
if ( allowAutoRenew && cj("#auto_renew") ) {
showHideAutoRenew( null );
}
}
else {
//disabled auto renew settings.
var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
if ( allowAutoRenew && cj("#auto_renew") ) {
cj("#auto_renew").prop('checked', false );
cj('#allow_auto_renew').hide( );
}
}
}

cj('input[name="soft_credit_type_id"]').on('change', function() {
enableHonorType();
Expand All @@ -342,16 +316,22 @@
}

cj('input[id="is_recur"]').on('change', function() {
showRecurHelp();
toggleRecur();
});

function showRecurHelp( ) {
var showHelp = cj('input[id="is_recur"]:checked');
if ( showHelp.val() > 0) {
function toggleRecur( ) {
var isRecur = cj('input[id="is_recur"]:checked');
var allowAutoRenew = {/literal}'{$allowAutoRenewMembership}'{literal};
if ( allowAutoRenew && cj("#auto_renew") ) {
showHideAutoRenew( null );
}
if (isRecur.val() > 0) {
cj('#recurHelp').show();
cj('#amount_sum_label').text(ts('Regular amount'));
}
else {
cj('#recurHelp').hide();
cj('#amount_sum_label').text(ts('Total amount'));
}
}

Expand Down Expand Up @@ -381,7 +361,7 @@

CRM.$(function($) {
enableHonorType();
showRecurHelp();
toggleRecur();
skipPaymentMethod();
});

Expand Down
9 changes: 4 additions & 5 deletions templates/CRM/Price/Form/Calculate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@

{assign var='hideTotal' value=$quickConfig+$noCalcValueDisplay}
<div id="pricesetTotal" class="crm-section section-pricesetTotal">
{if !$hideTotal}
<div class="label" id="pricelabel">
<div class="label
{if $hideTotal}, hiddenElement{/if}" id="pricelabel">
<label>
{if ( $extends eq 'Contribution' ) || ( $extends eq 'Membership' )}
{ts}Total Amount{/ts}{else}{ts}Total Fee(s){/ts}
{if $isAdditionalParticipants} {ts}for this participant{/ts}{/if}
<span id='amount_sum_label'>{ts}Total Amount{/ts}{else}{ts}Total Fee(s){/ts}</span>
{if $isAdditionalParticipants} {ts}for this participant{/ts}{/if}
{/if}
</label>
</div>
{/if}
<div class="content calc-value" {if $hideTotal}style="display:none;"{/if} id="pricevalue" ></div>
</div>

Expand Down

0 comments on commit 9688aea

Please sign in to comment.