revert 20476
authordemeritcowboy <demeritcowboy@hotmail.com>
Sat, 12 Mar 2022 16:36:58 +0000 (11:36 -0500)
committerdemeritcowboy <demeritcowboy@hotmail.com>
Sat, 12 Mar 2022 16:36:58 +0000 (11:36 -0500)
51 files changed:
CRM/Contribute/BAO/Contribution.php
CRM/Core/SelectValues.php
CRM/Event/BAO/Event.php
CRM/Event/BAO/Participant.php
CRM/Event/Form/ManageEvent/EventInfo.php
CRM/Event/Form/ManageEvent/Registration.php
CRM/Event/Form/Participant.php
CRM/Event/Form/ParticipantFeeSelection.php
CRM/Event/Form/Registration.php
CRM/Event/Form/SelfSvcTransfer.php
CRM/Event/ICalendar.php
CRM/Event/Page/EventInfo.php
CRM/Event/Page/List.php
CRM/Event/Page/ManageEvent.php
CRM/Event/Tokens.php
CRM/Financial/BAO/Payment.php
CRM/Upgrade/Incremental/MessageTemplates.php
CRM/Upgrade/Incremental/php/FiveFortySeven.php
CRM/Upgrade/Incremental/sql/5.47.alpha1.mysql.tpl
CRM/Utils/Check/Component/Env.php
CRM/Utils/Check/Component/Event.php [deleted file]
CRM/Utils/Date.php
Civi/Api4/Service/Spec/Provider/EventCreationSpecProvider.php
api/v3/Event.php
templates/CRM/Core/Calendar/ICal.tpl
templates/CRM/Event/Form/ManageEvent/EventInfo.tpl
templates/CRM/Event/Form/ManageEvent/Registration.tpl
templates/CRM/Event/Form/Registration/EventInfoBlock.tpl
templates/CRM/Event/Page/EventInfo.tpl
templates/CRM/Event/Page/List.tpl
templates/CRM/Event/Page/ManageEvent.tpl
tests/phpunit/CRM/Event/Form/ManageEvent/EventInfoTest.php [deleted file]
tests/phpunit/CRM/Event/Form/ManageEvent/RegistrationTest.php [deleted file]
tests/phpunit/CRM/Utils/DateTest.php
tests/phpunit/CRM/Utils/TokenConsistencyTest.php
tests/phpunit/api/v4/DataSets/ConformanceTest.json
xml/schema/Event/Event.xml
xml/templates/message_templates/event_offline_receipt_html.tpl
xml/templates/message_templates/event_offline_receipt_text.tpl
xml/templates/message_templates/event_online_receipt_html.tpl
xml/templates/message_templates/event_online_receipt_text.tpl
xml/templates/message_templates/participant_cancelled_html.tpl
xml/templates/message_templates/participant_cancelled_text.tpl
xml/templates/message_templates/participant_confirm_html.tpl
xml/templates/message_templates/participant_confirm_text.tpl
xml/templates/message_templates/participant_expired_html.tpl
xml/templates/message_templates/participant_expired_text.tpl
xml/templates/message_templates/participant_transferred_html.tpl
xml/templates/message_templates/participant_transferred_text.tpl
xml/templates/message_templates/payment_or_refund_notification_html.tpl
xml/templates/message_templates/payment_or_refund_notification_text.tpl

index accc14ae80b4b9c33b11b9195d8b0d1c6bd361c7..b84a36269de2a66a22a5e2bf25771daa37b4525e 100644 (file)
@@ -2542,8 +2542,6 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac
 
       CRM_Event_BAO_Event::retrieve($eventParams, $values['event']);
 
-      CRM_Event_BAO_Event::setOutputTimeZone($values['event']);
-
       //get location details
       $locationParams = [
         'entity_id' => $this->_relatedObjects['participant']->event_id,
@@ -4724,8 +4722,6 @@ LIMIT 1;";
 
     CRM_Event_BAO_Event::retrieve($eventParams, $values['event']);
 
-    CRM_Event_BAO_Event::setOutputTimeZone($values['event']);
-
     // add custom fields for event
     $eventGroupTree = CRM_Core_BAO_CustomGroup::getTree('Event', NULL, $eventID);
 
index 31254a4dc73f2f9a713676b48119891a680bb8b4..a3c479ff28e554b55e4a992bc6fb6316353303a5 100644 (file)
@@ -1175,22 +1175,4 @@ class CRM_Core_SelectValues {
     ];
   }
 
-  public static function timezone() {
-    $tzlist = &Civi::$statics[__CLASS__]['tzlist'];
-
-    if (is_null($tzlist)) {
-      $tzlist = [];
-      foreach (timezone_identifiers_list() as $tz) {
-        // Actual timezone keys for PHP are mapped to human parts.
-        $tzlist[$tz] = str_replace('_', ' ', $tz);
-      }
-
-      // Add 'Etc/UTC' specially, as timezone_identifiers_list() does
-      // not include it, but it is the IANA long name for 'UTC'
-      $tzlist['Etc/UTC'] = ts('Etc/UTC');
-    }
-
-    return $tzlist;
-  }
-
 }
index ca212da132f1b3fa1e27f76ea1dff87281e21b5d..0aadbbae0d020bc45214d52da9da88beb7846539 100644 (file)
@@ -15,7 +15,6 @@
  * @copyright CiviCRM LLC https://civicrm.org/licensing
  */
 class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
-  const tz_fields = ['event_start_date', 'event_end_date', 'start_date', 'end_date', 'registration_start_date', 'registration_end_date'];
 
   /**
    * Retrieve DB object and copy to defaults array.
@@ -777,7 +776,6 @@ SELECT
   civicrm_email.email as email,
   civicrm_event.title as title,
   civicrm_event.summary as summary,
-  civicrm_event.event_tz as event_tz,
   civicrm_event.start_date as start,
   civicrm_event.end_date as end,
   civicrm_event.description as description,
@@ -849,7 +847,6 @@ WHERE civicrm_event.is_active = 1
         $info['event_id'] = $dao->event_id;
         $info['summary'] = $dao->summary;
         $info['description'] = $dao->description;
-        $info['tz'] = $dao->event_tz ?? CRM_Core_Config::singleton()->userSystem->getTimeZoneString();
         $info['start_date'] = $dao->start;
         $info['end_date'] = $dao->end;
         $info['contact_email'] = $dao->email;
@@ -2434,52 +2431,4 @@ LEFT  JOIN  civicrm_price_field_value value ON ( value.id = lineItem.price_field
     return $return;
   }
 
-  /**
-   * Changes timezone-enabled fields to the correct zone for output and add local
-   * & UTC variants
-   *
-   * @param array $params
-   * @param $to_tz
-   *
-   * @return void
-   */
-  public static function setOutputTimeZone(array &$params, $to_tz = NULL) {
-    $to_tz = $to_tz ?? ($params['event_tz'] ?? NULL);
-
-    if (is_null($to_tz)) {
-      return;
-    }
-
-    foreach (CRM_Event_BAO_Event::tz_fields as $field) {
-      if (!empty($params[$field]) && empty($params[$field . '_local'])) {
-        $params[$field . '_utc'] = CRM_Utils_Date::convertTimeZone($params[$field], 'UTC');
-        $params[$field . '_local'] = $params[$field];
-        $params[$field] = CRM_Utils_Date::convertTimeZone($params[$field], $to_tz);
-      }
-    }
-
-  }
-
-  public static function setTimezones(CRM_Event_DAO_Event $event) {
-    // Pre-process time zoned fields into the PHP time zone, which should be the same as the database, to save as timestamp.
-    $timezone_event = ($event->event_tz ?: (!empty($event->id) ? CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $event->id, 'event_tz') : NULL));
-
-    foreach (self::tz_fields as $field) {
-      if (!empty($event->{$field})) {
-        $event->{$field} = CRM_Utils_Date::convertTimeZone($event->{$field}, NULL, $timezone_event);
-      }
-    }
-  }
-
-  public static function resetTimezones(CRM_Event_DAO_Event $event) {
-    // Process time zoned fields into their own time zone
-    $timezone_event = ($event->event_tz ?: (!empty($event->id) ? CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $event->id, 'event_tz') : NULL));
-
-    foreach (self::tz_fields as $field) {
-      if (!empty($event->{$field})) {
-        $event->{$field} = CRM_Utils_Date::convertTimeZone($event->{$field}, $timezone_event);
-      }
-    }
-  }
-
 }
