From f9af96d6da9c3410d70adc1c707857d3b02f32cb Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Mon, 13 Jan 2014 19:49:58 +0530 Subject: [PATCH] CRM-13965 --- CRM/Contribute/Page/PaymentInfo.php | 69 +++++++++++++++ templates/CRM/Contribute/Page/PaymentInfo.tpl | 83 +++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 CRM/Contribute/Page/PaymentInfo.php create mode 100644 templates/CRM/Contribute/Page/PaymentInfo.tpl diff --git a/CRM/Contribute/Page/PaymentInfo.php b/CRM/Contribute/Page/PaymentInfo.php new file mode 100644 index 0000000000..1bc1f662e4 --- /dev/null +++ b/CRM/Contribute/Page/PaymentInfo.php @@ -0,0 +1,69 @@ +_component = CRM_Utils_Request::retrieve('component', 'String', $this, TRUE); + $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse'); + $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); + $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this, TRUE); + $this->_cid = CRM_Utils_Request::retrieve('cid', 'String', $this, TRUE); + + $this->assign('cid', $this->_cid); + $this->assign('id', $this->_id); + $this->assign('context', $this->_context); + $this->assign('component', $this->_component); + } + + function browse() { + $getTrxnInfo = $this->_context == 'transaction' ? TRUE : FALSE; + $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($this->_id, $this->_component, $getTrxnInfo); + if ($this->_context == 'payment_info') { + $this->assign('paymentInfo', $paymentInfo); + } + else { + $rows = $paymentInfo['transaction']; + $this->assign('rows', $rows); + } + } + + function run() { + $this->preProcess(); + if ($this->_action) { + $this->browse(); + } + + return parent::run(); + } +} \ No newline at end of file diff --git a/templates/CRM/Contribute/Page/PaymentInfo.tpl b/templates/CRM/Contribute/Page/PaymentInfo.tpl new file mode 100644 index 0000000000..37a339e0d5 --- /dev/null +++ b/templates/CRM/Contribute/Page/PaymentInfo.tpl @@ -0,0 +1,83 @@ +{* + +--------------------------------------------------------------------+ + | CiviCRM version 4.4 | + +--------------------------------------------------------------------+ + | Copyright CiviCRM LLC (c) 2004-2013 | + +--------------------------------------------------------------------+ + | This file is a part of CiviCRM. | + | | + | CiviCRM is free software; you can copy, modify, and distribute it | + | under the terms of the GNU Affero General Public License | + | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | + | | + | CiviCRM is distributed in the hope that it will be useful, but | + | WITHOUT ANY WARRANTY; without even the implied warranty of | + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | See the GNU Affero General Public License for more details. | + | | + | You should have received a copy of the GNU Affero General Public | + | License and the CiviCRM Licensing Exception along | + | with this program; if not, contact CiviCRM LLC | + | at info[AT]civicrm[DOT]org. If you have questions about the | + | GNU Affero General Public License or the licensing of CiviCRM, | + | see the CiviCRM license FAQ at http://civicrm.org/licensing | + +--------------------------------------------------------------------+ +*} +{if $show eq 'event-payment'} +{literal} + +{/literal} +{/if} +{if $context eq 'payment_info'} + + + {if $component eq "event"} + + {/if} + + + + + + + + +
{ts}Total Fee(s){/ts}{ts}Total Paid{/ts}{ts}Balance{/ts}
{$paymentInfo.total|crmMoney} + {if $paymentInfo.paid > 0} + {$paymentInfo.paid|crmMoney}
>> view payments
+ {/if} +
{$paymentInfo.balance|crmMoney}
+{if $paymentInfo.balance > 0} +
{ts}Record Payment{/ts}
+{/if} +{elseif $context eq 'transaction'} + + + + + + + + + + {foreach from=$rows item=row} + + + + + + + + + {/foreach} +
{ts}Amount{/ts}{ts}Type{/ts}{ts}Paid By{/ts}{ts}Received{/ts}{ts}Transaction ID{/ts}{ts}Status{/ts}
{$row.total_amount|crmMoney}{$row.financial_type}{$row.payment_instrument}{$row.receive_date|crmDate}{$row.trxn_id}{$row.status}
+{/if} \ No newline at end of file -- 2.25.1