/*
* Editing calendar events.
*
- * Copyright (c) 1996-2010 by the citadel.org team
+ * Copyright (c) 1996-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"
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;
char buf[SIZ];
int organizer_is_me = 0;
int i, j = 0;
+ /************************************************************
+ * Uncomment this to see the UID in calendar events for debugging
int sequence = 0;
+ */
char weekday_labels[7][32];
char month_labels[12][32];
long weekstart = 0;
int which_rryeartype_is_preselected;
const char *ch;
- char *tabnames[3];
+ const char *tabnames[3];
const char *frequency_units[8];
const char *ordinals[6];
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")
);
/* Learn the sequence */
p = icalcomponent_get_first_property(vevent, ICAL_SEQUENCE_PROPERTY);
+ /************************************************************
+ * Uncomment this to see the UID in calendar events for debugging
if (p != NULL) {
sequence = icalproperty_get_sequence(p);
}
-
+ */
/* Begin output */
- output_headers(1, 1, 2, 0, 0, 0);
- wc_printf("<div id=\"banner\">\n");
+ output_headers(1, 1, 1, 0, 0, 0);
+ wc_printf("<div id=\"room_banner_override\">\n");
wc_printf("<h1>");
wc_printf(_("Add or edit an event"));
wc_printf("</h1>");
wc_printf("<form name=\"EventForm\" method=\"POST\" action=\"save_event\">\n");
wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
+ wc_printf("<input type=\"hidden\" name=\"go\" value=\"");
+ StrEscAppend(WCC->WBuf, WCC->CurRoom.name, NULL, 0, 0);
+ wc_printf("\">\n");
+
wc_printf("<input type=\"hidden\" name=\"msgnum\" value=\"%ld\">\n",
msgnum);
wc_printf("<input type=\"hidden\" name=\"calview\" value=\"%s\">\n",
"RecurrenceShowHide(); \n"
"EnableOrDisableCheckButton(); \n"
);
- address_book_popup();
+ do_template("addressbook_popup");
+
wDumpContent(1);
if (created_new_vevent) {
*/
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;
if ( (encaps != NULL) && (havebstr("save_button")) ) {
serv_puts("ENT0 1|||4|||1|");
serv_getln(buf, sizeof buf);
- if (buf[0] == '8') {
+ switch (buf[0]) {
+ case '8':
serv_puts("Content-type: text/calendar");
serv_puts("Content-Transfer-Encoding: quoted-printable");
serv_puts("");
- text_to_server_qp(icalcomponent_as_ical_string(encaps));
+ Buf = NewStrBufPlain(icalcomponent_as_ical_string(encaps), -1);
+ text_to_server_qp(Buf);
+ FreeStrBuf(&Buf);
// serv_puts(icalcomponent_as_ical_string(encaps));
serv_puts("000");
- }
- if ( (buf[0] == '8') || (buf[0] == '4') ) {
- while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
- }
- }
- if (buf[0] == '2') {
- strcpy(WC->ImportantMessage, &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);
/* If this was a save or delete, go back to the calendar or summary view. */
if (!havebstr("check_button")) {
if (!strcasecmp(bstr("calview"), "summary")) {
- summary();
+ display_summary_page();
}
else {
readloop(readfwd, eUseDefault);