Merge pull request #22487 from mattwire/repeattransactiontemplatecontribution
[civicrm-core.git] / CRM / Contribute / Page / PaymentInfo.php
CommitLineData
f9af96d6
PJ
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
f9af96d6 5 | |
bc77d7c0
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
f9af96d6 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
f9af96d6
PJ
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
f9af96d6
PJ
16 */
17class CRM_Contribute_Page_PaymentInfo extends CRM_Core_Page {
1330f57a 18
00be9182 19 public function preProcess() {
f9af96d6
PJ
20 $this->_component = CRM_Utils_Request::retrieve('component', 'String', $this, TRUE);
21 $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
22 $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE);
edc80cda 23 $this->_context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this, TRUE);
874c9be7 24 $this->_cid = CRM_Utils_Request::retrieve('cid', 'String', $this, TRUE);
f9af96d6
PJ
25
26 $this->assign('cid', $this->_cid);
27 $this->assign('id', $this->_id);
28 $this->assign('context', $this->_context);
29 $this->assign('component', $this->_component);
30 }
31
00be9182 32 public function browse() {
3ec3dcbe 33 $getTrxnInfo = $this->_context == 'transaction';
1010c4e1 34 $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($this->_id, $this->_component, $getTrxnInfo, TRUE);
f9af96d6
PJ
35 if ($this->_context == 'payment_info') {
36 $this->assign('paymentInfo', $paymentInfo);
37 }
f9af96d6
PJ
38 }
39
186c9c17 40 /**
e17598a8 41 * Run page.
42 *
43 * This typically involves assigning the appropriate
186c9c17
EM
44 * smarty variable :)
45 *
a6c01b45
CW
46 * @return string
47 * The content generated by running this page
186c9c17 48 */
00be9182 49 public function run() {
f9af96d6
PJ
50 $this->preProcess();
51 if ($this->_action) {
52 $this->browse();
53 }
54
55 return parent::run();
56 }
96025800 57
186c9c17 58}