Merge pull request #23075 from civicrm/5.48
[civicrm-core.git] / CRM / Event / Form / Participant.php
index e99eb186dfedc7c78a3ace5d54c52561da92cabb..61ee14ca0406c5a368932d298fdbbb6913ac7fb5 100644 (file)
@@ -1499,7 +1499,6 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
                 }
               }
             }
-            $this->assign('totalTaxAmount', $totalTaxAmount);
             $this->assign('taxTerm', $this->getSalesTaxTerm());
             $this->assign('dataArray', $dataArray);
           }
@@ -1516,13 +1515,16 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
           $eventAmount = array_merge($eventAmount, $additionalParticipantDetails);
           $this->assign('amount', $eventAmount);
         }
-
+        $this->assign('totalTaxAmount', $totalTaxAmount ?? 0);
         $sendTemplateParams = [
-          'groupName' => 'msg_tpl_workflow_event',
-          'valueName' => 'event_offline_receipt',
+          'workflow' => 'event_offline_receipt',
           'contactId' => $contactID,
           'isTest' => !empty($this->_defaultValues['is_test']),
           'PDFFilename' => ts('confirmation') . '.pdf',
+          'modelProps' => [
+            'participantID' => $this->_id,
+            'eventID' => $params['event_id'],
+          ],
         ];
 
         // try to send emails only if email id is present
@@ -1892,7 +1894,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 +1902,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)) {