index 8743339af5f47fa6286a0a198df10d4ac6f0be4c..ec9a4eb7af7b23c1a4f276d21b77e1601dcad34b 100644 (file)
@@ -1392,8 +1392,6 @@ UPDATE  civicrm_participant
       return $mailSent;
     }
 
-    CRM_Event_BAO_Event::setOutputTimeZone($eventDetails);
-
     $toEmail = $contactDetails['email'] ?? NULL;
     if ($toEmail) {
 
index cfaad1fa5685c5f0b14a3baaa8717c93502f0586..4e9ab1bd75e2bd67e80c596a56fcbc457b735c6c 100644 (file)
@@ -101,16 +101,6 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent {
     $defaults['waitlist_text'] = CRM_Utils_Array::value('waitlist_text', $defaults, ts('This event is currently full. However you can register now and get added to a waiting list. You will be notified if spaces become available.'));
     $defaults['template_id'] = $this->_templateId;
 
-    $defaults['event_tz'] = CRM_Utils_Array::value('event_tz', $defaults, CRM_Core_Config::singleton()->userSystem->getTimeZoneString());
-
-    // Convert start and end date defaults to event time zone.
-    if (!empty($defaults['start_date'])) {
-      $defaults['start_date'] = CRM_Utils_Date::convertTimeZone($defaults['start_date'], $defaults['event_tz']);
-    }
-    if (!empty($defaults['end_date'])) {
-      $defaults['end_date'] = CRM_Utils_Date::convertTimeZone($defaults['end_date'], $defaults['event_tz']);
-    }
-
     return $defaults;
   }
 
@@ -170,8 +160,6 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent {
     $this->addElement('checkbox', 'is_share', ts('Add footer region with Twitter, Facebook and LinkedIn share buttons and scripts?'));
     $this->addElement('checkbox', 'is_map', ts('Include Map to Event Location'));
 
-    $this->addSelect('event_tz', ['placeholder' => ts('- Select time zone -')], TRUE);
-
     $this->add('datepicker', 'start_date', ts('Start'), [], !$this->_isTemplate, ['time' => TRUE]);
     $this->add('datepicker', 'end_date', ts('End'), [], FALSE, ['time' => TRUE]);
 
@@ -228,8 +216,8 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent {
     $params = array_merge($this->controller->exportValues($this->_name), $this->_submitValues);
 
     //format params
-    $params['start_date'] = !empty($params['start_date']) ? CRM_Utils_Date::convertTimeZone($params['start_date'], NULL, $params['event_tz'] ?? NULL) : $params['start_date'];
-    $params['end_date'] = !empty($params['end_date']) ? CRM_Utils_Date::convertTimeZone($params['end_date'], NULL, $params['event_tz'] ?? NULL) : $params['end_date'];
+    $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);
index ebde37ac6b4702093b40e9280065fb33edb069e8..53a6d5e99a482063b08f066e61cb43524aec62d7 100644 (file)
@@ -29,8 +29,6 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
   protected $_profilePostMultiple = [];
   protected $_profilePostMultipleAdd = [];
 
-  protected $_tz;
-
   /**
    * Set variables up before form is built.
    */
@@ -168,14 +166,6 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
     $defaults['thankyou_title'] = CRM_Utils_Array::value('thankyou_title', $defaults, ts('Thank You for Registering'));
     $defaults['approval_req_text'] = CRM_Utils_Array::value('approval_req_text', $defaults, ts('Participation in this event requires approval. Submit your registration request here. Once approved, you will receive an email with a link to a web page where you can complete the registration process.'));
 
-    // Convert start and end date defaults to event time zone.
-    if (!empty($defaults['registration_start_date'])) {
-      $defaults['registration_start_date'] = CRM_Utils_Date::convertTimeZone($defaults['registration_start_date'], $this->_tz ?? NULL);
-    }
-    if (!empty($defaults['registration_end_date'])) {
-      $defaults['registration_end_date'] = CRM_Utils_Date::convertTimeZone($defaults['registration_end_date'], $this->_tz ?? NULL);
-    }
-
     return $defaults;
   }
 
@@ -238,9 +228,6 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
     $this->add('text', 'registration_link_text', ts('Registration Link Text'));
 
     if (!$this->_isTemplate) {
-      $this->_tz = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'event_tz');
-      $tz = CRM_Core_SelectValues::timezone()[$this->_tz];
-      $this->assign('event_tz', $tz ?? '<span class="error-message">' . ts('%1 No timezone set', [1 => '<i class="crm-i fa-warning"></i>']) . '</span>');
       $this->add('datepicker', 'registration_start_date', ts('Registration Start Date'), [], FALSE, ['time' => TRUE]);
       $this->add('datepicker', 'registration_end_date', ts('Registration End Date'), [], FALSE, ['time' => TRUE]);
     }
@@ -789,10 +776,6 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
 
     $params['id'] = $this->_id;
 
-    if (!isset($this->_tz)) {
-      $this->_tz = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $this->_id, 'event_tz') ?? CRM_Core_Config::singleton()->userSystem->getTimeZoneString();
-    }
-
     // format params
     $params['is_online_registration'] = CRM_Utils_Array::value('is_online_registration', $params, FALSE);
     // CRM-11182
@@ -800,8 +783,6 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
     $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['registration_start_date'] = !empty($params['registration_start_date']) ? CRM_Utils_Date::convertTimeZone($params['registration_start_date'], NULL, $this->_tz ?? NULL) : $params['registration_start_date'];
