← All changes
|
app/Services/Integrations/FluentForms/FluentFormInit.php
+5
-10
1.5.21
→
trunk
View file →
| @@ -13,8 +13,9 @@ | ||
| 13 | 13 | use FluentBooking\App\Hooks\Handlers\FrontEndHandler; |
| 14 | 14 | use FluentForm\App\Models\Submission; |
| 15 | 15 | use FluentForm\App\Modules\Form\FormFieldsParser; |
| 16 | 16 | use FluentForm\App\Services\FormBuilder\ShortCodeParser; |
| 17 | +use FluentBooking\App\Vite; | |
| 17 | 18 | |
| 18 | 19 | |
| 19 | 20 | class FluentFormInit |
| 20 | 21 | { |
| @@ -104,9 +105,9 @@ | ||
| 104 | 105 | |
| 105 | 106 | $timeSlotService = TimeSlotServiceHandler::initService($calendarEvent->calendar, $calendarEvent); |
| 106 | 107 | |
| 107 | 108 | if (is_wp_error($timeSlotService)) { |
| 108 | - return TimeSlotServiceHandler::sendError($timeSlotService, $calendarEvent, $timezone); | |
| 109 | + return TimeSlotServiceHandler::sendError($timeSlotService, $calendarEvent, $timeZone); | |
| 109 | 110 | } |
| 110 | 111 | |
| 111 | 112 | $availableSpot = $timeSlotService->isSpotAvailable($startDateTime, $endDateTime, $duration); |
| 112 | 113 | |
| @@ -114,9 +115,9 @@ | ||
| 114 | 115 | $message = __('This selected time slot is not available. Maybe someone booked the spot just a few seconds ago.', 'fluent-booking'); |
| 115 | 116 | wp_send_json(['errors' => [$message]], 422); |
| 116 | 117 | } |
| 117 | 118 | |
| 118 | - if ($calendarEvent->isTeamEvent()) { | |
| 119 | + if ($calendarEvent->isRoundRobin()) { | |
| 119 | 120 | $this->hostId = $timeSlotService->hostUserId; |
| 120 | 121 | } |
| 121 | 122 | |
| 122 | 123 | if (!is_user_logged_in()) { |
| @@ -383,18 +384,12 @@ | ||
| 383 | 384 | } |
| 384 | 385 | |
| 385 | 386 | [$localizeData, $elementId] = $this->getLocalizedData($calendarEvent, $field, $form); |
| 386 | 387 | |
| 387 | - wp_enqueue_script( | |
| 388 | - 'fluent_booking', | |
| 389 | - FLUENT_BOOKING_URL . 'assets/public/js/fluentform-conversational.js', | |
| 390 | - [], | |
| 391 | - FLUENT_BOOKING_ASSETS_VERSION, | |
| 392 | - true | |
| 393 | - ); | |
| 388 | + Vite::enqueueScript('fluent_booking', 'ff_conversational', [], FLUENT_BOOKING_ASSETS_VERSION); | |
| 394 | 389 | |
| 395 | 390 | if (BookingFieldService::hasPhoneNumberField($localizeData['form_fields'])) { |
| 396 | - wp_enqueue_script('fluent-booking-phone-field', FLUENT_BOOKING_URL . 'assets/public/js/phone-field.js', [], FLUENT_BOOKING_ASSETS_VERSION, true); | |
| 391 | + Vite::enqueueScript('fluent-booking-phone-field', 'phone_field', [], FLUENT_BOOKING_ASSETS_VERSION); | |
| 397 | 392 | $inlineStyle = '.fcal_phone_wrapper .flag { background: url(' . esc_url(FLUENT_BOOKING_URL . 'assets/images/flags_responsive.png') . ') no-repeat;background-size: 100%;}'; |
| 398 | 393 | wp_add_inline_style('fluent-booking-phone-field', $inlineStyle); |
| 399 | 394 | } |
| 400 | 395 | |