$participant = new CRM_Event_DAO_Participant();
$participant->copyValues($params);
- $participant->is_test = CRM_Utils_Array::value('is_test', $params, 0);
+ $participant->is_test = $params['is_test'] ?? 0;
$participant->selectAdd();
$participant->selectAdd('status_id');
if ($participant->find(TRUE) && array_key_exists($participant->status_id, $statusTypes)) {
if ($lineItem->html_type == 'Text') {
$count *= $lineItem->qty;
}
- $optionsCount[$lineItem->valueId] = $count + CRM_Utils_Array::value($lineItem->valueId, $optionsCount, 0);
+ $optionsCount[$lineItem->valueId] = $count + ($optionsCount[$lineItem->valueId] ?? 0);
}
return $optionsCount;
//format params
$params['start_date'] = $params['start_date'] ?? NULL;
$params['end_date'] = $params['end_date'] ?? NULL;
- $params['has_waitlist'] = CRM_Utils_Array::value('has_waitlist', $params, FALSE);
- $params['is_map'] = CRM_Utils_Array::value('is_map', $params, FALSE);
- $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
- $params['is_public'] = CRM_Utils_Array::value('is_public', $params, FALSE);
- $params['is_share'] = CRM_Utils_Array::value('is_share', $params, FALSE);
- $params['default_role_id'] = CRM_Utils_Array::value('default_role_id', $params, FALSE);
+ $params['has_waitlist'] = $params['has_waitlist'] ?? FALSE;
+ $params['is_map'] = $params['is_map'] ?? FALSE;
+ $params['is_active'] = $params['is_active'] ?? FALSE;
+ $params['is_public'] = $params['is_public'] ?? FALSE;
+ $params['is_share'] = $params['is_share'] ?? FALSE;
+ $params['default_role_id'] = $params['default_role_id'] ?? FALSE;
$params['id'] = $this->_id;
//merge params with defaults from templates
$params['payment_processor'] = 'null';
}
- $params['is_pay_later'] = CRM_Utils_Array::value('is_pay_later', $params, 0);
- $params['is_billing_required'] = CRM_Utils_Array::value('is_billing_required', $params, 0);
+ $params['is_pay_later'] = $params['is_pay_later'] ?? 0;
+ $params['is_billing_required'] = $params['is_billing_required'] ?? 0;
if ($this->_id) {
* Set variables up before form is built.
*/
public function preProcess() {
- $this->_addProfileBottom = CRM_Utils_Array::value('addProfileBottom', $_GET, FALSE);
- $this->_profileBottomNum = CRM_Utils_Array::value('addProfileNum', $_GET, 0);
- $this->_addProfileBottomAdd = CRM_Utils_Array::value('addProfileBottomAdd', $_GET, FALSE);
- $this->_profileBottomNumAdd = CRM_Utils_Array::value('addProfileNumAdd', $_GET, 0);
+ $this->_addProfileBottom = $_GET['addProfileBottom'] ?? FALSE;
+ $this->_profileBottomNum = $_GET['addProfileNum'] ?? 0;
+ $this->_addProfileBottomAdd = $_GET['addProfileBottomAdd'] ?? FALSE;
+ $this->_profileBottomNumAdd = $_GET['addProfileNumAdd'] ?? 0;
parent::preProcess();
$this->setSelectedChild('registration');
$params['id'] = $this->_id;
// format params
- $params['is_online_registration'] = CRM_Utils_Array::value('is_online_registration', $params, FALSE);
+ $params['is_online_registration'] = $params['is_online_registration'] ?? FALSE;
// CRM-11182
- $params['is_confirm_enabled'] = CRM_Utils_Array::value('is_confirm_enabled', $params, FALSE);
- $params['is_multiple_registrations'] = CRM_Utils_Array::value('is_multiple_registrations', $params, FALSE);
- $params['allow_same_participant_emails'] = CRM_Utils_Array::value('allow_same_participant_emails', $params, FALSE);
- $params['requires_approval'] = CRM_Utils_Array::value('requires_approval', $params, FALSE);
+ $params['is_confirm_enabled'] = $params['is_confirm_enabled'] ?? FALSE;
+ $params['is_multiple_registrations'] = $params['is_multiple_registrations'] ?? FALSE;
+ $params['allow_same_participant_emails'] = $params['allow_same_participant_emails'] ?? FALSE;
+ $params['requires_approval'] = $params['requires_approval'] ?? FALSE;
// reset is_email confirm if not online reg
if (!$params['is_online_registration']) {
self::addMultipleProfiles($additionalProfileIds, $params, 'additional_custom_post_id_multiple');
$cantDedupe = FALSE;
- $rgId = CRM_Utils_Array::value('dedupe_rule_group_id', $params, 0);
+ $rgId = $params['dedupe_rule_group_id'] ?? 0;
switch (self::canProfilesDedupe($profileIds, $rgId)) {
case 0:
$params["address_name-{$this->_bltID}"]
= ($params['billing_first_name'] ?? '') . ' ' .
($params['billing_middle_name'] ?? '') . ' ' .
- CRM_Utils_Array::value('billing_last_name', $params);
+ ($params['billing_last_name'] ?? '');
$params["address_name-{$this->_bltID}"] = trim($params["address_name-{$this->_bltID}"]);
$fields["address_name-{$this->_bltID}"] = 1;
}
$lineItem[$this->_priceSetId][$lineKey] = $line;
}
- CRM_Price_BAO_LineItem::processPriceSet($participants[$num]->id, $lineItem, CRM_Utils_Array::value($num, $contributions, NULL), 'civicrm_participant');
+ CRM_Price_BAO_LineItem::processPriceSet($participants[$num]->id, $lineItem, $contributions[$num] ?? NULL, 'civicrm_participant');
}
}
}
//also add additional participant's fee level/priceset
if (CRM_Event_BAO_Participant::isPrimaryParticipant($this->_id)) {
$additionalIds = CRM_Event_BAO_Participant::getAdditionalParticipantIds($this->_id);
- $hasLineItems = CRM_Utils_Array::value('priceSetId', $params, FALSE);
+ $hasLineItems = $params['priceSetId'] ?? FALSE;
$additionalParticipantDetails = $this->getFeeDetails($additionalIds, $hasLineItems);
}
}
'invoice_id' => $params['invoiceID'],
'currency' => $params['currencyID'],
'source' => !empty($params['participant_source']) ? $params['participant_source'] : $params['description'],
- 'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
+ 'is_pay_later' => $params['is_pay_later'] ?? 0,
'campaign_id' => $params['campaign_id'] ?? NULL,
'card_type_id' => $params['card_type_id'] ?? NULL,
'pan_truncation' => $params['pan_truncation'] ?? NULL,
$participantFields['participant_source']['maxlength']
),
'fee_level' => $params['amount_level'] ?? NULL,
- 'is_pay_later' => CRM_Utils_Array::value('is_pay_later', $params, 0),
+ 'is_pay_later' => $params['is_pay_later'] ?? 0,
'fee_amount' => $params['fee_amount'] ?? NULL,
'registered_by_id' => $params['registered_by_id'] ?? NULL,
'discount_id' => $params['discount_id'] ?? NULL,
if (!empty($form->_priceSet['fields'])) {
foreach ($form->_priceSet['fields'] as $field) {
foreach ($field['options'] as $option) {
- $count = CRM_Utils_Array::value('count', $option, 0);
+ $count = $option['count'] ?? 0;
$optionsCountDetails['fields'][$field['id']]['options'][$option['id']] = $count;
}
}
if (!empty($form->_priceSet['fields'])) {
foreach ($form->_priceSet['fields'] as $field) {
foreach ($field['options'] as $option) {
- $maxVal = CRM_Utils_Array::value('max_value', $option, 0);
+ $maxVal = $option['max_value'] ?? 0;
$optionsMaxValueDetails['fields'][$field['id']]['options'][$option['id']] = $maxVal;
$optionsMaxValueTotal += $maxVal;
}
if ($this->_allowConfirmation) {
$this->_contactId = $contactID;
$this->_discountId = $discountId;
- $forcePayLater = CRM_Utils_Array::value('is_pay_later', $this->_defaults, FALSE);
+ $forcePayLater = $this->_defaults['is_pay_later'] ?? FALSE;
$this->_defaults = array_merge($this->_defaults, CRM_Event_Form_EventFees::setDefaultValues($this));
$this->_defaults['is_pay_later'] = $forcePayLater;
}
foreach ($field['options'] as & $option) {
$optId = $option['id'];
- $count = CRM_Utils_Array::value('count', $option, 0);
- $maxValue = CRM_Utils_Array::value('max_value', $option, 0);
- $dbTotalCount = CRM_Utils_Array::value($optId, $recordedOptionsCount, 0);
- $currentTotalCount = CRM_Utils_Array::value($optId, $currentOptionsCount, 0);
+ $count = $option['count'] ?? 0;
+ $maxValue = $option['max_value'] ?? 0;
+ $dbTotalCount = $recordedOptionsCount[$optId] ?? 0;
+ $currentTotalCount = $currentOptionsCount[$optId] ?? 0;
$totalCount = $currentTotalCount + $dbTotalCount;
$isFull = FALSE;
$optionFullIds[$optId] = $optId;
if ($field['html_type'] != 'Select') {
if (in_array($optId, $defaultPricefieldIds)) {
- $optionFullTotalAmount += CRM_Utils_Array::value('amount', $option);
+ $optionFullTotalAmount += $option['amount'] ?? 0;
}
}
else {
$this->set('is_pay_later', $params['is_pay_later']);
// assign pay later stuff
- $this->_params['is_pay_later'] = CRM_Utils_Array::value('is_pay_later', $params, FALSE);
+ $this->_params['is_pay_later'] = $params['is_pay_later'] ?? FALSE;
$this->assign('is_pay_later', $params['is_pay_later']);
$this->assign('pay_later_text', $params['is_pay_later'] ? $this->_values['event']['pay_later_text'] : NULL);
$this->assign('pay_later_receipt', $params['is_pay_later'] ? $this->_values['event']['pay_later_receipt'] : NULL);