AddOn/Calender_Office365_User/calendar.php aktualisiert

This commit is contained in:
olinet 2025-09-07 11:08:15 +02:00
parent 72436d2e04
commit 7669859b06
1 changed files with 31 additions and 19 deletions

View File

@ -32,25 +32,37 @@ if (time() > ($data['time_saved'] + $data['expires_in'] - 60)) {
file_put_contents($config['token_storage'], json_encode($tokens, JSON_PRETTY_PRINT)); file_put_contents($config['token_storage'], json_encode($tokens, JSON_PRETTY_PRINT));
} }
// ➤ Beispiel: Termin anlegen // ➤ Beispiel: Termin anlegen
$event = [ if(isset($_GET['create'])){
"subject" => "Test-Meeting via PHP", $event = [
"start" => [ "subject" => "Test-Meeting via PHP",
"dateTime" => "2025-06-25T10:00:00", "start" => [
"timeZone" => "Europe/Berlin" "dateTime" => "2025-06-25T10:00:00",
], "timeZone" => "Europe/Berlin"
"end" => [ ],
"dateTime" => "2025-06-25T11:00:00", "end" => [
"timeZone" => "Europe/Berlin" "dateTime" => "2025-06-25T11:00:00",
], "timeZone" => "Europe/Berlin"
"body" => [ ],
"contentType" => "HTML", "body" => [
"content" => "Meeting von OutlookCalendar PHP" "contentType" => "HTML",
] "content" => "Meeting von OutlookCalendar PHP"
]; ]
];
$response = $calendar->createEvent($event); $response = $calendar->createEvent($event);
echo "<pre>"; echo "<pre>";
print_r($response); print_r($response);
echo "</pre>"; echo "</pre>";
echo "<hr/>";
}
$events = $calendar->getEvents(); // eigene Funktion in OutlookCalendar-Klasse
header('Content-Type: application/json');
echo json_encode($events, JSON_PRETTY_PRINT);
?>