X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=templates%2FCRM%2FContribute%2FForm%2FContribution.tpl;h=c7f3e1d1aecdcee5a163f29491613ac479eb3f48;hb=be9628dc7ddc80f2ecd9e5e4e5699897d88b42a1;hp=7c5597dac574956f2111d2311d2797a13d7848cd;hpb=6a90c48471bdb1bde40012a1c0ae879e710d66b2;p=civicrm-core.git diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index 7c5597dac5..c7f3e1d1ae 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -33,12 +33,6 @@ {include file="CRM/Contribute/Form/AdditionalInfo/$formType.tpl"} {else} - {if $contributionMode} -

{if $ppID}{ts}Credit Card Pledge Payment{/ts}{else}{ts}Credit Card Contribution{/ts}{/if}

- {elseif $context NEQ 'standalone'} -

{if $action eq 1 or $action eq 1024}{if $ppID}{ts}Pledge Payment{/ts}{else}{ts}New Contribution{/ts}{/if}{elseif $action eq 8}{ts}Delete Contribution{/ts}{else}{ts}Edit Contribution{/ts}{/if}

- {/if} -
{if $contributionMode == 'test' } @@ -67,16 +61,18 @@ {ts}WARNING: Deleting this contribution will result in the loss of the associated financial transactions (if any).{/ts} {ts}Do you want to continue?{/ts}
{else} -
- {include file="CRM/common/formButtons.tpl"} {if $newCredit AND $action EQ 1 AND $contributionMode EQ null} + {/if} +
+ {include file="CRM/common/formButtons.tpl"}
{if $isOnline}{assign var=valueStyle value=" class='view-value'"}{else}{assign var=valueStyle value=""}{/if} @@ -85,9 +81,6 @@ {else} - {if !$contributionMode and !$email and $outBound_option != 2} - {assign var='profileCreateCallback' value=1 } - {/if} {/if} @@ -203,7 +196,7 @@ {if $hideCalendar neq true} {include file="CRM/common/jcalendar.tpl" elementName=cancel_date} {else} - {$form.cancel_date.html|crmDate} + {$form.cancel_date.value|crmDate} {/if} @@ -213,7 +206,7 @@ - +
{ts}Contributor{/ts}{$displayName}
{$form.contact_id.label} {$form.contact_id.html}
{$form.cancel_reason.label}{$form.cancel_reason.html|crmReplace:class:huge}{$form.cancel_reason.html}
@@ -307,12 +300,12 @@ {if $showCheckNumber || !$isOnline} {$form.check_number.label} - {$form.check_number.html|crmReplace:class:six} + {$form.check_number.html} {/if} {$form.trxn_id.label} - {$form.trxn_id.html|crmReplace:class:twelve} {help id="id-trans_id"} + {$form.trxn_id.html} {help id="id-trans_id"} {if $email and $outBound_option != 2} @@ -399,38 +392,26 @@ {if $context eq 'standalone' and $outBound_option != 2 } {literal} CRM.$(function($) { - cj("#contact_1").blur( function( ) { - checkEmail( ); - }); + + var $form = $("form.{/literal}{$form.formClass}{literal}"); + $("#contact_id", $form).change(checkEmail); checkEmail( ); + + function checkEmail( ) { + var data = $("#contact_id", $form).select2('data'); + if (data && data.extra && data.extra.email && data.extra.email.length) { + $("#email-receipt", $form).show(); + $("#email-address", $form).html(data.extra.email); + } + else { + $("#email-receipt", $form).hide(); + } + } + showHideByValue( 'is_email_receipt', '', 'receiptDate', 'table-row', 'radio', true); showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false ); }); - function checkEmail( ) { - var contactID = cj("input[name='contact_select_id[1]']").val(); - if (contactID) { - var postUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' h=0}{literal}"; - cj.post( postUrl, {contact_id: contactID}, - function (response) { - if (response) { - cj("#email-receipt").show( ); - cj("#email-address").html(response); - } - else { - cj("#email-receipt").hide( ); - } - } - ); - } - else { - cj("#email-receipt").hide( ); - } - } - - function profileCreateCallback( blockNo ) { - checkEmail( ); - } {/literal} {/if} @@ -503,19 +484,20 @@ showHideCancelInfo(cj('#contribution_status_id')); cj('#contribution_status_id').change(function() { - showHideCancelInfo(this); + showHideCancelInfo(cj('#contribution_status_id')); } ); }); function showHideCancelInfo(obj) { - contributionStatus = cj(obj).val(); - if (contributionStatus == 3 || contributionStatus == 7) { + if (obj.find(":selected").text() == 'Refunded' || obj.find(":selected").text() == 'Cancelled') { cj('#cancelInfo').show( ); + cj('#total_amount').attr('readonly', true); } else { - status(); + status(); cj('#cancelInfo').hide( ); + cj("#total_amount").removeAttr('readonly'); } }