Ejemplo n.º 1
0
 /**
  * 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();
 }