}
if (!$instanceID || !isset($params['id'])) {
- $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE);
+ $params['is_reserved'] = $params['is_reserved'] ?? FALSE;
$params['domain_id'] = CRM_Utils_Array::value('domain_id', $params, CRM_Core_Config::domainID());
// CRM-17256 set created_id on report creation.
$params['created_id'] = $params['created_id'] ?? CRM_Core_Session::getLoggedInContactID();
$order_by = [
'column' => $fieldName,
'order' => CRM_Utils_Array::value('default_order', $field, 'ASC'),
- 'section' => CRM_Utils_Array::value('default_is_section', $field, 0),
+ 'section' => $field['default_is_section'] ?? 0,
];
if (!empty($field['default_weight'])) {
$val[$key] = $options[$valIds];
}
}
- $pair[$op] = (count($val) == 1) ? (($op == 'notin' || $op ==
- 'mnot') ? ts('Is Not') : ts('Is')) : CRM_Utils_Array::value($op, $pair);
+ $pair[$op] = (count($val) == 1) ?
+ (($op == 'notin' || $op == 'mnot') ? ts('Is Not') : ts('Is')) :
+ ($pair[$op] ?? '');
$val = implode(', ', $val);
$value = "{$pair[$op]} " . $val;
}
isset($field['options']) &&
is_array($field['options']) && !empty($field['options'])
) {
- $value = ($pair[$op] ?? '') . " " .
- CRM_Utils_Array::value($val, $field['options'], $val);
+ $value = ($pair[$op] ?? '') . ' ' . ($field['options'][$val] ?? $val);
}
elseif ($val || $val == '0') {
$value = ($pair[$op] ?? '') . " " . $val;
public function compileContent() {
$templateFile = $this->getHookedTemplateFileName();
return ($this->_formValues['report_header'] ?? '') .
- CRM_Core_Form::$_template->fetch($templateFile) .
- CRM_Utils_Array::value('report_footer', $this->_formValues);
+ CRM_Core_Form::$_template->fetch($templateFile) .
+ ($this->_formValues['report_footer'] ?? '');
}
/**
'is_deceased' => [
'title' => ts('Deceased'),
'type' => CRM_Utils_Type::T_BOOLEAN,
- 'default' => CRM_Utils_Array::value('deceased', $defaults, 0),
+ 'default' => $defaults['deceased'] ?? 0,
],
'do_not_email' => [
'title' => ts('Do not email'),
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
public function compileContent() {
$coverSheet = $this->_surveyCoverSheet() .
- "<div style=\"page-break-after: always\"></div>";
+ "<div style=\"page-break-after: always\"></div>";
$templateFile = $this->getHookedTemplateFileName();
return $coverSheet .
CRM_Core_Form::$_template->fetch($templateFile) .
- CRM_Utils_Array::value('report_footer', $this->_formValues);
+ ($this->_formValues['report_footer'] ?? '');
}
/**
else {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
);
}
else {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
$op = $this->_params["{$fieldName}_op"] ?? NULL;
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
if (!empty($clause)) {
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
$clause = $this->whereClause($field,
$op,
$contactTypes,
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
$subTypeClause = $this->whereClause($field,
$op,
$contactSubTypes,
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
if ($clause) {
$clause = '(' . $clause . ' OR ' . $subTypeClause . ')';
else {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
$total = [];
$total['civicrm_contact_sort_name'] = ts('Total');
foreach ($summaryYears as $year) {
- $total[$year] = CRM_Utils_Array::value($year, $primaryRow, 0);
+ $total[$year] = $primaryRow[$year] ?? 0;
}
$relatedContact = FALSE;
$relatedContact = TRUE;
$relatedRow = $relatedContributions[$relcid];
foreach ($summaryYears as $year) {
- $total[$year] += CRM_Utils_Array::value($year, $relatedRow, 0);
+ $total[$year] += $relatedRow[$year] ?? 0;
}
foreach (array_keys($this->_relationshipColumns) as $col) {
else {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
foreach ($rows as $key => $row) {
// The final row contains the totals so we don't need to include it here.
if (!empty($row['civicrm_contribution_contact_id'])) {
- $display['life_time'] = CRM_Utils_Array::value('life_time', $display) +
+ $display['life_time'] = ($display['life_time'] ?? 0) +
$row['civicrm_contribution_civicrm_life_time_total'];
- $display[$previous_year] = CRM_Utils_Array::value($previous_year, $display) + $row['civicrm_contribution_last_year_total_amount'];
+ $display[$previous_year] = ($display[$previous_year] ?? 0) + $row['civicrm_contribution_last_year_total_amount'];
}
}
else {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
if (!empty($clause)) {
// hack to fix title
list($from1, $to1) = $this->getFromTo(CRM_Utils_Array::value("receive_date1_relative", $this->_params),
- CRM_Utils_Array::value("receive_date1_from", $this->_params),
- CRM_Utils_Array::value("receive_date1_to", $this->_params)
+ $this->_params["receive_date1_from"] ?? NULL,
+ $this->_params["receive_date1_to"] ?? NULL
);
$from1 = CRM_Utils_Date::customFormat($from1, NULL, ['d']);
$to1 = CRM_Utils_Date::customFormat($to1, NULL, ['d']);
list($from2, $to2) = $this->getFromTo(CRM_Utils_Array::value("receive_date2_relative", $this->_params),
- CRM_Utils_Array::value("receive_date2_from", $this->_params),
- CRM_Utils_Array::value("receive_date2_to", $this->_params)
+ $this->_params["receive_date2_from"] ?? NULL,
+ $this->_params["receive_date2_to"] ?? NULL
);
$from2 = CRM_Utils_Date::customFormat($from2, NULL, ['d']);
$to2 = CRM_Utils_Date::customFormat($to2, NULL, ['d']);
* Rows generated by SQL, with an array for each row.
*/
public function alterDisplay(&$rows) {
- list($from1, $to1) = $this->getFromTo(CRM_Utils_Array::value("receive_date1_relative", $this->_params),
- CRM_Utils_Array::value("receive_date1_from", $this->_params),
- CRM_Utils_Array::value("receive_date1_to", $this->_params)
+ [$from1, $to1] = $this->getFromTo(CRM_Utils_Array::value("receive_date1_relative", $this->_params),
+ $this->_params["receive_date1_from"] ?? NULL,
+ $this->_params["receive_date1_to"] ?? NULL
);
- list($from2, $to2) = $this->getFromTo(CRM_Utils_Array::value("receive_date2_relative", $this->_params),
- CRM_Utils_Array::value("receive_date2_from", $this->_params),
- CRM_Utils_Array::value("receive_date2_to", $this->_params)
+ [$from2, $to2] = $this->getFromTo(CRM_Utils_Array::value("receive_date2_relative", $this->_params),
+ $this->_params["receive_date2_from"] ?? NULL,
+ $this->_params["receive_date2_to"] ?? NULL
);
$dateUrl = "";
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
if (($fieldName == 'contribution_status_id' ||
$fieldName == 'financial_type_id') && !empty($clause)
foreach ($rows as $key => $row) {
$display["upto_{$upto}"]
- = CRM_Utils_Array::value("upto_{$upto}", $display) + CRM_Utils_Array::value("civicrm_upto_{$upto}", $row);
+ = ($display["upto_{$upto}"] ?? 0) + ($row["civicrm_upto_{$upto}"] ?? 0);
$display[$previous_year]
- = CRM_Utils_Array::value($previous_year, $display) + CRM_Utils_Array::value($previous_year, $row);
+ = ($display[$previous_year] ?? 0) + ($row[$previous_year] ?? 0);
$display[$previous_two_year]
- = CRM_Utils_Array::value($previous_two_year, $display) + CRM_Utils_Array::value($previous_two_year, $row);
+ = ($display[$previous_two_year] ?? 0) + ($row[$previous_two_year] ?? 0);
$display[$previous_three_year]
- = CRM_Utils_Array::value($previous_three_year, $display) + CRM_Utils_Array::value($previous_three_year, $row);
+ = ($display[$previous_three_year] ?? 0) + ($row[$previous_three_year] ?? 0);
}
$graphRows['value'] = $display;
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
else {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}
if ($op) {
$clause = $this->whereClause($field,
$op,
- CRM_Utils_Array::value("{$fieldName}_value", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_min", $this->_params),
- CRM_Utils_Array::value("{$fieldName}_max", $this->_params)
+ $this->_params["{$fieldName}_value"] ?? NULL,
+ $this->_params["{$fieldName}_min"] ?? NULL,
+ $this->_params["{$fieldName}_max"] ?? NULL
);
}
}