On Tue, Nov 25, 2008 at 2:59 AM, Marc MENDEZ <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I use the Zend_Gdata API to read and add events to a google Calendar.
> But, I can't find solution for my configuration :
>
> I have several google users which all share their calendar with a
> "manager". The manager creates events for each of them.
> I have an important constraint : the events must appear as created by
> the manager.
> I want to do the same thing with the Zend API.
> So I connect to the service as client with the manager's user and
> password.
> But, in the event I want to insert, how can I say that
> the event was created by the manager BUT are for somebody else ?
>
> Of course, I could connect with the simple user's login, but I won't
> know the event was created by the manager !
>
> Here is what I do to create my new event :
> $event = $service->newEventEntry();
> $event->title = $service->newTitle($title);
> $when = $service->newWhen();
> $when->startTime = $start;
> $when->endTime = $end;
> $event->when = array($when);
> $author = $service->newAuthor($service->newName("Marc MENDEZ"),
> $service->newEmail(AGENDA_MANAGER_USER));
> $who = $service->newWho("[EMAIL PROTECTED]",null,"Marc
> MENDEZ");
> $event->who = array($who);
> $event->author = array($author);
> $service->insertEvent($event);
>
> But in the calendar, I get :
> - an event that's belongs to my manager
> - an invitation to the second user (a kind on "invitation")
>
>
> Thanks a lot
Marc,
$service->insertEvent takes a URL as an optional second argument:
http://framework.zend.com/apidoc/core/Zend_Gdata/App/Zend_Gdata_Calendar.html#insertEvent
For the URL, if you provide something in the following form:
http://www.google.com/calendar/feeds/<calendar ID>/private/full
then the event will be added to the specified calendar.
The calendar ID will be the user's email address if you're accessing
their primary calendar. For any of the other calendar's, you'll need
to check your calendars feed to find the URL. Specifically, the
calendar's feed URL is listed as a <link rel="alternate"> element in
the associated calendar entry.
--
Trevor Johns
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---