X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fevent.c;h=a7107bde7b072e78817da8009c1a3adc5897502a;hb=7e6ecf64e51b1b9377e701c7380a038360e1ac8c;hp=041e5b83301084961117802b288a7fccd0ad1cfb;hpb=fcb236e86a29d12b6500456ac8852c611a97d36c;p=citadel.git diff --git a/webcit/event.c b/webcit/event.c index 041e5b833..a7107bde7 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -1,11 +1,26 @@ /* - * $Id$ - * * Editing calendar events. + * + * Copyright (c) 1996-2010 by the citadel.org team + * + * This program is open source software. You can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "webcit.h" #include "webserver.h" +#include "calendar.h" /* * Display an event by itself (for editing) @@ -13,7 +28,7 @@ * msgnum reference on the citserver */ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, char *from, - int unread, struct calview *calv) + int unread, calview *calv) { icalcomponent *vevent; icalproperty *p; @@ -33,11 +48,54 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, char weekday_labels[7][32]; char month_labels[12][32]; long weekstart = 0; + icalproperty *rrule = NULL; + struct icalrecurrencetype recur; + char weekday_is_selected[7]; + int which_rrmonthtype_is_preselected = 0; + + int rrmday; + int rrmweekday; + + icaltimetype day1; + int weekbase; + int rrmweek; + int rrymweek; + int rrymweekday; + int rrymonth; + int which_rrend_is_preselected; + int which_rryeartype_is_preselected; + + const char *ch; + char *tabnames[3]; + const char *frequency_units[8]; + const char *ordinals[6]; + + frequency_units[0] = _("seconds"); + frequency_units[1] = _("minutes"); + frequency_units[2] = _("hours"); + frequency_units[3] = _("days"); + frequency_units[4] = _("weeks"); + frequency_units[5] = _("months"); + frequency_units[6] = _("years"); + frequency_units[7] = _("never"); + + + ordinals[0] = "0"; + ordinals[1] = _("first"); + ordinals[2] = _("second"); + ordinals[3] = _("third"); + ordinals[4] = _("fourth"); + ordinals[5] = _("fifth"); + + + tabnames[0] = _("Event"); + tabnames[1] = _("Attendees"); + tabnames[2] = _("Recurrence"); get_pref_long("weekstart", &weekstart, 17); if (weekstart > 6) weekstart = 0; - lprintf(9, "display_edit_individual_event(%ld) calview=%s year=%s month=%s day=%s\n", + syslog(9, "display_edit_individual_event(%ld) calview=%s year=%s month=%s day=%s\n", msgnum, bstr("calview"), bstr("year"), bstr("month"), bstr("day") ); @@ -71,6 +129,10 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, if (supplied_vevent != NULL) { vevent = supplied_vevent; + + /* Convert all timestamps to UTC to make them easier to process. */ + ical_dezonify(vevent); + /* * If we're looking at a fully encapsulated VCALENDAR * rather than a VEVENT component, attempt to use the first @@ -101,78 +163,71 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, /* Begin output */ output_headers(1, 1, 2, 0, 0, 0); - wprintf("
\n"); + wc_printf(" \n"); - wprintf("