X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fevent.c;h=d786998ab8ef818c0d5bebf7e15b291c1b04b7e1;hb=HEAD;hp=b0f41ca2d4cf03878ad7805bc55f12a6f068e2e1;hpb=a15ba5c1ede7c86a85d62ed5b539dcfc9f415bc1;p=citadel.git diff --git a/webcit/event.c b/webcit/event.c index b0f41ca2d..ffe0688ab 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -1,25 +1,19 @@ /* * Editing calendar events. * - * Copyright (c) 1996-2010 by the citadel.org team + * Copyright (c) 2002-2012 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. + * modify it under the terms of the GNU General Public License, version 3. * * 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" /* @@ -30,6 +24,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, char *from, int unread, calview *calv) { + wcsession *WCC = WC; icalcomponent *vevent; icalproperty *p; icalvalue *v; @@ -69,7 +64,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, int which_rryeartype_is_preselected; const char *ch; - char *tabnames[3]; + const char *tabnames[3]; const char *frequency_units[8]; const char *ordinals[6]; @@ -98,7 +93,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, get_pref_long("weekstart", &weekstart, 17); if (weekstart > 6) weekstart = 0; - syslog(9, "display_edit_individual_event(%ld) calview=%s year=%s month=%s day=%s\n", + syslog(LOG_DEBUG, "display_edit_individual_event(%ld) calview=%s year=%s month=%s day=%s\n", msgnum, bstr("calview"), bstr("year"), bstr("month"), bstr("day") ); @@ -167,8 +162,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, } */ /* Begin output */ - output_headers(1, 1, 2, 0, 0, 0); - wc_printf("
\n"); + output_headers(1, 1, 1, 0, 0, 0); + wc_printf("
\n"); wc_printf("

"); wc_printf(_("Add or edit an event")); wc_printf("

"); @@ -190,6 +185,10 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wc_printf("
\n"); wc_printf("\n", WC->nonce); + wc_printf("WBuf, WCC->CurRoom.name, NULL, 0, 0); + wc_printf("\">\n"); + wc_printf("\n", msgnum); wc_printf("\n", @@ -265,8 +264,6 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, ((yesbstr("alldayevent")) ? 1 : 0), icaltimezone_get_utc_timezone() ); - t_start.is_utc = 1; - } display_icaltimetype_as_webform(&t_start, "dtstart", 0); @@ -362,7 +359,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, strcpy(organizer_string, icalproperty_get_organizer(organizer)); if (!strncasecmp(organizer_string, "mailto:", 7)) { strcpy(organizer_string, &organizer_string[7]); - striplt(organizer_string); + string_trim(organizer_string); serv_printf("ISME %s", organizer_string); serv_getln(buf, sizeof buf); if (buf[0] == '2') { @@ -473,7 +470,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, /* screen name or email address */ safestrncpy(attendee_string, ch + 7, sizeof(attendee_string)); - striplt(attendee_string); + string_trim(attendee_string); if (i++) wc_printf("\n"); escputs(attendee_string); wc_printf(" "); @@ -780,7 +777,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, "RecurrenceShowHide(); \n" "EnableOrDisableCheckButton(); \n" ); - address_book_popup(); + do_template("addressbook_popup"); + wDumpContent(1); if (created_new_vevent) { @@ -796,6 +794,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, */ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *from, int unread, calview *calv) { + StrBuf *Buf; char buf[SIZ]; icalproperty *prop; icalcomponent *vevent, *encaps; @@ -853,8 +852,8 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr /* Add NOW() to the calendar object... */ icalcomponent_set_dtstamp(vevent, - icaltime_from_timet( - time(NULL), 0)); + icaltime_from_timet_with_zone( + time(NULL), 0, icaltimezone_get_utc_timezone())); if (havebstr("summary")) { icalcomponent_add_property(vevent, @@ -1099,7 +1098,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr /* Now iterate! */ for (i=0; iImportantMessage, &buf[4]); + case '4': + while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {} + break; + case '2': + AppendImportantMessage(buf + 4, - 1); + break; + default: + break; } icalmemory_free_ring (); icalcomponent_free(encaps); @@ -1211,7 +1214,7 @@ STARTOVER: for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDE /* If this was a save or delete, go back to the calendar or summary view. */ if (!havebstr("check_button")) { if (!strcasecmp(bstr("calview"), "summary")) { - do_template("summary_page"); + display_summary_page(); } else { readloop(readfwd, eUseDefault);