// Get the contribution id if update
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
if (!empty($this->_id)) {
+ $this->assignPaymentInfoBlock();
$this->assign('contribID', $this->_id);
}
$paymentInstrument = FALSE;
if (!$this->_mode) {
+ // payment_instrument isn't required in edit and will not be present when payment block is enabled.
+ $required = $this->_id ? FALSE : TRUE;
$checkPaymentID = array_search('Check', CRM_Contribute_PseudoConstant::paymentInstrument('name'));
$paymentInstrument = $this->add('select', 'payment_instrument_id',
ts('Payment Method'),
array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::paymentInstrument(),
- TRUE, array('onChange' => "return showHideByValue('payment_instrument_id','{$checkPaymentID}','checkNumber','table-row','select',false);")
+ $required, array('onChange' => "return showHideByValue('payment_instrument_id','{$checkPaymentID}','checkNumber','table-row','select',false);")
);
}
$this->_values = civicrm_api3('FinancialTrxn', 'getsingle', array('id' => $this->_id));
if (!empty($this->_values['payment_processor_id'])) {
- CRM_Core_Error::statusBounce(ts('You cannot update this payment'));
+ CRM_Core_Error::statusBounce(ts('You cannot update this payment as it is tied to a payment processor'));
}
}
{if $contribution_status_id eq 2}{if $is_pay_later }: {ts}Pay Later{/ts} {else}: {ts}Incomplete Transaction{/ts}{/if}{/if}
</td>
<td>
- {if $contactId && $contribID && $contributionMode EQ null && $contribution_status_id eq 2}
+ {if !$isUsePaymentBlock && $contactId && $contribID && $contributionMode EQ null && $contribution_status_id eq 2}
{capture assign=payNowLink}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=update&id=`$contribID`&cid=`$contactId`&context=`$context`&mode=live"}{/capture}
<a class="open-inline action-item crm-hover-button" href="{$payNowLink}">» {ts}Pay with Credit Card{/ts}</a>
{/if}
<legend>
{ts}Payment Details{/ts}
</legend>
+ {if $isUsePaymentBlock}
+ {include file="CRM/Contribute/Form/PaymentInfoBlock.tpl"}
+ {else}
<table class="form-layout-compressed" >
<tr class="crm-contribution-form-block-payment_instrument_id">
<td class="label">{$form.payment_instrument_id.label}</td>
<td {$valueStyle}>{$form.trxn_id.html} {help id="id-trans_id"}</td>
</tr>
</table>
+ {/if}
</fieldset>
{/if}
- {include file='CRM/Core/BillingBlockWrapper.tpl'}
+ {if !$isUsePaymentBlock}
+ {include file='CRM/Core/BillingBlockWrapper.tpl'}
+ {/if}
<!-- start of soft credit -->
{if !$payNow}