*/
public $billingFieldSets = array();
+ /**
+ * Pre process function with common actions.
+ */
+ public function preProcess() {
+ $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
+ $this->assign('contactID', $this->_contactID);
+
+ $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add');
+ }
+
/**
* @param int $id
*/
* Set variables up before form is built.
*/
public function preProcess() {
-
// Check permission for action.
if (!CRM_Core_Permission::checkActionPermission('CiviContribute', $this->_action)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}
-
// @todo - if anyone ever figures out what this _cdType subroutine is about
// (or even if it still applies) please add comments!!!!!!!!!!
$this->_cdType = CRM_Utils_Array::value('type', $_GET);
return;
}
+ parent::preProcess();
+
$this->_formType = CRM_Utils_Array::value('formType', $_GET);
// Get price set id.
// Get the pledge payment id
$this->_ppID = CRM_Utils_Request::retrieve('ppid', 'Positive', $this);
- // Get the contact id
- $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
-
- // Get the action.
- $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add');
$this->assign('action', $this->_action);
// Get the contribution id if update
* @return array
* the set of tasks for a group of contacts
*/
- public static function &tasks() {
+ public static function tasks() {
if (!(self::$_tasks)) {
self::$_tasks = array(
1 => array(
$this->_action = CRM_Core_Action::COPY;
break;
}
- parent::preProcess();
+ CRM_Contact_Form_Task::preProcessCommon($this);
$this->_single = FALSE;
$this->_contactId = NULL;
protected $_fromEmails = array();
public function preProcess() {
+ // Check for edit permission.
+ if (!CRM_Core_Permission::checkActionPermission('CiviMember', $this->_action)) {
+ CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
+ }
+ parent::preProcess();
$params = array();
- $params['action'] = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'add');
$params['context'] = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'membership');
$params['id'] = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$params['mode'] = CRM_Utils_Request::retrieve('mode', 'String', $this);
$this->assign('context', $this->_context);
$this->assign('membershipMode', $this->_mode);
- $this->assign('contactID', $this->_contactID);
}
/**
if (isset($this->_id)) {
$params = array('id' => $this->_id);
CRM_Member_BAO_Membership::retrieve($params, $defaults);
- }
-
- if (isset($defaults['minimum_fee'])) {
- $defaults['minimum_fee'] = CRM_Utils_Money::format($defaults['minimum_fee'], NULL, '%a');
- }
+ if (isset($defaults['minimum_fee'])) {
+ $defaults['minimum_fee'] = CRM_Utils_Money::format($defaults['minimum_fee'], NULL, '%a');
+ }
- if (isset($defaults['status'])) {
- $this->assign('membershipStatus', $defaults['status']);
+ if (isset($defaults['status'])) {
+ $this->assign('membershipStatus', $defaults['status']);
+ }
}
if ($this->_action & CRM_Core_Action::ADD) {
/**
* Build the form object.
- *
- * @return void
*/
public function buildQuickForm() {
if ($this->_mode) {
$this->set('priceSetId', $this->_priceSetId);
$this->assign('priceSetId', $this->_priceSetId);
- // check for edit permission
- if (!CRM_Core_Permission::checkActionPermission('CiviMember', $this->_action)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
- }
-
if ($this->_action & CRM_Core_Action::DELETE) {
$contributionID = CRM_Member_BAO_Membership::getMembershipContributionId($this->_id);
// check delete permission for contribution
/**
* Build the form object.
- *
- * @return void
*/
public function buildQuickForm() {
if ($this->_cdType) {
$this->assign('cdType', FALSE);
if ($this->_cdType) {
$this->assign('cdType', TRUE);
- CRM_Custom_Form_CustomData::preProcess($this);
+ return CRM_Custom_Form_CustomData::preProcess($this);
}
parent::preProcess();
}
CRM_Utils_System::setTitle(ts('Renew Membership'));
-
- parent::preProcess();
}
/**