From ce8d1a438d4f978bd111998fb4eefeaced45f235 Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Thu, 27 Jul 2017 18:26:03 +0530 Subject: [PATCH] minor fix --- CRM/Contribute/Form/Contribution.php | 6 ++++-- templates/CRM/Contribute/Form/Contribution.tpl | 8 +------- templates/CRM/Contribute/Form/PaymentInfoBlock.tpl | 10 +++++++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CRM/Contribute/Form/Contribution.php b/CRM/Contribute/Form/Contribution.php index 25331e45dcb4..8e2744c3dcb1 100644 --- a/CRM/Contribute/Form/Contribution.php +++ b/CRM/Contribute/Form/Contribution.php @@ -701,6 +701,10 @@ public function buildQuickForm() { if ($this->_id) { $contributionStatus = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $this->_id, 'contribution_status_id'); $name = CRM_Utils_Array::value($contributionStatus, $statusName); + + if ($name == 'Pending') { + $this->assign('isPending', TRUE); + } switch ($name) { case 'Completed': // [CRM-17498] Removing unsupported status change options. @@ -1515,8 +1519,6 @@ protected function submit($submittedValues, $action, $pledgePaymentID) { foreach (array( 'payment_instrument_id', 'check_number', - // ****** @Monish - is this suppose to be trxn_date!? - 'receipt_date', ) as $fieldName) { if (empty($submittedValues[$fieldName])) { $submittedValues[$fieldName] = CRM_Utils_Array::value($fieldName, $this->_values); diff --git a/templates/CRM/Contribute/Form/Contribution.tpl b/templates/CRM/Contribute/Form/Contribution.tpl index d56932aade35..32a817748569 100644 --- a/templates/CRM/Contribute/Form/Contribution.tpl +++ b/templates/CRM/Contribute/Form/Contribution.tpl @@ -184,12 +184,6 @@ {$form.contribution_status_id.html} {if $contribution_status_id eq 2}{if $is_pay_later }: {ts}Pay Later{/ts} {else}: {ts}Incomplete Transaction{/ts}{/if}{/if} - - {if $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} - » {ts}Pay with Credit Card{/ts} - {/if} - {/if} @@ -246,7 +240,7 @@ {ts}Payment Details{/ts}
- {if $contribID && $payments} + {if $contribID && ($payments || $isPending)} {include file="CRM/Contribute/Form/PaymentInfoBlock.tpl"} {else} diff --git a/templates/CRM/Contribute/Form/PaymentInfoBlock.tpl b/templates/CRM/Contribute/Form/PaymentInfoBlock.tpl index c74a7339da2a..7d2ca385f11b 100644 --- a/templates/CRM/Contribute/Form/PaymentInfoBlock.tpl +++ b/templates/CRM/Contribute/Form/PaymentInfoBlock.tpl @@ -53,6 +53,14 @@ {else} {assign var='entity' value=$component} {/if} - {ts 1=$entity}No payments found for this %1 record{/ts} +
+ {ts 1=$entity}   No payments found for this %1 record.{/ts} + {if $isPending} + {capture assign=payNowLive}{crmURL p='civicrm/contact/view/contribution' q="reset=1&action=update&id=`$contribID`&cid=`$contactId`&context=`$context`&mode=live"}{/capture} + {capture assign=payNowOffline}{crmURL p='civicrm/payment' q="reset=1&id=`$contribID`&cid=`$contactId`&action=add&component=contribution"}{/capture} + » {ts}Pay with Credit Card{/ts} OR + » {ts}Pay Offline{/ts} + {/if} +
{/if} {/crmRegion}