some data in msgraph synchro and answer on calendar invite

This commit is contained in:
2022-05-26 19:25:59 +02:00
parent 59a64e9a62
commit 7c0bdc5abe
7 changed files with 433 additions and 257 deletions

View File

@@ -21,7 +21,6 @@ use DateTimeImmutable;
use DateTimeZone;
use Symfony\Component\Templating\EngineInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Environment;
/**
* Convert Chill Calendar event to Remote MS Graph event, and MS Graph
@@ -35,14 +34,14 @@ class RemoteEventConverter
private DateTimeZone $defaultDateTimeZone;
private EngineInterface $engine;
private PersonRenderInterface $personRender;
private DateTimeZone $remoteDateTimeZone;
private TranslatorInterface $translator;
private EngineInterface $engine;
public function __construct(EngineInterface $engine, PersonRenderInterface $personRender, TranslatorInterface $translator)
{
$this->engine = $engine;
@@ -112,7 +111,7 @@ class RemoteEventConverter
'@ChillCalendar/MSGraph/calendar_event_body.html.twig',
['calendar' => $calendar]
),
]
],
],
$this->calendarToEventAttendeesOnly($calendar)
);
@@ -129,17 +128,6 @@ class RemoteEventConverter
];
}
private function buildInviteToAttendee(Invite $invite): array
{
return [
'emailAddress' => [
'address' => $invite->getUser()->getEmail(),
'name' => $invite->getUser()->getLabel(),
],
'type' => 'Required',
];
}
public function convertAvailabilityToRemoteEvent(array $event): RemoteEvent
{
$startDate =
@@ -193,4 +181,15 @@ class RemoteEventConverter
{
return new DateTimeZone('UTC');
}
private function buildInviteToAttendee(Invite $invite): array
{
return [
'emailAddress' => [
'address' => $invite->getUser()->getEmail(),
'name' => $invite->getUser()->getLabel(),
],
'type' => 'Required',
];
}
}