sanity check diagnostic mode
[citadel.git] / webcit / tasks.c
index 79c8ec851c84f4f08bf09a057018a1e2ddac9f5d..66b05e3e09f841ea2376a01702003a7e4c9aa92f 100644 (file)
@@ -176,6 +176,7 @@ int tasks_RenderView_or_Tail(SharedMessageStatus *Stat,
 void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum, char *from,
                        int unread, calview *calv)
 {
+       wcsession *WCC = WC;
        icalcomponent *vtodo;
        icalproperty *p;
        struct icaltimetype IcalTime;
@@ -230,6 +231,11 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum, ch
        wc_printf("<div class=\"boxcontent\">\n");
        wc_printf("<FORM METHOD=\"POST\" action=\"save_task\">\n");
        wc_printf("<div style=\"display: none;\">\n     ");
+
+       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=\"nonce\" value=\"%d\">\n", WC->nonce);
        wc_printf("<INPUT TYPE=\"hidden\" NAME=\"msgnum\" VALUE=\"%ld\">\n", msgnum);
        wc_printf("<INPUT TYPE=\"hidden\" NAME=\"return_to_summary\" VALUE=\"%d\">\n",
@@ -498,7 +504,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum, char* from
                                );
                }
                /** Give this task a UID if it doesn't have one. */
-               syslog(9, "Give this task a UID if it doesn't have one.\n");
+               syslog(LOG_DEBUG, "Give this task a UID if it doesn't have one.\n");
                if (icalcomponent_get_first_property(vtodo,
                                                     ICAL_UID_PROPERTY) == NULL) {
                        generate_uuid(buf);
@@ -508,17 +514,17 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum, char* from
                }
 
                /* Increment the sequence ID */
-               syslog(9, "Increment the sequence ID\n");
+               syslog(LOG_DEBUG, "Increment the sequence ID\n");
                while (prop = icalcomponent_get_first_property(vtodo,
                                                               ICAL_SEQUENCE_PROPERTY), (prop != NULL) ) {
                        i = icalproperty_get_sequence(prop);
-                       syslog(9, "Sequence was %d\n", i);
+                       syslog(LOG_DEBUG, "Sequence was %d\n", i);
                        if (i > sequence) sequence = i;
                        icalcomponent_remove_property(vtodo, prop);
                        icalproperty_free(prop);
                }
                ++sequence;
-               syslog(9, "New sequence is %d.  Adding...\n", sequence);
+               syslog(LOG_DEBUG, "New sequence is %d.  Adding...\n", sequence);
                icalcomponent_add_property(vtodo,
                                           icalproperty_new_sequence(sequence)
                        );
@@ -530,7 +536,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum, char* from
                 * can't encapsulate something that may already be encapsulated
                 * somewhere else.
                 */
-               syslog(9, "Encapsulating into a full VCALENDAR component\n");
+               syslog(LOG_DEBUG, "Encapsulating into a full VCALENDAR component\n");
                encaps = ical_encapsulate_subcomponent(icalcomponent_new_clone(vtodo));
 
                /* Serialize it and save it to the message base */
@@ -752,6 +758,7 @@ InitModule_TASKS
                NULL,
                tasks_LoadMsgFromServer,
                tasks_RenderView_or_Tail,
-               tasks_Cleanup);
+               tasks_Cleanup,
+               NULL);
        WebcitAddUrlHandler(HKEY("save_task"), "", 0, save_task, 0);
 }