本文整理汇总了PHP中CRM_Contribute_Form_ContributionPage::postProcess方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_Form_ContributionPage::postProcess方法的具体用法?PHP CRM_Contribute_Form_ContributionPage::postProcess怎么用?PHP CRM_Contribute_Form_ContributionPage::postProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_Form_ContributionPage
的用法示例。
在下文中一共展示了CRM_Contribute_Form_ContributionPage::postProcess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
/**
* Process the form
*
* @return void
* @access public
*/
public function postProcess()
{
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);
// we do this in case the user has hit the forward/back button
if ($this->_id) {
$params['id'] = $this->_id;
} else {
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
$params['created_date'] = date('YmdHis');
$config = CRM_Core_Config::singleton();
$params['currency'] = $config->defaultCurrency;
}
$params['is_active'] = CRM_Utils_Array::value('is_active', $params, false);
$params['is_credit_card_only'] = CRM_Utils_Array::value('is_credit_card_only', $params, false);
$params['honor_block_is_active'] = CRM_Utils_Array::value('honor_block_is_active', $params, false);
$params['is_for_organization'] = CRM_Utils_Array::value('is_organization', $params) ? CRM_Utils_Array::value('is_for_organization', $params, false) : 0;
$params['start_date'] = CRM_Utils_Date::processDate($params['start_date'], $params['start_date_time'], true);
$params['end_date'] = CRM_Utils_Date::processDate($params['end_date'], $params['end_date_time'], true);
$params['goal_amount'] = CRM_Utils_Rule::cleanMoney($params['goal_amount']);
if (!$params['honor_block_is_active']) {
$params['honor_block_title'] = null;
$params['honor_block_text'] = null;
}
require_once 'CRM/Contribute/BAO/ContributionPage.php';
$dao =& CRM_Contribute_BAO_ContributionPage::create($params);
$this->set('id', $dao->id);
parent::postProcess();
}