PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / trunk
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution vtrunk
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 1.7.2 All 33 releases
← All changes | app/Services/CalendarEventService.php +14 -2 1.5.21trunk View file →
@@ -2,8 +2,9 @@
2 2
3 3 namespace FluentBooking\App\Services;
4 4
5 5 use FluentBooking\App\Models\Calendar;
6 +use FluentBooking\Framework\Support\Arr;
6 7
7 8 class CalendarEventService
8 9 {
9 10 public static function processEvent($calendarEvent)
@@ -15,10 +16,8 @@
15 16 $calendarEvent->durations = $calendarEvent->getAvailableDurations();
16 17
17 18 $calendarEvent->description = $calendarEvent->getDescription();
18 19
19 - $calendarEvent->short_description = Helper::excerpt($calendarEvent->description);
20 -
21 20 $calendarEvent->locations = $calendarEvent->defaultLocationHtml();
22 21
23 22 do_action_ref_array('fluent_booking/processed_event', [&$calendarEvent]);
24 23
@@ -39,6 +38,19 @@
39 38 $calendarEvent = self::processEvent($calendarEvent);
40 39 }
41 40
42 41 return $calendarEvents;
42 + }
43 +
44 + public static function isSharedCalendarEvent($calendarEvent)
45 + {
46 + $userId = get_current_user_id();
47 +
48 + if ($calendarEvent->user_id == $userId) {
49 + return true;
50 + }
51 +
52 + $teamMembers = Arr::get($calendarEvent, 'settings.team_members', []);
53 +
54 + return in_array($userId, $teamMembers);
43 55 }
44 56 }