Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Guten Morgen zusammen,

ich bin schon seit länger Zeit auf der Suche, nach einer brauchen Lösung / einem Beispiel für die Terminverwaltung eines iClouds ODER Google Kalenders via PHP.
Würde mir gerne via PHP anzeigen lassen können, in welchen Zeiträumen ich keine Termine habe. Termine eintragen, ändern und löschen wäre dann der nächste Step.

Ich hoffe ihr könnt mich hierbei unterstützen, denn ich bin an der Thematik bereits seit Wochen dran und verzweifle.
 

  • Autor

Update:

Habe jetzt diese Variante entdeckt:

https://developers.google.com/calendar/quickstart/js

Diese klappt soweit ganz gut.
Autorisierung durch Google Konto erfolgt, und Termine werden angezeigt.
Allerdings würde ich gerne die "freien Termine" sehen.

Dafür habe ich eine Google Api FreeBusy gefunden:
https://developers.google.com/calendar/v3/reference/freebusy/query

 

Leider fehlt hier ein Beispiel.
Kann mich dabei jemand unterstützen ? 

Prinzipiell kannst du ja sowohl für iCloud als auch für Google Calendar einen Link mit Lesezugriff generieren. Die ICS-Datei die du dort jeweils bekommst musst du halt auslesen (gibts Libraries für, notfalls selber machen, sonderlich komplex ist der ICS Standard nicht). Daraus kannst du dir dann ne Liste mit Terminen zusammen basteln bzw prüfen wann du welche hast und wann nicht

  • Autor

habe jetzt folgenden Code für die freebusy api:

 

<?php

require_once 'vendor/autoload.php';

$client = new Google_Client();
$client->setScopes('https://www.googleapis.com/auth/calendar');
$client->addScope(Google_Service_Calendar::CALENDAR);
$client->setDeveloperKey("API_KEY");	
	
$service = new Google_Service_Calendar($client);
$freebusy = new Google_Service_Calendar_FreeBusyRequest();
$freebusy->setTimeMin('2019-10-01T08:00:00.000-07:00');
$freebusy->setTimeMax('2019-10-31T10:00:00.000-07:00');
$freebusy->setTimeZone('Europe/Berlin');
$freebusy->setGroupExpansionMax(10);
$freebusy->setCalendarExpansionMax(10);
$mycalendars = array( array ("id"=>"primary") );
$freebusy->setItems($mycalendars);
$createdReq = $service->freebusy->query($freebusy);

echo '<pre>';
print_r($createdReq);
echo '</pre>';
?>

 

Als Antwort bekomme ich allerdings:

Google_Service_Calendar_FreeBusyResponse Object
(
    [calendarsType:protected] => Google_Service_Calendar_FreeBusyCalendar
    [calendarsDataType:protected] => map
    [groupsType:protected] => Google_Service_Calendar_FreeBusyGroup
    [groupsDataType:protected] => map
    [kind] => calendar#freeBusy
    [timeMax] => 2019-10-31T17:00:00.000Z
    [timeMin] => 2019-10-01T15:00:00.000Z
    [internal_gapi_mappings:protected] => Array
        (
        )

    [modelData:protected] => Array
        (
        )

    [processed:protected] => Array
        (
        )

    [calendars] => Array
        (
            [primary] => Google_Service_Calendar_FreeBusyCalendar Object
                (
                    [collection_key:protected] => errors
                    [busyType:protected] => Google_Service_Calendar_TimePeriod
                    [busyDataType:protected] => array
                    [errorsType:protected] => Google_Service_Calendar_Error
                    [errorsDataType:protected] => array
                    [internal_gapi_mappings:protected] => Array
                        (
                        )

                    [modelData:protected] => Array
                        (
                        )

                    [processed:protected] => Array
                        (
                        )

                    [errors] => Array
                        (
                            [0] => Google_Service_Calendar_Error Object
                                (
                                    [domain] => global
                                    [reason] => internalError
                                    [internal_gapi_mappings:protected] => Array
                                        (
                                        )

                                    [modelData:protected] => Array
                                        (
                                        )

                                    [processed:protected] => Array
                                        (
                                        )

                                )

                        )

                    [busy] => Array
                        (
                        )

                )

        )

)

 Was bedeutet für mich denn Error reason: internal error ?

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.