id = $this->_id; if ($recur->find(TRUE)) { $values = array(); CRM_Core_DAO::storeValues($recur, $values); // if there is a payment processor ID, get the name of the payment processor if (!empty($values['payment_processor_id'])) { $values['payment_processor'] = CRM_Core_DAO::getFieldValue( 'CRM_Financial_DAO_PaymentProcessor', $values['payment_processor_id'], 'name' ); } // get contribution status label if (!empty($values['contribution_status_id'])) { $values['contribution_status'] = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_ContributionRecur', 'contribution_status_id', $values['contribution_status_id']); } $this->assign('recur', $values); } } public function preProcess() { $context = CRM_Utils_Request::retrieve('context', 'String', $this); $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'view'); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE); $this->assign('contactId', $this->_contactId); // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); $this->assign('action', $this->_action); if ($this->_permission == CRM_Core_Permission::EDIT && !CRM_Core_Permission::check('edit contributions')) { // demote to view since user does not have edit contrib rights $this->_permission = CRM_Core_Permission::VIEW; $this->assign('permission', 'view'); } } /** * the main function that is called when the page loads, * it decides the which action has to be taken for the page. * * @return null */ public function run() { $this->preProcess(); if ($this->_action & CRM_Core_Action::VIEW) { $this->view(); } return parent::run(); } }