$row = &$rows[$k];
// add class to this row if overdue
- if (CRM_Utils_Date::overdue(CRM_Utils_Array::value('activity_date_time', $row))
+ if (CRM_Utils_Date::overdue($row['activity_date_time'] ?? '')
&& ($row['status_id'] ?? NULL) == 1
) {
$row['overdue'] = 1;
public static function validRegistrationDate(&$values) {
// make sure that we are between registration start date and end dates
// and that if the event has ended, registration is still specifically open
- $startDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_start_date', $values));
- $endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_end_date', $values));
- $eventEnd = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('end_date', $values));
+ $startDate = CRM_Utils_Date::unixTime($values['registration_start_date'] ?? '');
+ $endDate = CRM_Utils_Date::unixTime($values['registration_end_date'] ?? '');
+ $eventEnd = CRM_Utils_Date::unixTime($values['end_date'] ?? '');
$now = time();
$validDate = TRUE;
if ($startDate && $startDate >= $now) {
// ignore startDate for events - PCP's can be active long before event start date
$startDate = 0;
- $endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('end_date', $entity));
+ $endDate = CRM_Utils_Date::unixTime($entity['end_date'] ?? '');
}
elseif ($component == 'contribute') {
$urlBase = 'civicrm/contribute/transact';
//start and end date of the contribution page
- $startDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('start_date', $entity));
- $endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('end_date', $entity));
+ $startDate = CRM_Utils_Date::unixTime($entity['start_date'] ?? '');
+ $endDate = CRM_Utils_Date::unixTime($entity['end_date'] ?? '');
}
// define redirect url back to contrib page or event if needed
}
// Check if we're in range for contribution page start and end dates. for events, check if after event end date
elseif (($startDate && $startDate > $now) || ($endDate && $endDate < $now)) {
- $customStartDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('start_date', $entity));
- $customEndDate = CRM_Utils_Date::customFormat(CRM_Utils_Array::value('end_date', $entity));
+ $customStartDate = CRM_Utils_Date::customFormat($entity['start_date'] ?? '');
+ $customEndDate = CRM_Utils_Date::customFormat($entity['end_date'] ?? '');
if ($startDate && $endDate) {
$statusMessage = ts('The Personal Campaign Page you have just visited is only active from %1 to %2. However you can still support the campaign here.',
[1 => $customStartDate, 2 => $customEndDate]
}
// make sure that we are between contribution page start and end dates OR registration start date and end dates if they are set
if ($pcpBlock->entity_table == 'civicrm_event') {
- $startDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_start_date', $pageInfo));
- $endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('registration_end_date', $pageInfo));
+ $startDate = CRM_Utils_Date::unixTime($pageInfo['registration_start_date'] ?? '');
+ $endDate = CRM_Utils_Date::unixTime($pageInfo['registration_end_date'] ?? '');
}
else {
- $startDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('start_date', $pageInfo));
- $endDate = CRM_Utils_Date::unixTime(CRM_Utils_Array::value('end_date', $pageInfo));
+ $startDate = CRM_Utils_Date::unixTime($pageInfo['start_date'] ?? '');
+ $endDate = CRM_Utils_Date::unixTime($pageInfo['end_date'] ?? '');
}
$now = time();