Editing calendar events.
[Calendaring background]


Functions

void display_edit_individual_event (icalcomponent *supplied_vevent, long msgnum)
 Display an event by itself (for editing).
void save_individual_event (icalcomponent *supplied_vevent, long msgnum)
 Save an edited event.

Function Documentation

void display_edit_individual_event ( icalcomponent *  supplied_vevent,
long  msgnum 
)

Display an event by itself (for editing).

Parameters:
supplied_vevent the event to edit
msgnum reference on the citserver

If we're looking at a fully encapsulated VCALENDAR rather than a VEVENT component, attempt to use the first relevant VEVENT subcomponent. If there is none, the NULL returned by icalcomponent_get_first_component() will tell the next iteration of this function to create a new one.

Learn the sequence

Begin output

Put it in a borderless table so it lines up nicely

If this is an all-day-event, set the end time to be identical to the start time (the hour/minute/second will be set to midnight). Otherwise extract or create it.

If this is not an all-day event and there is no end time specified, make the default one hour from the start time.

For a new event, the user creating the event should be the organizer. Set this field accordingly.

Determine who is the organizer of this event. We need to determine "me" or "not me."

Transmit the organizer as a hidden field. We don't want the user to be able to change it, but we do want it fed back to the server, especially if this is a new event and there is no organizer already in the calendar object.

Transparency

No transparency found. Default to opaque (busy).

Attendees

Pop open an address book -- begin

Pop open an address book -- end

screen name or email address

participant status

Done with properties.

Definition at line 20 of file event.c.

References bstr(), display_edit_individual_event(), display_icaltimetype_as_webform(), escputs(), output_headers(), partstat_as_string(), serv_getln(), serv_printf(), striplt(), wDumpContent(), and wprintf().

Referenced by display_edit_event(), display_edit_individual_event(), and save_individual_event().

void save_individual_event ( icalcomponent *  supplied_vevent,
long  msgnum 
)

Save an edited event.

Parameters:
supplied_vevent the event to save
msgnum the index on the citserver

If we're looking at a fully encapsulated VCALENDAR rather than a VEVENT component, attempt to use the first relevant VEVENT subcomponent. If there is none, the NULL returned by icalcomponent_get_first_component() will tell the next iteration of this function to create a new one.

Replace values in the component with ones from the form

The following odd-looking snippet of code looks like it takes some unnecessary steps. It is done this way because libical incorrectly turns an "all day event" into a normal event starting at midnight (i.e. it serializes as date/time instead of just date) unless icalvalue_new_date() is used. So we force it, if this is an all day event.

See if transparency is indicated

Give this event a UID if it doesn't have one.

Increment the sequence ID

Set the organizer, only if one does not already exist *and* the form is supplying one

set new organizer

Add any new attendees listed in the web form

Now iterate!

Remove any attendees *not* listed in the web form

Encapsulate event into full VCALENDAR component. Clone it first, for two reasons: one, it's easier to just free the whole thing when we're done instead of unbundling, but more importantly, we can't encapsulate something that may already be encapsulated somewhere else.

If the user clicked 'Save' then save it to the server.

Or, check attendee availability if the user asked for that.

Call this function, which does the real work

This displays the form again, with our annotations

If the user clicked 'Delete' then delete it.

If this was a save or delete, go back to the calendar view.

Definition at line 427 of file event.c.

References bstr(), check_attendee_availability(), display_edit_individual_event(), extract_token(), generate_uuid(), ical_encapsulate_subcomponent(), icaltime_from_webform(), icaltime_from_webform_dateonly(), lprintf(), num_tokens(), readloop(), save_individual_event(), serv_getln(), serv_printf(), serv_puts(), striplt(), and stripout().

Referenced by save_event(), and save_individual_event().


Generated on Wed Jun 20 23:13:12 2007 for webcit by  doxygen 1.5.2