$registerParams["billing_country-{$this->_bltID}"] = CRM_Core_PseudoConstant::countryIsoCode($registerParams["billing_country_id-{$this->_bltID}"]);
}
if (isset($registerParams['credit_card_exp_date'])) {
- $registerParams['year'] = CRM_Core_Payment_Form::getCreditCardExpirationYear($registerParams);
+ $registerParams['year'] = CRM_Core_Payment_Form::getCreditCardExpirationYear($registerParams);
$registerParams['month'] = CRM_Core_Payment_Form::getCreditCardExpirationMonth($registerParams);
}
if ($this->_values['event']['is_monetary']) {
$taxAmount += $v['tax_amount'];
if (is_array($v)) {
foreach (array(
- 'first_name', 'last_name') as $name) {
+ 'first_name',
+ 'last_name',
+ ) as $name) {
if (isset($v['billing_' . $name]) &&
!isset($v[$name])
) {
$this->addButtons(array(
array(
'type' => 'back',
- 'name' => ts('<< Go Back'),
+ 'name' => ts('Go Back'),
),
)
);
}
else {
- $contribButton = ts('Continue >>');
+ $contribButton = ts('Continue');
$this->addButtons(array(
array(
'type' => 'back',
- 'name' => ts('<< Go Back'),
+ 'name' => ts('Go Back'),
),
array(
'type' => 'next',
}
if (!empty($errors)) {
- $soldOutOptions = implode("<br>", $priceSetErrors['soldOutOptions']);
+ $soldOutOptions = implode("<br/>", $priceSetErrors['soldOutOptions']);
CRM_Core_Session::setStatus(ts('You have been returned to the start of the registration process and any sold out events have been removed from your selections. You will not be able to continue until you review your booking and select different events if you wish. The following events were sold out:'), ts('Unfortunately some of your options have now sold out for one or more participants.'), 'error');
CRM_Core_Session::setStatus(ts("{$soldOutOptions}"), ts('Sold out:'), 'error');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/register', "_qf_Register_display=true&qfKey=" . $fields['qfKey']));
}
return empty($errors) ? TRUE : $errors;
}
+
/**
* Process the form submission
*
* @return void
*/
public function postProcess() {
- $now = date('YmdHis');
+ $now = date('YmdHis');
$this->_params = $this->get('params');
if (!empty($this->_params[0]['contact_id'])) {
}
//passing contribution id is already registered.
- $contribution =
- self::processContribution($this, $value, $result, $contactID, $pending, $isAdditionalAmount);
+ $contribution = self::processContribution($this, $value, $result, $contactID, $pending, $isAdditionalAmount);
$value['contributionID'] = $contribution->id;
$value['contributionTypeID'] = $contribution->financial_type_id;
$value['receive_date'] = $contribution->receive_date;
$value['contributionTypeID'] = $contribution->financial_type_id;
}
$value['contactID'] = $contactID;
- $value['eventID'] = $this->_eventId;
+ $value['eventID'] = $this->_eventId;
$value['item_name'] = $value['description'];
}
// handle register date CRM-4320
if ($this->_allowConfirmation) {
- $registerDate = CRM_Utils_Array::value( 'participant_register_date', $params );
+ $registerDate = CRM_Utils_Array::value('participant_register_date', $params);
}
elseif (!empty($params['participant_register_date']) &&
is_array($params['participant_register_date']) &&
}
if (!empty($this->_lineItem)) {
- $lineItems = $this->_lineItem;
- $lineItem = array();
+ $lineItems = $this->_lineItem;
+ $lineItem = array();
if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
$lineItem[] = $lineItemValue;
}
$this->assign('amounts', $amount);
}
if ($this->_lineItem) {
- $lineItems = $this->_lineItem;
- $lineItem = array();
+ $lineItems = $this->_lineItem;
+ $lineItem = array();
if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
$lineItem[] = $lineItemValue;
}
*
* @return void
*/
- static function processContribution(
+ public static function processContribution(
&$form, $params, $result, $contactID,
$pending = FALSE, $isAdditionalAmount = FALSE
) {
$transaction = new CRM_Core_Transaction();
- $now = date('YmdHis');
+ $now = date('YmdHis');
$receiptDate = NULL;
if (!empty($form->_values['event']['is_email_confirm'])) {
$contribParams = array(
'contact_id' => $contactID,
- 'financial_type_id' => !empty($form->_values['event']['financial_type_id']) ? $form->_values['event']['financial_type_id'] : $params['financial_type_id'],
+ 'financial_type_id' => !empty($form->_values['event']['financial_type_id']) ? $form->_values['event']['financial_type_id'] : $params['financial_type_id'],
'receive_date' => $now,
'total_amount' => $params['amount'],
'tax_amount' => $params['tax_amount'],
!$form->_values['event']['is_monetary'] ||
$form->_allowWaitlist ||
$form->_requireApproval
- ) && !empty($params["email-{$form->_bltID}"])) {
+ ) && !empty($params["email-{$form->_bltID}"])
+ ) {
$params['email-Primary'] = $params["email-{$form->_bltID}"];
}
}
public static function assignProfiles(&$form) {
$participantParams = $form->_params;
$formattedValues = $profileFields = array();
- $count = 1;
+ $count = 1;
foreach ($participantParams as $participantNum => $participantValue) {
if ($participantNum) {
$prefix1 = 'additional';
}
$form->_fields = $profileFields;
}
- if (!empty($formattedValues) ) {
+ if (!empty($formattedValues)) {
$form->assign('primaryParticipantProfile', $formattedValues[1]);
$form->set('primaryParticipantProfile', $formattedValues[1]);
if ($count > 2) {