PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 2.5.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v2.5.0
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
← All changes | app/Hooks/Handlers/GlobalNotificationHandler.php +16 -7 1.5.24 → 2.5.0 View file →
@@ -46,19 +46,24 @@
46 46
47 47 add_action('fluent_booking/after_booking_scheduled', [$this, 'maybeHandleGlobalIntegration'], 10, 2);
48 48 add_action('fluent_booking/booking_schedule_cancelled', [$this, 'maybeHandleGlobalIntegration'], 10, 2);
49 49 add_action('fluent_booking/booking_schedule_completed', [$this, 'maybeHandleGlobalIntegration'], 10, 2);
50 -
50 + add_action('fluent_booking/booking_schedule_rejected', [$this, 'maybeHandleGlobalIntegration'], 10, 2);
51 + add_action('fluent_booking/booking_schedule_no_show', [$this, 'maybeHandleGlobalIntegration'], 10, 2);
52 + add_action('fluent_booking/after_booking_rescheduled', [$this, 'checkGlobalIntegration'], 10, 3);
51 53 }
52 54
53 - public function maybeHandleGlobalIntegration($booking, $calendarSlot)
55 + public function maybeHandleGlobalIntegration($booking, $calendarSlot, $status = null)
54 56 {
55 - $status = $booking->status;
57 + $status = $status ?: $booking->status;
56 58
57 59 $maps = [
58 - 'scheduled' => 'after_booking_scheduled',
59 - 'cancelled' => 'booking_schedule_cancelled',
60 - 'completed' => 'booking_schedule_completed'
60 + 'scheduled' => 'after_booking_scheduled',
61 + 'cancelled' => 'booking_schedule_cancelled',
62 + 'completed' => 'booking_schedule_completed',
63 + 'rescheduled' => 'after_booking_rescheduled',
64 + 'rejected' => 'booking_schedule_rejected',
65 + 'no_show' => 'booking_schedule_no_show',
61 66 ];
62 67
63 68 if (!isset($maps[$status])) {
64 69 return false;
@@ -89,9 +94,8 @@
89 94 }
90 95
91 96 // Now we have to filter the feeds which are enabled
92 97 $enabledFeeds = $this->globalNotificationService->getEnabledFeeds($feeds, $booking);
93 -
94 98 if (!$enabledFeeds) {
95 99 return false;
96 100 }
97 101
@@ -121,6 +125,11 @@
121 125 }
122 126 }
123 127
124 128 return true;
129 + }
130 +
131 + public function checkGlobalIntegration($booking, $oldBooking, $calendarEvent)
132 + {
133 + return $this->maybeHandleGlobalIntegration($booking, $calendarEvent, 'rescheduled');
125 134 }
126 135 }