$this->_params[0]['invoiceID'] = $this->get('invoiceID');
}
$this->assign('defaultRole', FALSE);
- if (CRM_Utils_Array::value('defaultRole', $this->_params[0]) == 1) {
+ if (($this->_params[0]['defaultRole'] ?? NULL) == 1) {
$this->assign('defaultRole', TRUE);
}
$rfp = CRM_Utils_Request::retrieve('rfp', 'Boolean', CRM_Core_DAO::$_nullObject, FALSE, NULL, 'GET');
//we lost rfp in case of additional participant. So set it explicitly.
- if ($rfp || CRM_Utils_Array::value('additional_participants', $this->_params[0], FALSE)) {
+ if ($rfp || ($this->_params[0]['additional_participants'] ?? FALSE)) {
if (!empty($this->_paymentProcessor) && $this->_paymentProcessor['object']->supports('preApproval')) {
$preApprovalParams = $this->_paymentProcessor['object']->getPreApprovalDetails($this->get('pre_approval_parameters'));
$params = array_merge($this->_params, $preApprovalParams);
}
$this->_amount[$k]['label'] = preg_replace('/\ 1/', '', $v['amount_level']) . ' - ' . $append;
- $this->_part[$k]['info'] = CRM_Utils_Array::value('first_name', $v) . ' ' . CRM_Utils_Array::value('last_name', $v);
+ $this->_part[$k]['info'] = ($v['first_name'] ?? '') . ' ' . ($v['last_name'] ?? '');
if (empty($v['first_name'])) {
$this->_part[$k]['info'] = $append;
}
*/
public static function formRule($fields, $files, $self) {
$errors = [];
- $eventFull = CRM_Event_BAO_Participant::eventFull($self->_eventId, FALSE, CRM_Utils_Array::value('has_waitlist', $self->_values['event']));
+ $eventFull = CRM_Event_BAO_Participant::eventFull($self->_eventId, FALSE, $self->_values['event']['has_waitlist'] ?? FALSE);
if ($eventFull && empty($self->_allowConfirmation)) {
if (empty($self->_allowWaitlist)) {
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/event/register', "reset=1&id={$self->_eventId}", FALSE, NULL, FALSE, TRUE));
// and fix the fee level
if (!empty($this->_params[0]['discount']) && !empty($this->_params[0]['discount']['applied'])) {
foreach ($this->_params as $k => $v) {
- if (CRM_Utils_Array::value('amount', $this->_params[$k]) > 0 && !empty($this->_params[$k]['discountAmount'])) {
+ if (($this->_params[$k]['amount'] ?? NULL) > 0 && !empty($this->_params[$k]['discountAmount'])) {
$this->_params[$k]['amount'] -= $this->_params[$k]['discountAmount'];
- $this->_params[$k]['amount_level'] .= CRM_Utils_Array::value('discountMessage', $this->_params[$k]);
+ $this->_params[$k]['amount_level'] .= ($this->_params[$k]['discountMessage'] ?? NULL);
}
}
$this->set('params', $this->_params);
}
$value['description'] = ts('Online Event Registration') . ': ' . $this->_values['event']['title'];
- $value['accountingCode'] = CRM_Utils_Array::value('accountingCode',
- $this->_values['event']
- );
+ $value['accountingCode'] = $this->_values['event']['accountingCode'] ?? NULL;
$pending = FALSE;
if ($this->_allowWaitlist || $this->_requireApproval) {
!$this->_allowWaitlist && !$this->_requireApproval
) {
// transactionID & receive date required while building email template
- $this->assign('trxn_id', CRM_Utils_Array::value('trxn_id', $value));
- $this->assign('receive_date', CRM_Utils_Date::mysqlToIso(CRM_Utils_Array::value('receive_date', $value)));
- $this->set('receiveDate', CRM_Utils_Date::mysqlToIso(CRM_Utils_Array::value('receive_date', $value)));
- $this->set('trxnId', CRM_Utils_Array::value('trxn_id', $value));
+ $this->assign('trxn_id', $value['trxn_id'] ?? NULL);
+ $this->assign('receive_date', CRM_Utils_Date::mysqlToIso($value['receive_date'] ?? NULL));
+ $this->set('receiveDate', CRM_Utils_Date::mysqlToIso($value['receive_date'] ?? NULL));
+ $this->set('trxnId', $value['trxn_id'] ?? NULL);
}
}
if ($value == 'skip') {
continue;
}
- if ($entityId = CRM_Utils_Array::value($key, $allParticipantIds)) {
+ if ($entityId = $allParticipantIds[$key] ?? NULL) {
// do cleanup line items if participant re-walking wizard.
if ($this->_allowConfirmation) {
CRM_Price_BAO_LineItem::deleteLineItems($entityId, $entityTable);
if (isset($line['tax_amount']) && isset($line['tax_rate'])) {
$totalTaxAmount = $line['tax_amount'] + $totalTaxAmount;
if (isset($dataArray[$line['tax_rate']])) {
- $dataArray[$line['tax_rate']] = $dataArray[$line['tax_rate']] + CRM_Utils_Array::value('tax_amount', $line);
+ $dataArray[$line['tax_rate']] = $dataArray[$line['tax_rate']] + ($line['tax_amount'] ?? 0);
}
else {
$dataArray[$line['tax_rate']] = $line['tax_amount'] ?? NULL;
if (!empty($this->_lineItem)) {
$lineItems = $this->_lineItem;
$lineItem = [];
- if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
+ if ($lineItemValue = ($lineItems[$participantNum] ?? NULL)) {
$lineItem[] = $lineItemValue;
}
$params[$participantNum]['lineItem'] = $lineItem;
if ($this->_lineItem) {
$lineItems = $this->_lineItem;
$lineItem = [];
- if ($lineItemValue = CRM_Utils_Array::value($participantNum, $lineItems)) {
+ if ($lineItemValue = ($lineItems[$participantNum] ?? NULL)) {
$lineItem[] = $lineItemValue;
}
if (CRM_Invoicing_Utils::isInvoicingEnabled()) {
'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,
}
$contribParams['is_test'] = 0;
- if ($form->_action & CRM_Core_Action::PREVIEW || CRM_Utils_Array::value('mode', $params) == 'test') {
+ if ($form->_action & CRM_Core_Action::PREVIEW || ($params['mode'] ?? NULL) === 'test') {
$contribParams['is_test'] = 1;
}
}
if (Civi::settings()->get('deferred_revenue_enabled')) {
- $eventStartDate = CRM_Utils_Array::value(
- 'start_date',
- CRM_Utils_Array::value(
- 'event',
- $form->_values
- )
- );
+ $eventStartDate = $form->_values['event']['start_date'] ?? NULL;
if (strtotime($eventStartDate) > strtotime(date('Ymt'))) {
$contribParams['revenue_recognition_date'] = date('Ymd', strtotime($eventStartDate));
}
// Add the billing names to the billing address, if a billing name is set
if (!empty($params['billing_first_name'])) {
- $params["address_name-{$form->_bltID}"] = $params['billing_first_name'] . ' ' . CRM_Utils_Array::value('billing_middle_name', $params) . ' ' . CRM_Utils_Array::value('billing_last_name', $params);
+ $params["address_name-{$form->_bltID}"] = $params['billing_first_name'] . ' ' . ($params['billing_middle_name'] ?? '') . ' ' . ($params['billing_last_name'] ?? '');
$fields["address_name-{$form->_bltID}"] = 1;
}
}
//get email primary first if exist
- $subscriptionEmail = ['email' => CRM_Utils_Array::value('email-Primary', $params)];
+ $subscriptionEmail = ['email' => $params['email-Primary'] ?? NULL];
if (!$subscriptionEmail['email']) {
$subscriptionEmail['email'] = $params["email-{$form->_bltID}"] ?? NULL;
}