Hi,
To set the attendee status with PHP client library -
$attendeeA = $gdataCal->newWho('[EMAIL PROTECTED]', null, null,
$gdataCal->newAttendeeStatus('
http://schemas.google.com/g/2005#event.accepted'));
$attendeeB = $gdataCal->newWho('[EMAIL PROTECTED]', null, null,
$gdataCal->newAttendeeStatus('
http://schemas.google.com/g/2005#event.accepted'));
$event->who = array($attendeeA, $attendeeB);
Hope that helps,
Austin
On Thu, Jul 10, 2008 at 1:16 AM, Cadish <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've this problem with creating events through php: I want to add the
> attendee as accepted, but the attendee is always added as invited, and
> not as accepted.
>
> This is the code I use:
> function createEventinGoogle ($client, $title = 'Tennis with Beth',
> $desc='Meet for a quick lesson', $where = 'On the courts',
> $startDate = '2008-07-02', $startTime = '10:00',
> $endDate = '2008-07-02', $endTime = '11:00', $tzOffset = '+02',
> $calendar = '1')
> {
> $gdataCal = new Zend_Gdata_Calendar($client);
> $newEvent = $gdataCal->newEventEntry();
>
> $newEvent->title = $gdataCal->newTitle($title);
> $newEvent->where = array($gdataCal->newWhere($where));
> $newEvent->content = $gdataCal->newContent("$desc");
>
> $whoArray=array();
> $tempWho = $gdataCal->newWho();
> $tempWho->rel = 'http://schemas.google.com/g/
> 2005#event.attendee <http://schemas.google.com/g/2005#event.attendee>';
> $tempWho->valueString = "Test";
> $tempWho->email = $_REQUEST['email'];
> $tempWho->attendeeStatus->value = '
> http://schemas.google.com/g/
> 2005#event.accepted <http://schemas.google.com/g/2005#event.accepted>';
> $newEvent->who = array($tempWho);
>
> $when = $gdataCal->newWhen();
> $when->startTime =
> "{$startDate}T{$startTime}:00.000{$tzOffset}:
> 00";
> $when->endTime =
> "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
> $newEvent->when = array($when);
>
> // Upload the event to the calendar server
> // A copy of the event as it is recorded on the server is returned
> $createdEvent = $gdataCal->insertEvent($newEvent);
> return $createdEvent->id->text;
> }
>
> What's wrong with this code?
>
> Thanks a lot in advance!!
> Cadish
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---