-    $params['registration_end_date'] = !empty($params['registration_end_date']) ? CRM_Utils_Date::convertTimeZone($params['registration_end_date'], NULL, $this->_tz ?? NULL) : $params['registration_end_date'];
 
     // reset is_email confirm if not online reg
     if (!$params['is_online_registration']) {
index e99eb186dfedc7c78a3ace5d54c52561da92cabb..98666d186abe8d0a1d8ba762fc1941a0979c4c3c 100644 (file)
@@ -1892,7 +1892,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
   protected function assignEventDetailsToTpl($eventID, $participantRoles, $receiptText, $isPaidEvent) {
     //use of the message template below requires variables in different format
     $events = [];
-    $returnProperties = ['event_type_id', 'fee_label', 'start_date', 'end_date', 'event_tz', 'is_show_location', 'title'];
+    $returnProperties = ['event_type_id', 'fee_label', 'start_date', 'end_date', 'is_show_location', 'title'];
 
     //get all event details.
     CRM_Core_DAO::commonRetrieveAll('CRM_Event_DAO_Event', 'id', $eventID, $events, $returnProperties);
@@ -1900,8 +1900,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     unset($event['start_date']);
     unset($event['end_date']);
 
-    CRM_Event_BAO_Event::setOutputTimeZone($event);
-
     $role = CRM_Event_PseudoConstant::participantRole();
 
     if (is_array($participantRoles)) {
index 19a0a1174e424266d4a9171c47f5466d8cc0e7f7..d266851b3612a0109874a95a18e86268f721de34 100644 (file)
@@ -285,7 +285,7 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
     $this->assign('module', 'Event Registration');
     //use of the message template below requires variables in different format
     $event = $events = [];
-    $returnProperties = ['fee_label', 'start_date', 'end_date', 'event_tz', 'is_show_location', 'title'];
+    $returnProperties = ['fee_label', 'start_date', 'end_date', 'is_show_location', 'title'];
 
     //get all event details.
     CRM_Core_DAO::commonRetrieveAll('CRM_Event_DAO_Event', 'id', $params['event_id'], $events, $returnProperties);
@@ -293,8 +293,6 @@ class CRM_Event_Form_ParticipantFeeSelection extends CRM_Core_Form {
     unset($event['start_date']);
     unset($event['end_date']);
 
-    CRM_Event_BAO_Event::setOutputTimeZone($event);
-
     $role = CRM_Event_PseudoConstant::participantRole();
     $participantRoles = $params['role_id'] ?? NULL;
     if (is_array($participantRoles)) {
index 6e0af9256012e0111bced3628e6874474f202334..a34fcecd907fddfd1e4e521a6dab35ecfb3f186b 100644 (file)
@@ -231,8 +231,6 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
       $params = ['id' => $this->_eventId];
       CRM_Event_BAO_Event::retrieve($params, $this->_values['event']);
 
-      CRM_Event_BAO_Event::setOutputTimeZone($this->_values['event'], $this->_values['event']['event_tz']);
-
       // check for is_monetary status
       $isMonetary = $this->_values['event']['is_monetary'] ?? NULL;
       // check for ability to add contributions of type
index 15659cfbabb0fdad6b54da6418eeda38fcdd1dde..a6db5abdd92a08d20af067b0b352ca46f02745d4 100644 (file)
@@ -373,8 +373,6 @@ class CRM_Event_Form_SelfSvcTransfer extends CRM_Core_Form {
     $eventParams = ['id' => $participant->event_id];
     CRM_Event_BAO_Event::retrieve($eventParams, $eventDetails);
 
-    CRM_Event_BAO_Event::setOutputTimeZone($eventDetails);
-
     //get default participant role.
     $eventDetails['participant_role'] = $participantRoles[$eventDetails['default_role_id']] ?? NULL;
     //get the location info
index c3e1b45aa58cd668986258228da67e70183b871e..a4cc998fd7b8f59890f48b4aeb6bc98323a8071a 100644 (file)
@@ -48,15 +48,8 @@ class CRM_Event_ICalendar {
 
     $info = CRM_Event_BAO_Event::getCompleteInfo($start, $type, $id, $end);
 
-    foreach ($info as &$event) {
-      $event['start_date'] = CRM_Utils_Date::convertTimeZone($event['start_date'], $event['tz']);
-      $event['end_date'] = !empty($event['end_date']) ? CRM_Utils_date::convertTimeZone($event['end_date'], $event['tz']) : NULL;
-      $event['registration_start_date'] = !empty($event['registration_start_date']) ? CRM_Utils_date::convertTimeZone($event['registration_start_date'], $event['tz']) : NULL;
-      $event['registration_end_date'] = !empty($event['registration_end_date']) ? CRM_Utils_date::convertTimeZone($event['registration_end_date'], $event['tz']) : NULL;
-    }
-
     $template->assign('events', $info);
-    $template->assign('timezone', CRM_Core_Config::singleton()->userSystem->getTimeZoneString());
+    $template->assign('timezone', @date_default_timezone_get());
 
     // Send data to the correct template for formatting (iCal vs. gData)
     if ($rss) {
index cffa12126561b59be31e6f2c9259babd0c565ba9..8f141a2a8565be6730f6cd698c7f3402a7895ec4 100644 (file)
@@ -79,11 +79,6 @@ class CRM_Event_Page_EventInfo extends CRM_Core_Page {
 
     $this->assign('isShowLocation', CRM_Utils_Array::value('is_show_location', $values['event']));
 
-    // Reset event time zone info
-    CRM_Event_BAO_Event::setOutputTimeZone($values['event'], $values['event']['event_tz']);
-
-    $values['event']['event_tz'] = CRM_Core_SelectValues::timezone()[$values['event']['event_tz']];
-
     // show event fees.
     if ($this->_id && !empty($values['event']['is_monetary'])) {
       CRM_Contribute_BAO_Contribution_Utils::overrideDefaultCurrency($values['event']);
index ca4fae057b2e9792793a724ed905bdcfe7c7a781..9fbacab7c4bfe847b1fe9c9143e47e109b50b87b 100644 (file)
@@ -22,20 +22,6 @@ class CRM_Event_Page_List extends CRM_Core_Page {
 
     $info = CRM_Event_BAO_Event::getCompleteInfo($start, $type, $id, $end);
 
-    foreach ($info as &$event) {
-      $event['start_date_utc'] = CRM_Utils_Date::convertTimeZone($event['start_date'], 'UTC');
-      $event['start_date'] = CRM_Utils_Date::convertTimeZone($event['start_date'], $event['tz']);
-
-      $event['end_date_utc'] = !empty($event['end_date']) ? CRM_Utils_Date::convertTimeZone($event['end_date'], 'UTC') : NULL;
-      $event['end_date'] = !empty($event['end_date']) ? CRM_Utils_date::convertTimeZone($event['end_date'], $event['tz']) : NULL;
-
-      $event['registration_start_date_utc'] = !empty($event['registration_start_date']) ? CRM_Utils_Date::convertTimeZone($event['registration_start_date'], 'UTC') : NULL;
-      $event['registration_start_date'] = !empty($event['registration_start_date']) ? CRM_Utils_date::convertTimeZone($event['registration_start_date'], $event['tz']) : NULL;
-
-      $event['registration_end_date_utc'] = !empty($event['registration_end_date']) ? CRM_Utils_Date::convertTimeZone($event['registration_end_date'], 'UTC') : NULL;
-      $event['registration_end_date'] = !empty($event['registration_end_date']) ? CRM_Utils_date::convertTimeZone($event['registration_end_date'], $event['tz']) : NULL;
-    }
-
     $this->assign('events', $info);
 
     // @todo Move this to eventcart extension
index 356710c81d4e5ada998eab76d30f96e7f08098e5..a39eb17a6a32e0308a1fc11ed1bfe4254360d23f 100644 (file)
@@ -361,19 +361,6 @@ ORDER BY start_date desc
         }
         CRM_Core_DAO::storeValues($dao, $manageEvent[$dao->id]);
 
-        // avoid enotices
-        foreach (CRM_Event_BAO_Event::tz_fields as $field) {
-          $manageEvent[$dao->id][$field . '_with_tz'] = NULL;
-        }
-        if (!is_null($dao->event_tz) && $dao->event_tz != CRM_Core_Config::singleton()->userSystem->getTimeZoneString()) {
-          foreach (CRM_Event_BAO_Event::tz_fields as $field) {
-            if (!empty($dao->{$field})) {
-              $manageEvent[$dao->id][$field . '_with_tz'] = CRM_Utils_Date::convertTimeZone($dao->{$field}, $dao->event_tz);
-            }
-          }
-        }
-        $manageEvent[$dao->id]['event_tz'] = $dao->event_tz ? CRM_Core_SelectValues::timezone()[$dao->event_tz] : FALSE;
-
         // form all action links
         $action = array_sum(array_keys($this->links()));
 
index 44afb797f114520d5dcd084986c0a906efbd9775..ca6fb553dd24d32fa444abb77dc4dffb177d5bfa 100644 (file)
@@ -144,8 +144,6 @@ class CRM_Event_Tokens extends CRM_Core_EntityTokens {
       $tokens['event_type_id:name']['text/html'] = CRM_Core_PseudoConstant::getName('CRM_Event_BAO_Event', 'event_type_id', $event['event_type_id']);
       $tokens['contact_phone']['text/html'] = $event['loc_block_id.phone_id.phone'];
       $tokens['contact_email']['text/html'] = $event['loc_block_id.email_id.email'];
-      $tokens['event_tz:label']['text/html'] = !empty($event['event_tz']) ? CRM_Core_SelectValues::timezone()[$event['event_tz']] : '';
-      $tokens['event_tz:name']['text/html'] = $event['event_tz'] ?? '';
 
       foreach ($this->getTokenMetadata() as $fieldName => $fieldSpec) {
         if (!isset($tokens[$fieldName])) {
@@ -178,7 +176,6 @@ class CRM_Event_Tokens extends CRM_Core_EntityTokens {
     return ['event_type_id',
       'title',
       'id',
-      'event_tz',
       'start_date',
       'end_date',
       'summary',
index 12439c2dfbc6564ee3dd06f6c4f4fe9f03a0572d..cec2c4425d05befe1135a55509daddb95870dedf 100644 (file)
@@ -279,10 +279,6 @@ class CRM_Financial_BAO_Payment {
 
     $entities = self::loadRelatedEntities($params['id']);
 
-    if (!empty($entities['event'])) {
-      CRM_Event_BAO_Event::setOutputTimeZone($entities['event']);
-    }
-
     $sendTemplateParams = [
       'groupName' => 'msg_tpl_workflow_contribution',
       'valueName' => 'payment_or_refund_notification',
index 09a87dd77fd9a0b802c5ad5f018b620a55cc0f6e..a46359bb544df0a384b8a98bb22dac186353c870 100644 (file)
@@ -315,8 +315,16 @@ class CRM_Upgrade_Incremental_MessageTemplates {
         ],
       ],
       [
-        'version' => '5.47.alpha1',
-        'upgrade_descriptor' => ts('Add time zone to Event dates'),
+        'version' => '5.48.alpha1',
+        'upgrade_descriptor' => ts('Replace {receipt_text_renewal} with {receipt_text}'),
+        'templates' => [
+          ['name' => 'membership_offline_receipt', 'type' => 'html'],
+          ['name' => 'membership_offline_receipt', 'type' => 'text'],
+        ],
+      ],
+      [
+        'version' => '5.48.beta1',
+        'upgrade_descriptor' => ts('Revert time zone for Event dates'),
         'templates' => [
           ['name' => 'event_online_receipt', 'type' => 'html'],
           ['name' => 'event_online_receipt', 'type' => 'text'],
@@ -334,14 +342,6 @@ class CRM_Upgrade_Incremental_MessageTemplates {
           ['name' => 'payment_or_refund_notification', 'type' => 'text'],
         ],
       ],
-      [
-        'version' => '5.48.alpha1',
-        'upgrade_descriptor' => ts('Replace {receipt_text_renewal} with {receipt_text}'),
-        'templates' => [
-          ['name' => 'membership_offline_receipt', 'type' => 'html'],
-          ['name' => 'membership_offline_receipt', 'type' => 'text'],
-        ],
-      ],
     ];
   }
 
index ff2204c8c8f09dce5b00be559224d63c5906a21a..84fac95707719815dcfd8f9ca9e3974d7969d4e5 100644 (file)
@@ -69,10 +69,6 @@ class CRM_Upgrade_Incremental_php_FiveFortySeven extends CRM_Upgrade_Incremental
       "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Relationship last modified.'"
     );
     $this->addTask('Set initial value for relationship created_date and modified_date to start_date', 'updateRelationshipDates');
-    $this->addTask('core-issue#2122 - Add timezone column to Events', 'addColumn',
-      'civicrm_event', 'event_tz', "text NULL DEFAULT NULL COMMENT 'Event\'s native time zone'"
-    );
-    $this->addTask('core-issue#2122 - Set the timezone to the default for existing Events', 'setEventTZDefault');
     $this->addTask('Drop CustomGroup UI_name_extends index', 'dropIndex', 'civicrm_custom_group', 'UI_name_extends');
     $this->addTask('Add CustomGroup UI_name index', 'addIndex', 'civicrm_custom_group', ['name'], 'UI');
     if (CRM_Core_DAO::checkTableExists('civicrm_search_display')) {
@@ -310,17 +306,4 @@ class CRM_Upgrade_Incremental_php_FiveFortySeven extends CRM_Upgrade_Incremental
     return TRUE;
   }
 
-  /**
-   * Set the timezone to the default for existing Events.
-   *
-   * @param \CRM_Queue_TaskContext $ctx
-   * @return bool
-   */
-  public static function setEventTZDefault(CRM_Queue_TaskContext $ctx) {
-    // Set default for CiviCRM Events to user system timezone (most reasonable default);
-    $defaultTZ = CRM_Core_Config::singleton()->userSystem->getTimeZoneString();
-    CRM_Core_DAO::executeQuery('UPDATE `civicrm_event` SET `event_tz` = %1 WHERE `event_tz` IS NULL;', [1 => [$defaultTZ, 'String']]);
-    return TRUE;
-  }
-
 }
index 3943ae4308730cf3cbce2c9841494f9078609f5a..c551271f12b3cf5cb7f6a05be12a10c6cd54c3a1 100644 (file)
@@ -16,16 +16,5 @@ ALTER TABLE `civicrm_navigation`
   MODIFY COLUMN `is_active` tinyint NOT NULL DEFAULT 1 COMMENT 'Is this navigation item active?',
   MODIFY COLUMN `weight` int NOT NULL DEFAULT 0 COMMENT 'Ordering of the navigation items in various blocks.';
 
-{* https://lab.civicrm.org/dev/core/-/issues/2122 *}
-UPDATE `civicrm_event` SET `start_date` = NULL WHERE `start_date` < 19700102;
-UPDATE `civicrm_event` SET `end_date` = NULL WHERE `end_date` < 19700102;
-UPDATE `civicrm_event` SET `registration_start_date` = NULL WHERE `registration_start_date` < 19700102;
-UPDATE `civicrm_event` SET `registration_end_date` = NULL WHERE `registration_end_date` < 19700102;
-ALTER TABLE `civicrm_event`
-  MODIFY COLUMN `start_date` timestamp NULL DEFAULT NULL COMMENT 'Date and time that event starts.',
-  MODIFY COLUMN `end_date` timestamp NULL DEFAULT NULL COMMENT 'Date and time that event ends. May be NULL if no defined end date/time',
-  MODIFY COLUMN `registration_start_date` timestamp NULL DEFAULT NULL COMMENT 'Date and time that online registration starts.',
-  MODIFY COLUMN `registration_end_date` timestamp NULL DEFAULT NULL COMMENT 'Date and time that online registration ends.';
-
 {* Ensure CustomGroup.name is unique *}
 UPDATE civicrm_custom_group g1, civicrm_custom_group g2 SET g1.name = CONCAT(g1.name, '_1') WHERE g1.name = g2.name AND g1.id > g2.id;
index 064f5f01229570988121fe7756b269508d9c87c8..39e1e3dde92f116cfed2045ce02a2b4077b3fa70 100644 (file)
@@ -1042,26 +1042,4 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
     return $messages;
   }
 
-  /**
-   * Ensure that the CMS is providing a supported timezone.
-   *
-   * @return CRM_Utils_Check_Message[]
-   */
-  public function checkUFTimezoneValid() {
-    $messages = [];
-    $check_tz = CRM_Core_Config::singleton()->userSystem->getTimeZoneString();
-
-    if (!array_key_exists($check_tz, CRM_Core_SelectValues::timezone())) {
-      $messages[] = new CRM_Utils_Check_Message(
-        __FUNCTION__,
-        ts('This system has an invalid timezone set. Please verify that your CMS has a timezone configured that is listed under the <a href="%1">PHP List of Supported Timezones</a>.', [1 => 'https://www.php.net/manual/en/timezones.php']),
-        ts('Missing or Invalid Timezone'),
-        \Psr\Log\LogLevel::ERROR,
-        'fa-clock-o'
-      );
-    }
-
-    return $messages;
-  }
-
 }
diff --git a/CRM/Utils/Check/Component/Event.php b/CRM/Utils/Check/Component/Event.php
deleted file mode 100644 (file)
index c84cc7c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-/**
- * @package CRM
- */
-class CRM_Utils_Check_Component_Event extends CRM_Utils_Check_Component {
-
-  /**
-   * @inheritDoc
-   */
-  public function isEnabled() {
-    return CRM_Core_Component::isEnabled('CiviEvent');
-  }
-
-  /**
-   * Check events have timezone set.
-   *
-   * @return CRM_Utils_Check_Message[]
-   * @throws \API_Exception
-   */
-  public function checkTimezones() {
-    $messages = [];
-
-    try {
-      $count = \Civi\Api4\Event::get(FALSE)
-        ->selectRowCount()
-        ->addWhere('event_tz', 'IS EMPTY')
-        ->execute()
-        ->rowCount;
-
-      if ($count) {
-        $msg = new CRM_Utils_Check_Message(
-          __FUNCTION__,
-          '<p>' . ts('%count Event has no timezone set', ['count' => $count, 'plural' => '%count Events have no timezone set.']) . '</p>',
-          ts('Events with Missing Timezone'),
-          \Psr\Log\LogLevel::WARNING,
-          'fa-calendar'
-        );
-        $msg->addAction(
-          ts('Fix Events with Missing Timezone'),
-          ts('This will set the system default timezone "%1" for all Events with no timezone set.', [1 => CRM_Core_Config::singleton()->userSystem->getTimeZoneString()]),
-          'api3',
-          ['Event', 'addMissingTimezones']
-        );
-        $messages[] = $msg;
-      }
-    }
-    catch (API_Exception $e) {
-      $messages[] = new CRM_Utils_Check_Message(
-        __FUNCTION__,
-        ts('API Exception: %1 while checking events for timezones.', ['1' => $e->getMessage()]),
-        ts('Event timezone check failed'),
-        \Psr\Log\LogLevel::ERROR,
-        'fa-calendar'
-      );
-    }
-
-    return $messages;
-  }
-
-}
index b050ace270347e45c9f6b338ccfe64c8eff6aa18..1802632da5374e3c93340420e66463e580c64086 100644 (file)
@@ -2215,72 +2215,4 @@ class CRM_Utils_Date {
     return $dateObject->format($format);
   }
 
-  /**
-   * Convert a date string between time zones
-   *
-   * @param string $date - date string using $format
-   * @param string $tz_to - new time zone for date
-   * @param string $tz_from - current time zone for date
-   * @param string $format - format string specification as per DateTime::createFromFormat; defaults to 'Y-m-d H:i:s'
-   *
-   * @throws \CRM_Core_Exception
-   *
-   * @return string;
-   */
-  public static function convertTimeZone(string $date, string $tz_to = NULL, string $tz_from = NULL, $format = NULL) {
-    if (!$tz_from) {
-      $tz_from = CRM_Core_Config::singleton()->userSystem->getTimeZoneString();
-    }
-    if (!$tz_to) {
-      $tz_to = CRM_Core_Config::singleton()->userSystem->getTimeZoneString();
-    }
-
-    // Return early if both timezones are the same.
-    if ($tz_from == $tz_to) {
-      return $date;
-    }
-
-    $tz_from = new DateTimeZone($tz_from);
-    $tz_to = new DateTimeZone($tz_to);
-
-    if (is_null($format)) {
-      // Detect "mysql" format dates and adjust format accordingly
-      $format = preg_match('/^(\d{4})(\d{2}){0,5}$/', $date, $m) ? 'YmdHis' : 'Y-m-d H:i:s';
-    }
-
-    try {
-      $date_object = DateTime::createFromFormat('!' . $format, $date, $tz_from);
-      $dt_errors = DateTime::getLastErrors();
-
-      if (!$date_object) {
-        Civi::log()->warning(ts('Attempted to convert time zone with incorrect date format %1', ['%1' => $date]));
-
-        $dt_errors = DateTime::getLastErrors();
-
-        $date_object = new DateTime($date, $tz_from);
-      }
-      elseif ($dt_errors['warning_count'] && array_intersect($dt_errors['warnings'], ['The parsed date was invalid'])) {
-        throw new Exception('The parsed date was invalid');
-      }
-
-      $date_object->setTimezone($tz_to);
-
-      return $date_object->format($format);
-    }
-    catch (Exception $e) {
-      if ($dt_errors['error_count'] || $dt_errors['warning_count']) {
-        throw new CRM_Core_Exception(ts(
-          'Failed to parse date with %1 errors and %2 warnings',
-          [
-            '%1' => $dt_errors['error_count'],
-            '%2' => $dt_errors['warning_count'],
-          ]
-        ), 0, ['format' => $format, 'date' => $date] + $dt_errors);
-      }
-      else {
-        throw $e;
-      }
-    }
-  }
-
 }
index e58d8752a41a63c266ff445f04f30e94c7572388..d6c331cc47bcadeda7c9df9d2beb2d0411e625ad 100644 (file)
@@ -31,8 +31,6 @@ class EventCreationSpecProvider implements Generic\SpecProviderInterface {
       ->setTitle('Template Id')
       ->setDescription('Template on which to base this new event');
     $spec->addFieldSpec($template_id);
-
-    $spec->getFieldByName('event_tz')->setDefaultValue(\CRM_Core_Config::singleton()->userSystem->getTimeZoneString());
   }
 
   /**
index c10266c680d75667f71eaabecce8560b95cb9b16..f20d6702cf81ec2e303c415261e4a4ae73c86659 100644 (file)
@@ -59,7 +59,6 @@ function _civicrm_api3_event_create_spec(&$params) {
   $params['is_active']['api.default'] = 1;
   $params['financial_type_id']['api.aliases'] = ['contribution_type_id'];
   $params['is_template']['api.default'] = 0;
-  $params['event_tz']['api.default'] = CRM_Core_Config::singleton()->userSystem->getTimeZoneString();
 }
 
 /**
@@ -262,15 +261,3 @@ function _civicrm_api3_event_getlist_output($result, $request) {
   }
   return $output;
 }
-
-/**
- * Add missing timezones to all events.
- *
- * @return array
- */
-function civicrm_api3_event_addmissingtimezones($params) {
-  $defaultTZ = CRM_Core_Config::singleton()->userSystem->getTimeZoneString();
-
-  CRM_Core_DAO::executeQuery('UPDATE civicrm_event SET event_tz = %1 WHERE event_tz IS NULL OR event_tz = ""', [1 => [$defaultTZ, 'String']]);
-  return civicrm_api3_create_success($events, $params, 'Event', 'addMissingTimezones');
-}
index ab15f5e1c07ed46e0aefaf195644f8fdfa2b0646..f38502d5adf5f9c895a6dfdb22b8260b61dd0ef0 100644 (file)
@@ -24,15 +24,15 @@ CATEGORIES:{$event.event_type|crmICalText}
 {/if}
 CALSCALE:GREGORIAN
 {if $event.start_date}
-DTSTAMP;TZID={$event.tz|default:$timezone}:{$event.start_date|crmICalDate}
-DTSTART;TZID={$event.tz|default:$timezone}:{$event.start_date|crmICalDate}
+DTSTAMP;TZID={$timezone}:{$event.start_date|crmICalDate}
+DTSTART;TZID={$timezone}:{$event.start_date|crmICalDate}
 {else}
 DTSTAMP;TZID={$timezone}:{$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'|crmICalDate}
 {/if}
 {if $event.end_date}
-DTEND;TZID={$event.tz|default:$timezone}:{$event.end_date|crmICalDate}
+DTEND;TZID={$timezone}:{$event.end_date|crmICalDate}
 {else}
-DTEND;TZID={$event.tz|default:$timezone}:{$event.start_date|crmICalDate}
+DTEND;TZID={$timezone}:{$event.start_date|crmICalDate}
 {/if}
 {if $event.is_show_location EQ 1 && $event.location}
 LOCATION:{$event.location|crmICalText}
index 1877ae26ad38fa2f82d7a64af1d01d85526e452f..5bb6b6a706d5bd1d22fb07352842a34fee2412a1 100644 (file)
       <td class="label">{$form.description.label} {if $action == 2}{include file='CRM/Core/I18n/Dialog.tpl' table='civicrm_event' field='description' id=$eventID}{/if}</td>
       <td>{$form.description.html}</td>
     </tr>
-    <tr class="crm-event-manage-eventinfo-form-block-event_tz">
-      <td class="label">{$form.event_tz.label}</td>
-      <td>{$form.event_tz.html}</td>
-    </tr>
     {if !$isTemplate}
       <tr class="crm-event-manage-eventinfo-form-block-start_date">
         <td class="label">{$form.start_date.label}</td>
index 9c62e3742d11f645703871bd27d335c0fd3ef19b..c3db65bb90d1d8a47ff62dd04af838b59e86aee0 100644 (file)
     <td>{$form.registration_link_text.html} {help id="id-link_text"}</td>
   </tr>
   {if !$isTemplate}
-    <div class="description">{ts 1=$event_tz}{/ts}</td>
-    <tr class="crm-event-manage-registration-form-block-event_tz">
-      <td scope="row" class="label" width="20%"></td>
-      <td><div class="description">{ts 1=$event_tz}Registration start and end dates must be specified in the Event's timezone, %1{/ts}</td>
-    </tr>
     <tr class="crm-event-manage-registration-form-block-registration_start_date">
       <td scope="row" class="label" width="20%">{$form.registration_start_date.label}</td>
       <td>{$form.registration_start_date.html}</td>
index f77f5dc5f69a6ecfda3645db707a105e1aa7331e..8a0486b4c22ce784fc9a7fd9c16a314c0e304105 100644 (file)
     {/if}
     </td>
   </tr>
-  <tr class="crm-section event_date_time-section">
-      <td class="label">{ts}Event Start{/ts}</td>
-      <td class="content">
-          <time datetime="{$event.event_start_date_utc|date_format:"%Y-%m-%dT%H:%M:%S"}Z">{$event.event_start_date|crmDate}<span class="timezone"> {$event.event_tz}</span></time>
-      </td>
-  </tr>
-  {if $event.event_end_date}
-  <tr class="crm-section event_date_time-section">
-      <td class="label">{ts}Event End{/ts}</td>
-      <td class="content">
-          <time datetime="{$event.event_end_date_utc|date_format:"%Y-%m-%dT%H:%M:%S"}Z">{strip}
-          {* Only show end time if end date = start date *}
-          {if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}
-              {$event.event_end_date|crmDate:0:1}
-          {else}
-              {$event.event_end_date|crmDate}
-          {/if}
-          {/strip}<span class="timezone"> {$event.event_tz}</span></time>
+  <tr><td>{ts}When{/ts}</td>
+      <td width="90%">
+        {$event.event_start_date|crmDate}
+        {if $event.event_end_date}
+            &nbsp; {ts}through{/ts} &nbsp;
+            {* Only show end time if end date = start date *}
+            {if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}
+                {$event.event_end_date|crmDate:0:1}
+            {else}
+                {$event.event_end_date|crmDate}
+            {/if}
+        {/if}
       </td>
   </tr>
-  {/if}
 
   {if $isShowLocation}
     {if $location.address.1}
index 5d33dca43d3b68d528d7d0c9730ebb8a21b79fa8..36bb493cccfbbf50e4420544c4382d1d47b5c7cd 100644 (file)
   {/if}
   <div class="clear"></div>
   <div class="crm-section event_date_time-section">
-      <div class="label">{ts}Event Start{/ts}</div>
+      <div class="label">{ts}When{/ts}</div>
       <div class="content">
-          <time datetime="{$event.event_start_date_utc|date_format:"%Y-%m-%dT%H:%M:%S"}Z">{$event.event_start_date|crmDate}<span class="timezone"> {$event.event_tz}</span></time>
-      </div>
-    <div class="clear"></div>
-  </div>
-  {if $event.event_end_date}
-  <div class="crm-section event_date_time-section">
-      <div class="label">{ts}Event End{/ts}</div>
-      <div class="content">
-          <time datetime="{$event.event_end_date_utc|date_format:"%Y-%m-%dT%H:%M:%S"}Z">{strip}
-          {* Only show end time if end date = start date *}
-          {if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}
-              {$event.event_end_date|crmDate:0:1}
-          {else}
-              {$event.event_end_date|crmDate}
-          {/if}
-          {/strip}<span class="timezone"> {$event.event_tz}</span></time>
-      {/if}
+        {strip}
+            {$event.event_start_date|crmDate}
+            {if $event.event_end_date}
+                &nbsp;{ts}through{/ts}&nbsp;
+                {* Only show end time if end date = start date *}
+                {if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}
+                    {$event.event_end_date|crmDate:0:1}
+                {else}
+                    {$event.event_end_date|crmDate}
+                {/if}
+            {/if}
+        {/strip}
       </div>
     <div class="clear"></div>
   </div>
index 5db5103dbbfeda53c1360233bcbdc66a48d8d26a..50da60fd8b6d9caf50469bf443b98ad9379cbd1a 100644 (file)
         <td><a href="{crmURL p='civicrm/event/info' q="reset=1&id=`$event.event_id`"}" title="{ts}read more{/ts}"><strong>{$event.title}</strong></a></td>
         <td>{if $event.summary}{$event.summary|purify} (<a href="{crmURL p='civicrm/event/info' q="reset=1&id=`$event.event_id`"}" title="{ts}details...{/ts}">{ts}read more{/ts}...</a>){else}&nbsp;{/if}</td>
         <td class="nowrap" data-order="{$event.start_date|crmDate:'%Y-%m-%d'}">
-          {if $event.start_date}<time datetime="{$event.start_date_utc|date_format:"%Y-%m-%dT%H:%M:%S"}Z">{$event.start_date|crmDate}{if !$event.end_date}<span class="timezone"> {$event.tz}</span>{/if}</time>{if $event.end_date}<br /><em>{ts}through{/ts}</em><br /><time datetime="{$event.end_date_utc|date_format:"%Y-%m-%dT%H:%M:%S"}Z">{strip}
+          {if $event.start_date}{$event.start_date|crmDate}{if $event.end_date}<br /><em>{ts}through{/ts}</em><br />{strip}
             {* Only show end time if end date = start date *}
             {if $event.end_date|date_format:"%Y%m%d" == $event.start_date|date_format:"%Y%m%d"}
-                {$event.end_date|crmDate:0:1}
+              {$event.end_date|crmDate:0:1}
             {else}
-                {$event.end_date|crmDate}
-            {/if}
-          {/strip}<span class="timezone"> {$event.tz}</span></time>
-{/if}
+              {$event.end_date|crmDate}
+            {/if}{/strip}{/if}
           {else}{ts}(not available){/ts}{/if}
         </td>
         <td>{if $event.is_show_location EQ 1 AND $event.location}{$event.location}{else}{ts}(not available){/ts}{/if}</td>
index 124ba7f13f9f2b75c808e3dd8cbfcf8dd251f96f..f0dbdea85c52fb52103ce8a64b9a6c312d0ecad2 100644 (file)
@@ -62,8 +62,8 @@
           <td class="crm-event-state_province">{$row.state_province}</td>
           <td class="crm-event-event_type">{$row.event_type}</td>
           <td class="crm-event-is_public">{if $row.is_public eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
-          <td class="crm-event-start_date" data-order="{$row.start_date|crmDate:'%Y-%m-%d %H:%M'}">{$row.start_date|crmDate:"%b %d, %Y %l:%M %P"}{if $row.start_date_with_tz}<br />{$row.start_date_with_tz|crmDate:"%b %d, %Y %l:%M %P"} {$row.event_tz}{elseif !$row.event_tz} <span class="error-message">{ts 1='<i class="crm-i fa-warning"></i>'}%1 No timezone set{/ts}</span>{/if}</td>
-          <td class="crm-event-end_date" data-order="{$row.end_date|crmDate:'%Y-%m-%d %H:%M'}">{$row.end_date|crmDate:"%b %d, %Y %l:%M %P"}{if $row.end_date_with_tz}<br />{$row.end_date_with_tz|crmDate:"%b %d, %Y %l:%M %P"} {$row.event_tz}{/if}</td>
+          <td class="crm-event-start_date" data-order="{$row.start_date|crmDate:'%Y-%m-%d'}">{$row.start_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
+          <td class="crm-event-end_date" data-order="{$row.end_date|crmDate:'%Y-%m-%d'}">{$row.end_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
           {if call_user_func(array('CRM_Campaign_BAO_Campaign','isCampaignEnable'))}
             <td class="crm-event-campaign">{$row.campaign}</td>
           {/if}
diff --git a/tests/phpunit/CRM/Event/Form/ManageEvent/EventInfoTest.php b/tests/phpunit/CRM/Event/Form/ManageEvent/EventInfoTest.php
deleted file mode 100644 (file)
index 942a6ab..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-use Civi\Api4\Event;
-
-class CRM_Event_Form_ManageEvent_EventInfoTest extends CiviUnitTestCase {
-
-  public function preventCiviExit($event) {
-    if (is_a($event->form, 'CRM_Event_Form_ManageEvent_EventInfo')) {
-      // EventInfo form redirects to the location form if the action is ADD
-      $event->form->setAction(CRM_Core_Action::NONE);
-    }
-  }
-
-  public function testTimeZone() {
-    $formValues = [
-      'start_date' => '2022-06-22 12:00:00',
-      'end_date' => '2022-06-22 20:00:00',
-      'event_tz' => 'Australia/Sydney',
-    ];
-
-    Civi::dispatcher()->addListener('hook_civicrm_postProcess', [$this, 'preventCiviExit']);
-
-    $event_id = $this->submitForm($formValues);
-
-    $this->assertIsInt($event_id, 'Event creation success');
-
-    Civi::dispatcher()->removeListener('hook_civicrm_postProcess', [$this, 'preventCiviExit']);
-
-    $event = Event::get(FALSE)
-      ->addWhere('id', '=', $event_id)
-      ->addSelect('id', 'start_date', 'end_date', 'event_tz')
-      ->execute()[0];
-
-    $this->assertEquals('2022-06-22 02:00:00', $event['start_date'], 'Event start date resolved by timezone.');
-    $this->assertEquals('2022-06-22 10:00:00', $event['end_date'], 'Event end date resolved by timezone.');
-  }
-
-  public function getFormValues() {
-    if (empty(Civi::$statics[__CLASS__])) {
-      Civi::$statics[__CLASS__] = $this->eventCreate();
-      Civi::$statics[__CLASS__]['id'] = NULL;
-    }
-
-    return Civi::$statics[__CLASS__];
-  }
-
-  public function submitForm(array $formValues, ?int $eventID = NULL): int {
-    $form = $this->getFormObject(CRM_Event_Form_ManageEvent_EventInfo::class, array_merge($this->getFormValues(), $formValues));
-    if ($eventID) {
-      $form->set('id', $eventID);
-    }
-
-    $form->preProcess();
-    $form->buildQuickForm();
-    $form->postProcess();
-    return $form->get('id');
-  }
-
-}
diff --git a/tests/phpunit/CRM/Event/Form/ManageEvent/RegistrationTest.php b/tests/phpunit/CRM/Event/Form/ManageEvent/RegistrationTest.php
deleted file mode 100644 (file)
index 44a3f26..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-use Civi\Api4\Event;
-
-class CRM_Event_Form_ManageEvent_RegistrationTest extends CiviUnitTestCase {
-
-  public function preventCiviExit($event) {
-    if (is_a($event->form, 'CRM_Event_Form_ManageEvent_Registration')) {
-      // EventInfo form redirects to the location form if the action is ADD
-      $event->form->setAction(CRM_Core_Action::NONE);
-    }
-  }
-
-  public function testTimeZone() {
-    $event_id = $this->eventCreate([
-      'event_tz' => 'Australia/Sydney',
-      'start_date' => '2022-06-22 12:00:00',
-      'end_date' => '2022-06-22 20:00:00',
-    ])['id'];
-
-    $formValues = [
-      'registration_start_date' => '2022-05-23 09:00:00',
-      'registration_end_date' => '2022-06-20 17:00:00',
-    ];
-
-    Civi::dispatcher()->addListener('hook_civicrm_postProcess', [$this, 'preventCiviExit']);
-
-    $this->submitForm($formValues, $event_id);
-
-    $this->assertIsInt($event_id, 'Event creation success');
-
-    Civi::dispatcher()->removeListener('hook_civicrm_postProcess', [$this, 'preventCiviExit']);
-
-    $event = Event::get(FALSE)
-      ->addWhere('id', '=', $event_id)
-      ->addSelect('id', 'registration_start_date', 'registration_end_date', 'event_tz')
-      ->execute()[0];
-
-    $this->assertEquals('2022-05-22 23:00:00', $event['registration_start_date'], 'Registration start date resolved by timezone.');
-    $this->assertEquals('2022-06-20 07:00:00', $event['registration_end_date'], 'Registration end date resolved by timezone.');
-
-  }
-
-  public function submitForm(array $formValues, int $eventID): int {
-    $form = $this->getFormObject(CRM_Event_Form_ManageEvent_Registration::class, $formValues);
-    if ($eventID) {
-      $form->set('id', $eventID);
-    }
-
-    $form->preProcess();
-    $form->buildQuickForm();
-    $form->postProcess();
-    return $form->get('id');
-  }
-
-}
index 9f17b773223cccbc6a1241c8b3249a7438aeeecd..b0917741ef2837e9df9f81fbc30034b5047d4cdd 100644 (file)
@@ -324,26 +324,4 @@ class CRM_Utils_DateTest extends CiviUnitTestCase {
     }
   }
 
-  /**
-   * Test timezone conversion function
-   */
-  public function testConvertTimeZone() {
-    $tests = [
-      [['1970-01-01 00:00:00', 'Atlantic/Azores', 'UTC'], '1969-12-31 23:00:00'],
-      [['1970-01-01 00:00:00', 'Europe/Berlin'], '1970-01-01 01:00:00'],
-      [['2022-06-22 12:00:00', 'Atlantic/Azores'], '2022-06-22 12:00:00'],
-      [['2022-06-22 12:00:00', 'Europe/Berlin', 'UTC'], '2022-06-22 14:00:00'],
-      [['2022-06-22 12:00:00', 'Europe/Berlin', 'Australia/Sydney'], '2022-06-22 04:00:00'],
-    ];
-
-    foreach ($tests as $i => [$params, $result]) {
-      $this->assertEquals($result, CRM_Utils_Date::convertTimeZone(...$params), "convertTimeZone $i");
-    }
-
-    //0000-00-00 00:00:00 is not an actual time, so we should expect an exception.
-    $this->expectException(CRM_Core_Exception::class);
-    $this->expectExceptionMessageMatches('{^Failed to parse date}');
-    CRM_Utils_Date::convertTimeZone('0000-00-00 00:00:00', 'Europe/Berlin');
-  }
-
 }
index 0f625f4dd7993d91b22d265bf033b52618291979..14738efaef1eb37252d3dd661fe368e2f2470bad 100644 (file)
@@ -608,7 +608,6 @@ participant.must_wait :
 event.title :Annual CiviCRM meet
 event.start_date :October 21st, 2008
 event.end_date :October 23rd, 2008
-event.event_tz:label :America/New York
 event.event_type_id:label :Conference
 event.summary :If you have any CiviCRM related issues or want to track where CiviCRM is heading, Sign up now
 event.contact_email :event@example.com
@@ -895,7 +894,6 @@ December 21st, 2007
       '{event.title}' => 'Event Title',
       '{event.start_date}' => 'Event Start Date',
       '{event.end_date}' => 'Event End Date',
-      '{event.event_tz:label}' => 'Event Time Zone',
       '{event.event_type_id:label}' => 'Event Type',
       '{event.summary}' => 'Event Summary',
       '{event.contact_email}' => 'Event Contact Email',
@@ -956,7 +954,6 @@ December 21st, 2007
       'description' => 'event description',
       $this->getCustomFieldName('text') => 'my field',
       'loc_block_id' => $locationBlockID,
-      'event_tz' => 'America/New_York',
     ])['id'];
     // Create an unrelated participant record so that the ids don't match.
     // this prevents things working just because the id 'happens to be valid'
index e1a32c3bc2753422f2feb7b7dc40b3a9c267303a..0b5bf5597c0779296263ea6df8b4b7ad676acc00 100644 (file)
@@ -30,7 +30,7 @@
   ],
   "Event": [
     {
-      "start_date": "20371010000000",
+      "start_date": "20401010000000",
       "title": "The Singularity",
       "event_type_id": "major_historical_event"
     }
index 067a3a528cce1df450a7f557b57c7cda618a8a10..a90b01446b2241b0762807c83c183e4fc2fb4ebe 100644 (file)
   </field>
   <field>
     <name>start_date</name>
-    <type>timestamp</type>
+    <type>datetime</type>
     <uniqueName>event_start_date</uniqueName>
     <title>Event Start Date</title>
     <headerPattern>/^start|(s(tart\s)?date)$/i</headerPattern>
     <import>true</import>
     <comment>Date and time that event starts.</comment>
     <add>1.7</add>
-    <required>false</required>
-    <default>NULL</default>
     <html>
       <type>Select Date</type>
       <formatType>activityDateTime</formatType>
   </field>
   <field>
     <name>end_date</name>
-    <type>timestamp</type>
+    <type>datetime</type>
     <uniqueName>event_end_date</uniqueName>
     <title>Event End Date</title>
     <headerPattern>/^end|(e(nd\s)?date)$/i</headerPattern>
     <import>true</import>
     <comment>Date and time that event ends. May be NULL if no defined end date/time</comment>
     <add>1.7</add>
-    <required>false</required>
-    <default>NULL</default>
     <html>
       <type>Select Date</type>
       <formatType>activityDateTime</formatType>
   </field>
   <field>
     <name>registration_start_date</name>
-    <type>timestamp</type>
+    <type>datetime</type>
     <comment>Date and time that online registration starts.</comment>
     <add>1.8</add>
-    <required>false</required>
-    <default>NULL</default>
     <html>
       <type>Select Date</type>
       <formatType>activityDateTime</formatType>
   </field>
   <field>
     <name>registration_end_date</name>
-    <type>timestamp</type>
+    <type>datetime</type>
     <comment>Date and time that online registration ends.</comment>
     <add>1.8</add>
-    <required>false</required>
-    <default>NULL</default>
     <html>
       <type>Select Date</type>
       <formatType>activityDateTime</formatType>
       <type>CheckBox</type>
     </html>
   </field>
-  <field>
-    <name>event_tz</name>
-    <type>text</type>
-    <uniqueName>event_tz</uniqueName>
-    <title>Event Time Zone</title>
-    <import>true</import>
-    <comment>Event's native time zone</comment>
-    <add>5.47</add>
-    <default>NULL</default>
-    <html>
-      <type>Select</type>
-    </html>
-    <pseudoconstant>
-      <callback>CRM_Core_SelectValues::timezone</callback>
-    </pseudoconstant>
-  </field>
 </table>
index 2554ff679842967ebbd435d86016ec6f0fcc335b..69fae2eb5590c09005d29c795872c7be781da354 100644 (file)
@@ -53,7 +53,7 @@
      <tr>
       <td colspan="2" {$valueStyle}>
        {$event.event_title}<br />
-       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
       </td>
      </tr>
 
index 81ce8dca5aca6a8acab87d1e7389d122044f38d6..adaf9096540c15a03ab2251e9012c7eea15ef502 100644 (file)
@@ -42,7 +42,7 @@
 ==========================================================={if !empty($pricesetFieldsCount) }===================={/if}
 
 {$event.event_title}
-{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
 
 {if !empty($event.participant_role) and $event.participant_role neq 'Attendee' and empty($defaultRole)}
 {ts}Participant Role{/ts}: {$event.participant_role}
index 1b416a8072fecbf1ab2d679aa2f4a68fae3af320..7b771d41b18000cf2d36a7bd3e3d635d83d0bdb4 100644 (file)
@@ -64,7 +64,7 @@
      <tr>
       <td colspan="2" {$valueStyle}>
        {$event.event_title}<br />
-       {$event.event_start_date|date_format:"%A"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+       {$event.event_start_date|date_format:"%A"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if}
       </td>
      </tr>
 
index affb31472b2fbd51361f023111c8857b208fbeeb..22473002a288de1a1049394235990d21c21250ad 100644 (file)
@@ -47,7 +47,7 @@
 ==========================================================={if !empty($pricesetFieldsCount)}===================={/if}
 
 {$event.event_title}
-{$event.event_start_date|date_format:"%A"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+{$event.event_start_date|date_format:"%A"} {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|date_format:"%A"} {$event.event_end_date|crmDate}{/if}{/if}
 {if !empty($conference_sessions)}
 
 
index 24637e0922405b25d4456bfd7bdbcaff003cc1c8..c0da77d4d58ad211d1d76ce97ee60579bf6adce1 100644 (file)
@@ -35,7 +35,7 @@
      <tr>
       <td colspan="2" {$valueStyle}>
        {$event.event_title}<br />
-       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|crmDate:"shortdate" == $event.event_start_date|crmDate:"shortdate"}{$event.event_end_date|crmDate:"Time"}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|crmDate:"shortdate" == $event.event_start_date|crmDate:"shortdate"}{$event.event_end_date|crmDate:"Time"}{else}{$event.event_end_date|crmDate}{/if}{/if}
       </td>
      </tr>
      <tr>
index b60ce46af667d9230b210ad810f0dac28f2a81e7..dedf895d880261c852be0c30ad74a739da0205a9 100644 (file)
@@ -8,7 +8,7 @@
 
 ===========================================================
 {$event.event_title}
-{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|crmDate:"shortdate" == $event.event_start_date|crmDate:"shortdate"}{$event.event_end_date|crmDate:"Time"}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|crmDate:"shortdate" == $event.event_start_date|crmDate:"shortdate"}{$event.event_end_date|crmDate:"Time"}{else}{$event.event_end_date|crmDate}{/if}{/if}
 
 {ts}Participant Role{/ts}: {participant.role_id:label}
 
index 7b7d04b1755e8c1e63a2023e8da2b531ffe2087c..bd8b599b166a02a75c57643da60080a98d6ff63d 100644 (file)
@@ -53,7 +53,7 @@
      <tr>
       <td colspan="2" {$valueStyle}>
        {$event.event_title}<br />
-       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
       </td>
      </tr>
      {if $conference_sessions}
index 3d685d4944549791e482099915ed922ccc5443af..0ccf6ad260524621d887dee3c36af9c5acd0e443 100644 (file)
@@ -22,7 +22,7 @@ Click this link to go to a web page where you can confirm your registration onli
 
 ===========================================================
 {$event.event_title}
-{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
 {if $conference_sessions}
 
 
index 2a7edf991de0ef4591efc6201e5cfa6204da0489..57804d1429d0c411178e33c543723de3cc1b0090 100644 (file)
@@ -38,7 +38,7 @@ or want to inquire about reinstating your registration for this event.{/ts}</p>
      <tr>
       <td colspan="2" {$valueStyle}>
        {$event.event_title}<br />
-       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
       </td>
      </tr>
      <tr>
index b9fdd3f217eccffdb9b00c9d4de56136eadfe768..e6ec27f026105d71b9777d197f7fc6f10d430f97 100644 (file)
@@ -12,7 +12,7 @@ or want to inquire about reinstating your registration for this event.{/ts}
 
 ===========================================================
 {$event.event_title}
-{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
 
 {ts}Participant Role{/ts}: {$participant.role}
 
index 22520519f7c7d681e557fdf6d68d3916aa2c1067..a5e2b927a74ec83221621020229b59c95fb689fe 100644 (file)
@@ -35,7 +35,7 @@
      <tr>
       <td colspan="2" {$valueStyle}>
        {$event.event_title}<br />
-       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+       {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
       </td>
      </tr>
      <tr>
index 87c9bb3225bb5f25e437eb19f7a195f7564d4311..5c62b00570f5b2b7531d1ac01307170dab876ebf 100644 (file)
@@ -7,7 +7,7 @@
 
 ===========================================================
 {$event.event_title}
-{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
 
 {ts}Participant Role{/ts}: {$participant.role}
 
index 8690a759b8cd89a420a17b73714505c579b5f354..d1d5983faabc95c1a60e72aa85abc228381115ff 100644 (file)
     <tr>
       <td colspan="2" {$valueStyle}>
          {$event.event_title}<br />
-        {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+        {$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
       </td>
     </tr>
 
index 649e088e11560ffaea18356748d3263035af9daa..3499b2f9f63c453fbe5de4fde0a3d5a645ed030b 100644 (file)
@@ -90,7 +90,7 @@
 ===============================================================================
 
 {$event.event_title}
-{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if} {$event.event_tz}
+{$event.event_start_date|crmDate}{if $event.event_end_date}-{if $event.event_end_date|date_format:"%Y%m%d" == $event.event_start_date|date_format:"%Y%m%d"}{$event.event_end_date|crmDate:0:1}{else}{$event.event_end_date|crmDate}{/if}{/if}
 
 {if !empty($event.participant_role)}
 {ts}Participant Role{/ts}: {$event.participant_role}