* Tasks in summary view are now clickable too. I also found the bug report; it was...
authorArt Cancro <ajc@citadel.org>
Wed, 7 Jan 2009 21:46:27 +0000 (21:46 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 7 Jan 2009 21:46:27 +0000 (21:46 +0000)
webcit/calendar.c
webcit/calendar_view.c

index a80e62c167f863db8bbcab9a67c002afa4042106..9012e8966ac000f0dd116b0cc1e49363238c60ca 100644 (file)
@@ -640,8 +640,9 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum, ch
        wprintf("<FORM METHOD=\"POST\" action=\"save_task\">\n");
        wprintf("<div style=\"display: none;\">\n       ");
        wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
-       wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgnum\" VALUE=\"%ld\">\n",
-               msgnum);
+       wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgnum\" VALUE=\"%ld\">\n", msgnum);
+       wprintf("<INPUT TYPE=\"hidden\" NAME=\"return_to_summary\" VALUE=\"%d\">\n",
+               ibstr("return_to_summary"));
        wprintf("</div>");
        wprintf("<table class=\"calendar_background\"><tr><td>");
        wprintf("<TABLE STYLE=\"border: none;\">\n");
@@ -937,8 +938,13 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum, char* from
                icalcomponent_free(vtodo);
        }
 
-       /** Go back to the task list */
-       readloop(readfwd);
+       /* Go back to wherever we came from */
+       if (ibstr("return_to_summary") == 1) {
+               summary();
+       }
+       else {
+               readloop(readfwd);
+       }
 }
 
 
index 7d13d99e8311f51c49f79e225a19fc0aeee6b51e..f9863836bf81e9b5314b3716ee0def62686bc485 100644 (file)
@@ -1295,19 +1295,34 @@ void calendar_summary_view(void) {
 
                                p = icalcomponent_get_first_property(Cal->cal, ICAL_SUMMARY_PROPERTY);
                                if (p != NULL) {
-                                       wprintf("<a href=\"display_edit_event"
-                                               "?msgnum=%ld"
-                                               "?calview=summary"
-                                               "?year=%d"
-                                               "?month=%d"
-                                               "?day=%d"
-                                               "?gotofirst=_CALENDAR_"
-                                               "\">",
-                                               Cal->cal_msgnum,
-                                               today_tm.tm_year + 1900,
-                                               today_tm.tm_mon + 1,
-                                               today_tm.tm_mday
-                                       );
+
+
+                                       if (WCC->wc_view == VIEW_TASKS) {
+                                               wprintf("<a href=\"display_edit_task"
+                                                       "?msgnum=%ld"
+                                                       "?return_to_summary=1"
+                                                       "?gotofirst=",
+                                                       Cal->cal_msgnum
+                                               );
+                                               escputs(WCC->wc_roomname);
+                                               wprintf("\">");
+                                       }
+                                       else {
+                                               wprintf("<a href=\"display_edit_event"
+                                                       "?msgnum=%ld"
+                                                       "?calview=summary"
+                                                       "?year=%d"
+                                                       "?month=%d"
+                                                       "?day=%d"
+                                                       "?gotofirst=",
+                                                       Cal->cal_msgnum,
+                                                       today_tm.tm_year + 1900,
+                                                       today_tm.tm_mon + 1,
+                                                       today_tm.tm_mday
+                                               );
+                                               escputs(WCC->wc_roomname);
+                                               wprintf("\">");
+                                       }
                                        escputs((char *) icalproperty_get_comment(p));
                                        wprintf(" (%s)</a><br />\n", timestring);
                                }
@@ -1536,8 +1551,7 @@ void do_tasks_view(void) {
                wprintf("disabled=\"disabled\">\n</td><td>");
                p = icalcomponent_get_first_property(Cal->cal,
                        ICAL_SUMMARY_PROPERTY);
-               wprintf("<a href=\"display_edit_task?msgnum=%ld&amp;taskrm=",
-                       Cal->cal_msgnum );
+               wprintf("<a href=\"display_edit_task?msgnum=%ld?taskrm=", Cal->cal_msgnum);
                urlescputs(WC->wc_roomname);
                wprintf("\">");
                /* wprintf("<img align=middle "