<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
* The id of the contribution page that we are processsing
*
* @var int
- * @public
*/
public $_id;
* The contact id related to a membership
*
* @var int
- * @public
*/
public $_membershipContactID;
* The values for the contribution db object
*
* @var array
- * @protected
*/
public $_values;
* The paymentProcessor attributes for this page
*
* @var array
- * @protected
*/
public $_paymentProcessor;
public $_paymentObject = NULL;
* The membership block for this page
*
* @var array
- * @protected
*/
public $_membershipBlock = NULL;
* The default values for the form
*
* @var array
- * @protected
*/
protected $_defaults;
* The params submitted by the form and computed by the app
*
* @var array
- * @public
*/
public $_params;
* The fields involved in this contribution page
*
* @var array
- * @public
*/
public $_fields = array();
* The billing location id for this contribiution page
*
* @var int
- * @protected
*/
public $_bltID;
* Cache the amount to make things easier
*
* @var float
- * @public
*/
public $_amount;
* Pcp id
*
* @var integer
- * @public
*/
public $_pcpId;
* Pcp block
*
* @var array
- * @public
*/
public $_pcpBlock;
* Pcp info
*
* @var array
- * @public
*/
public $_pcpInfo;
* The Membership ID for membership renewal
*
* @var int
- * @public
*/
public $_membershipId;
* Price Set ID, if the new price set method is used
*
* @var int
- * @protected
*/
public $_priceSetId;
* Array of fields for the price set
*
* @var array
- * @protected
*/
public $_priceSet;
* Is honor block is enabled for this contribution?
*
* @var boolean
- * @protected
*/
public $_honor_block_is_active = FALSE;
/**
* Set variables up before form is built
*
+ * @throws CRM_Contribution_Exception_InactiveContributionPageException
* @return void
- * @access public
*/
public function preProcess() {
+
$config = CRM_Core_Config::singleton();
$session = CRM_Core_Session::singleton();
CRM_Contribute_BAO_ContributionPage::setValues($this->_id, $this->_values);
- // check if form is active
if (empty($this->_values['is_active'])) {
- // form is inactive, die a fatal death
- CRM_Core_Error::fatal(ts('The page you requested is currently unavailable.'));
+ throw new CRM_Contribute_Exception_InactiveContributionPageException(ts('The page you requested is currently unavailable.'), $this->_id);
}
// also check for billing informatin
* Set the default values
*
* @return void
- * @access public
*/
- function setDefaultValues() {
+ public function setDefaultValues() {
return $this->_defaults;
}
* Assign the minimal set of variables to the template
*
* @return void
- * @access public
*/
- function assignToTemplate() {
+ public function assignToTemplate() {
$name = CRM_Utils_Array::value('billing_first_name', $this->_params);
if (!empty($this->_params['billing_middle_name'])) {
$name .= " {$this->_params['billing_middle_name']}";
* @param null $fieldTypes
*
* @return void
- * @access public
*/
- function buildCustom($id, $name, $viewOnly = FALSE, $profileContactType = NULL, $fieldTypes = NULL) {
+ public function buildCustom($id, $name, $viewOnly = FALSE, $profileContactType = NULL, $fieldTypes = NULL) {
if ($id) {
$contactID = $this->getContactID();
*
* @return null|string
*/
- function checkTemplateFileExists($suffix = NULL) {
+ public function checkTemplateFileExists($suffix = NULL) {
if ($this->_id) {
$templateFile = "CRM/Contribute/Form/Contribution/{$this->_id}/{$this->_name}.{$suffix}tpl";
$template = CRM_Core_Form::getTemplate();
* Use the form name to create the tpl file name
*
* @return string
- * @access public
*/
/**
* @return string
*/
- function getTemplateFileName() {
+ public function getTemplateFileName() {
$fileName = $this->checkTemplateFileExists();
return $fileName ? $fileName : parent::getTemplateFileName();
}
* i.e. we dont override
*
* @return string
- * @access public
*/
/**
* @return string
*/
- function overrideExtraTemplateFileName() {
+ public function overrideExtraTemplateFileName() {
$fileName = $this->checkTemplateFileExists('extra.');
return $fileName ? $fileName : parent::overrideExtraTemplateFileName();
}
/**
* Authenticate pledge user during online payment.
*
- * @access public
*
* @return void
*/
}
}
}
-