POGI Calendar Usage Notes
A few notes on using the groupware calendar:
There are two primary methods for retrieving dates.
Examples: $appointments = $appointmentManager->getBetween( $_SESSION['appointmentStartDate'], $_SESSION['appointmentEndDate']); - and - $appointments = $appointmentManager->getOverview( $_SESSION['appointmentStartDate'], $_SESSION['appointmentEndDate']);
These both produce arrays of OGoAppointment objects.
getBetween produces an array of appointments VISIBLE to the user (based on permissions internal to the server) between (inclusively) the two dates.
getOverview produces and array of appointments between the two dates (inclusively) of which the user is a participant (or member of a team that is a participant).
You can also call getOverview with a third parameter of the id of a given contact to retrieve appointments of which that contact is a member. Every object in the groupware server has a unique id: teams, contacts, appointments, etc... These ids to not overlap, all the object types share the same id space; so the server can tell that 10100 is a contact, not an appointment, etc... That can make things a little confusing at first, but is simpler in the long run - for instance a team is added as a participant to a meeting in the same manner as a contact - since the server can tell by the id that it is a team. The id of an object is available via the getShortId() method on any object type (or it should be).
Also, if you request using getBetween, you'll see appointments with a description/title of "*" and seem to just be a date range. This means there is an appointment there but the requesting user does not have permission to see the appointment. So it is probably better to use getOverview for an Intranet calendar.
The method to add participants to a meeting (so it appears in their overview) is OGoAppointment::alterParticipants(add, remove) where add and remove are arrays (perhaps empty) of either ids [via getShortId()] or OGoTeam and OGoPerson objects (they can be mixed in the array). The objects or ids in the remove array are subtracted from participation in the meeting, and objects or ids in the add array are added as participants. You can also all addParticipant(id|object) or removeParticipant(id|object) singally if you want to. When done altering participation call OGoAppointment::updateParticipants().