Editing: remember room on hidden input field
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 19 Jul 2012 15:22:00 +0000 (17:22 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 19 Jul 2012 15:26:54 +0000 (17:26 +0200)
when creating / editing calendar entries / vcards / tasks we now remember the room on the hidden field "go" so we're shure to save the message in the room its been intended for.

webcit/event.c
webcit/tasks.c
webcit/vcard_edit.c

index 5f9d3213ddb0b8714ae11190fb20eba5a0c367c0..c3c2ba3d67d337ca0c2aed3e49cde48176cc07af 100644 (file)
@@ -24,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;
@@ -184,6 +185,10 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        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",
index 79c8ec851c84f4f08bf09a057018a1e2ddac9f5d..a58edbb7b99167c4b2fbefc36ddcf582be245aa9 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",
index d531098c66a944b09a131aea69814bd267587001..ee1396249da91107f15d33b7eb693f720003843b 100644 (file)
@@ -870,6 +870,7 @@ void do_edit_vcard(long msgnum, char *partnum,
                   wc_mime_attachment *VCAtt,
                   const char *return_to, 
                   const char *force_room) {
+       wcsession *WCC = WC;
        message_summary *Msg = NULL;
        wc_mime_attachment *VCMime = NULL;
        struct vCard *v;
@@ -1050,6 +1051,12 @@ void do_edit_vcard(long msgnum, char *partnum,
                escputs(force_room);
                wc_printf("\">\n");
        }
+       else
+       {
+               wc_printf("<input type=\"hidden\" name=\"go\" value=\"");
+               StrEscAppend(WCC->WBuf, WCC->CurRoom.name, NULL, 0, 0);
+               wc_printf("\">\n");
+       }
 
        wc_printf("<table class=\"vcard_edit_background\"><tr><td>\n");