Skip to content

Commit

Permalink
CRM-20889: Toggle check_number field on backoffice form as payment fo…
Browse files Browse the repository at this point in the history
…rm fields
  • Loading branch information
monishdeb committed Jul 23, 2017
1 parent d178b7c commit 2f15963
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 31 deletions.
4 changes: 0 additions & 4 deletions CRM/Contribute/Form/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,6 @@ public function preProcess() {
return;
}

$this->assign('showCheckNumber', TRUE);

$this->_fromEmails = CRM_Core_BAO_Email::getFromEmail();

if (in_array('CiviPledge', CRM_Core_Config::singleton()->enableComponents) && !$this->_formType) {
Expand Down Expand Up @@ -764,7 +762,6 @@ public function buildQuickForm() {
if ($this->_online) {
$this->assign('hideCalender', TRUE);
}
$checkNumber = $this->add('text', 'check_number', ts('Check Number'), $attributes['contribution_check_number']);

$this->addDateTime('receipt_date', ts('Receipt Date'), FALSE, array('formatType' => 'activityDateTime'));
$this->addDateTime('cancel_date', ts('Cancelled / Refunded Date'), FALSE, array('formatType' => 'activityDateTime'));
Expand Down Expand Up @@ -899,7 +896,6 @@ public function buildQuickForm() {
if ($totalAmount) {
$totalAmount->freeze();
}
$checkNumber->freeze();
$paymentInstrument->freeze();
$trxnId->freeze();
$financialType->freeze();
Expand Down
5 changes: 1 addition & 4 deletions CRM/Core/Payment/Manual.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ public function getPaymentFormFields() {
return array('credit_card_type', 'pan_truncation');
}
elseif ($paymentInstrument === 'Check') {
// Really we should render check_number here, but we need to review how we edit
// check_numebr since we expose it as editable on the contribution form,
// even though it should only be editable from a transation specific form.
return array();
return array('check_number');
}
return array();
}
Expand Down
6 changes: 0 additions & 6 deletions templates/CRM/Contribute/Form/AdditionalPayment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@
<td >{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
</td>
</tr>
{if $showCheckNumber || !$isOnline}
<tr id="checkNumber" class="crm-payment-form-block-check_number">
<td class="label">{$form.check_number.label}</td>
<td>{$form.check_number.html}</td>
</tr>
{/if}
<tr class="crm-payment-form-block-trxn_id">
<td class="label">{$form.trxn_id.label}</td>
<td>{$form.trxn_id.html} {help id="id-trans_id"}</td>
Expand Down
6 changes: 0 additions & 6 deletions templates/CRM/Contribute/Form/Contribution.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,6 @@
<td {$valueStyle}>{$form.payment_instrument_id.html} {help id="payment_instrument_id"}</td>
</td>
</tr>
{if $showCheckNumber || !$isOnline}
<tr id="checkNumber" class="crm-contribution-form-block-check_number">
<td class="label">{$form.check_number.label}</td>
<td>{$form.check_number.html}</td>
</tr>
{/if}
<tr class="crm-contribution-form-block-trxn_id">
<td class="label">{$form.trxn_id.label}</td>
<td {$valueStyle}>{$form.trxn_id.html} {help id="id-trans_id"}</td>
Expand Down
4 changes: 3 additions & 1 deletion templates/CRM/Event/Form/EventFees.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@

{/if}

{include file='CRM/Core/BillingBlockWrapper.tpl'}
{if $action neq 2}
{include file='CRM/Core/BillingBlockWrapper.tpl'}
{/if}

{if ($email OR $batchEmail) and $outBound_option != 2}
<fieldset id="send_confirmation_receipt"><legend>{if $paid}{ts}Registration Confirmation and Receipt{/ts}{else}{ts}Registration Confirmation{/ts}{/if}</legend>
Expand Down
16 changes: 6 additions & 10 deletions templates/CRM/Member/Form/MembershipCommon.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
<td class="label">{$form.payment_instrument_id.label}<span class='marker'>*</span></td>
<td>{$form.payment_instrument_id.html} {help id="payment_instrument_id" file="CRM/Contribute/Page/Tab.hlp"}</td>
</tr>
<tr id="checkNumber" class="crm-{$formClass}-form-block-check_number">
<td class="label">{$form.check_number.label}</td>
<td>{$form.check_number.html|crmAddClass:six}</td>
</tr>

{if $action neq 2 }
<tr class="crm-{$formClass}-form-block-trxn_id">
Expand All @@ -55,6 +51,12 @@
<td class="label">{$form.contribution_status_id.label}</td>
<td>{$form.contribution_status_id.html}</td>
</tr>

<tr class="crm-membership-form-block-billing">
<td colspan="2">
{include file='CRM/Core/BillingBlockWrapper.tpl'}
</td>
</tr>
</table>
</fieldset></td></tr>
{/if}
Expand Down Expand Up @@ -100,9 +102,3 @@

<div class="spacer"></div>
{/if}

<tr class="crm-membership-form-block-billing">
<td colspan="2">
{include file='CRM/Core/BillingBlockWrapper.tpl'}
</td>
</tr>

0 comments on commit 2f15963

Please sign in to comment.