I've created this temporary Google Calendar user:
name: [EMAIL PROTECTED]
password: abrakadabra

I've adjusted my script and run it with the same result. But this time
you can give it a try for yourself.
(Can add the event, can list the event but can't delete the event...)

Please try to run it on your side as well and let me know if it works
for you.

regards,
Gabor

<?php
        header("Content-type: text/html; charset=utf-8");

        //add Zend classes to path
        $include_path = ini_get ( "include_path" );
        ini_set("include_path",$include_path." .:/home/gkovacsp/scripts");


        $calendarID =
"[EMAIL PROTECTED]";
        $calendarURL="http://www.google.com/calendar/feeds/".$calendarID."/
private/full";

        require_once '../../scripts/Zend/Loader.php';
        Zend_Loader::loadClass('Zend_Gdata');
        Zend_Loader::loadClass('Zend_Gdata_AuthSub');
        Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
        Zend_Loader::loadClass('Zend_Gdata_Calendar');

        $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
        $user = '[EMAIL PROTECTED]'; //this is my google account
        $pass = 'abrakadabra';

        // Create an authenticated HTTP client
        $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass,
$service);

        // Create an instance of the Calendar service
        $service = new Zend_Gdata_Calendar($client);

        //Create new event
        $event= $service->newEventEntry();

        // Populate the event with the desired information
        $event->title = $service->newTitle("My Event");
        $event->where = array($service->newWhere("At home"));
        $event->content = $service->newContent("This event was created
through PHP");

        // Set the date using RFC 3339 format.
        $startDate = "2007-11-15";
        $startTime = "14:00";
        $endDate = "2007-11-15";
        $endTime = "16:00";
        $tzOffset = "+01";

        $when = $service->newWhen();
        $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
        $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
        $event->when = array($when);

        // Upload the event to the calendar server
        $newEvent = $service->insertEvent($event,$calendarURL);

        //Query events
        $query = $service->newEventQuery();
        $query->setUser($calendarID);
        $query->setVisibility('private');
        $query->setProjection('full');
        $query->setOrderby('starttime');
        $query->setStartMin('2007-01-01');
        $query->setStartMax('2007-12-31');

        // Retrieve the event list from the calendar server
        try {
                $eventFeed = $service->getCalendarEventFeed($query);
        } catch (Zend_Gdata_App_Exception $e) {
                echo "Error: " . $e->getResponse();
        }

        print "Number of events within eventFeed: ".count($eventFeed);

        // Iterate through the list of events, outputting them as an HTML
list
        echo "<ul>";
        foreach ($eventFeed as $event) {
                echo "<li>" . $event->title . " (Event ID: " . $event->id . ")</
li>";
                $event->delete(); // <-- This is where the Fatal Error Occurs
        }
        echo "</ul>";
?>

On Nov 6, 11:17 am, "Austin (Google)" <[EMAIL PROTECTED]> wrote:
> Hi Gabor,
>
> The code you have shown appears to be correct.  The only thing I
> thought might cause a problem is that there is no event being returned
> from your query, therefore you are getting this exception.  That was
> the reason why I suggested to remove the setFutureEvents(true).
> Because I thought perhaps your query does not result in any events.
> Check to make sure that your calendar has events in the future or
> remove setFutureEvents(true).
>
> Hope it helps,
> Austin
>
> On Nov 6, 12:49 am, gkovacsp <[EMAIL PROTECTED]> wrote:
>
> > My problem was, that I couldn't delete the event.
>
> > The response is always:
>
> > <b>Fatal error</b>:  Uncaught exception 'Zend_Gdata_App_HttpException'
> > with message 'Expected response code 200, got 500' in /home/gkovacsp/
> > scripts/Zend/Gdata/App.php:581
> > Stack trace:
> > #0 /home/gkovacsp/scripts/Zend/Gdata/App/Entry.php(191):
> > Zend_Gdata_App-&gt;delete(Object(Zend_Gdata_Calendar_EventEntry))
> > #1 /home/gkovacsp/misc/epguides/test.php(189): Zend_Gdata_App_Entry-
> > &gt;delete()
> > #2 {main}
> >   thrown in <b>/home/gkovacsp/scripts/Zend/Gdata/App.php</b> on line
> > <b>581</b><br />
>
> > Can you help me with this?
> > Thanks in advance.
>
> > Gabor
>
> > On Nov 5, 8:02 pm, "Austin (Google)" <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > Try to remove "setFutureEvents(true)" from your code.  setFutureEvents
> > > automatically override the "start-min" and "start-max" parameter in
> > > your query to only include those events that are in the future.
>
> > > Hope that helps,
> > > Austin- Hide quoted text -
>
> > - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to