public $useLivePageJS = TRUE;
/**
- * the values for the contribution db object
+ * The values for the contribution db object
*
* @var array
* @protected
public $_values;
/**
- * the values for the quickconfig for priceset
+ * The values for the quickconfig for priceset
*
* @var boolean
* @protected
public $_priceSet;
/**
- * the id of the participation that we are proceessing
+ * The id of the participation that we are proceessing
*
* @var int
* @protected
public $_id;
/**
- * the id of the note
+ * The id of the note
*
* @var int
* @protected
protected $_noteId = NULL;
/**
- * the id of the contact associated with this participation
+ * The id of the contact associated with this participation
*
* @var int
* @protected
public $_contactId;
/**
- * array of event values
+ * Array of event values
*
* @var array
* @protected
protected $_eventTypeId = NULL;
/**
- * participant status Id
+ * Participant status Id
*/
protected $_statusId = NULL;
/**
- * cache all the participant statuses
+ * Cache all the participant statuses
*/
protected $_participantStatuses;
/**
- * participant mode
+ * Participant mode
*/
public $_mode = NULL;
/**
- * event ID preselect
+ * Event ID preselect
*/
public $_eID = NULL;
- /*
- *Line Item for Price Set
- */
-
+ /**
+ * Line Item for Price Set
+ */
public $_lineItem = NULL;
- /*
- *Contribution mode for event registration for offline mode
- */
+ /*
+ * Contribution mode for event registration for offline mode
+ */
public $_contributeMode = 'direct';
public $_online;
/**
- * store id of role custom data type ( option value )
+ * Store id of role custom data type ( option value )
*/
protected $_roleCustomDataTypeID;
/**
- * store id of event Name custom data type ( option value)
+ * Store id of event Name custom data type ( option value)
*/
protected $_eventNameCustomDataTypeID;
/**
- * selected discount id
+ * Selected discount id
*/
public $_originalDiscountId = NULL;
/**
- * event id
+ * Event id
*/
public $_eventId = NULL;
/**
- * id of payment, if any
+ * Id of payment, if any
*/
public $_paymentId = NULL;
public $_onlinePendingContributionId = NULL;
/**
- * Function to set variables up before form is built
+ * Set variables up before form is built
*
* @return void
* @access public
// check for edit permission
if (!CRM_Core_Permission::checkActionPermission('CiviEvent', $this->_action)) {
- CRM_Core_Error::fatal(ts('You do not have permission to access this page'));
+ CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
}
if ($this->_action & CRM_Core_Action::DELETE) {
}
/**
- * Function to build the form
+ * Build the form object
*
* @return void
* @access public
$notificationStatusIds = implode(',', array_keys(array_intersect($participantStatusName, $notificationStatuses)));
$this->assign('notificationStatusIds', $notificationStatusIds);
- $this->_participantStatuses = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
- $this->addSelect('status_id', $checkCancelledJs + array('option_url' => 'civicrm/admin/participant_status'), TRUE);
+ $this->_participantStatuses = $statusOptions = CRM_Event_BAO_Participant::buildOptions('status_id', 'create');
- $enableCart = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::EVENT_PREFERENCES_NAME,
- 'enable_cart'
- );
- $pendingInCartStatusId = array_search('Pending in cart', $participantStatusName);
- $this->assign('pendingInCartStatusId', $pendingInCartStatusId);
- $this->assign('enableCart', $enableCart);
- $pendingRefundStatusId = array_search('Pending refund', $participantStatusName);
- $this->assign('pendingRefundStatusId', $pendingRefundStatusId);
+ // Only show refund status when editing
+ if ($this->_action & CRM_Core_Action::ADD) {
+ $pendingRefundStatusId = array_search('Pending refund', $participantStatusName);
+ if ($pendingRefundStatusId) {
+ unset($statusOptions[$pendingRefundStatusId]);
+ }
+ }
+
+ $this->addSelect('status_id', $checkCancelledJs + array('options' => $statusOptions, 'option_url' => 'civicrm/admin/participant_status'), TRUE);
$this->addElement('checkbox', 'is_notify', ts('Send Notification'), NULL);
}
/**
- * global validation rules for the form
+ * Global validation rules for the form
*
- * @param $values
+ * @param array $values posted values of the form
* @param $files
* @param $self
*
- * @internal param array $fields posted values of the form
- *
* @return array list of errors to be posted back to the form
* @static
* @access public
}
/**
- * Function to process the form
+ * Process the form submission
*
* @access public
*/
$payment = CRM_Core_Payment::singleton($this->_mode, $this->_paymentProcessor, $this);
+ // CRM-15622: fix for incorrect contribution.fee_amount
+ $paymentParams['fee_amount'] = NULL;
$result = $payment->doDirectPayment($paymentParams);
if (is_a($result, 'CRM_Core_Error')) {