3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 class CRM_Pledge_Page_Payment
extends CRM_Core_Page
{
20 * the main function that is called when the page loads, it decides the which action has to be taken for the page.
24 public function run() {
25 $this->_action
= CRM_Utils_Request
::retrieve('action', 'String', $this, FALSE, 'browse');
26 $this->_context
= CRM_Utils_Request
::retrieve('context', 'Alphanumeric', $this);
28 $this->assign('action', $this->_action
);
29 $this->assign('context', $this->_context
);
31 $this->_contactId
= CRM_Utils_Request
::retrieve('cid', 'Positive', $this);
33 CRM_Pledge_Page_Tab
::setContext($this);
35 if ($this->_action
& CRM_Core_Action
::UPDATE
) {
39 $pledgeId = CRM_Utils_Request
::retrieve('pledgeId', 'Positive', $this);
41 $paymentDetails = CRM_Pledge_BAO_PledgePayment
::getPledgePayments($pledgeId);
43 $this->assign('rows', $paymentDetails);
44 $this->assign('pledgeId', $pledgeId);
45 $this->assign('contactId', $this->_contactId
);
47 // check if we can process credit card contributions
48 $this->assign('newCredit', CRM_Core_Config
::isEnabledBackOfficeCreditCardPayments());
50 // check is the user has view/edit signer permission
52 if (CRM_Core_Permission
::check('edit pledges')) {
55 $this->assign('permission', $permission);
62 * called when action is update or new.
66 public function edit() {
67 $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Payment',
68 'Update Pledge Payment',
72 $pledgePaymentId = CRM_Utils_Request
::retrieve('ppId', 'Positive', $this);
74 $controller->setEmbedded(TRUE);
75 $controller->set('id', $pledgePaymentId);
77 return $controller->run();