* started fleshing out the calendar day view
authorArt Cancro <ajc@citadel.org>
Sat, 28 Sep 2002 04:01:30 +0000 (04:01 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 28 Sep 2002 04:01:30 +0000 (04:01 +0000)
webcit/ChangeLog
webcit/calendar_view.c
webcit/event.c
webcit/messages.c

index 8f8d3cfb65bb3f105a3c4626c6ac709ca2a51e17..6c5e38b103e43ccfb8162a54e94d3bf952902708 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 400.30  2002/09/28 04:01:30  ajc
+* started fleshing out the calendar day view
+
 Revision 400.29  2002/09/27 21:19:28  ajc
 * Add new event
 
@@ -1040,4 +1043,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 8c6936bff2deee8702a36b0bf1c77cfee478321d..ed5fd34e82e57d44490bd5778862a245fc3c1e72 100644 (file)
@@ -128,7 +128,13 @@ void calendar_month_view(int year, int month, int day) {
        wprintf("<TABLE width=100%% border=0 cellpadding=0 cellspacing=0 "
                "bgcolor=#4444FF><TR><TD>\n");
 
-       wprintf("<CENTER><H3>");
+       wprintf("<TABLE width=100%% border=0 cellpadding=0 cellspacing=0>"
+               "<TR><TD align=left><font color=#FFFFFF>"
+               "&nbsp;<A HREF=\"/display_edit_event?msgnum=0\">"
+               "Add new calendar event</A>"
+               "</font></TD>\n");
+
+       wprintf("<TD><CENTER><H3>");
 
        tm = localtime(&previous_month);
        wprintf("<A HREF=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
@@ -146,7 +152,9 @@ void calendar_month_view(int year, int month, int day) {
                (int)(tm->tm_year)+1900, tm->tm_mon + 1);
        wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/forward.gif\" BORDER=0></A>\n");
 
-       wprintf("</H3>");
+       wprintf("</H3></TD><TD align=right><font color=#FFFFFF size=-2>"
+               "Click on any date for day view&nbsp;"
+               "</FONT></TD></TR></TABLE>\n");
 
        /* Inner table (the real one) */
        wprintf("<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
@@ -200,6 +208,7 @@ void calendar_week_view(int year, int month, int day) {
 void calendar_day_view(int year, int month, int day) {
        struct tm starting_tm;
        time_t thetime;
+       int i;
 
        /* Determine what day we're viewing.
         */
@@ -209,14 +218,58 @@ void calendar_day_view(int year, int month, int day) {
        starting_tm.tm_mday = day;
        thetime = mktime(&starting_tm);
 
-       wprintf("<CENTER><H3>%s %d, %d</H3></CENTER>\n",
+
+/**********************************************************************/
+
+       /* Outer table (to get the background color) */
+       wprintf("<TABLE width=100%% border=0 cellpadding=0 cellspacing=0 "
+               "bgcolor=#4444FF><TR><TD>\n");
+
+       /* Inner table (the real one) */
+       wprintf("<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
+               "bgcolor=#4444FF><TR>\n");
+
+       wprintf("<TD WIDTH=50%% VALIGN=top>");  /* begin stuff-on-the-left */
+
+       wprintf("<CENTER><H3><FONT COLOR=#FFFFFF>"
+               "%s %d, %d"
+               "</FONT></H3></CENTER>\n",
                months[month-1], day, year);
 
-       /* put the data here, stupid */
-       calendar_month_view_display_events(thetime);
+       wprintf("<CENTER><font color=#FFFFFF>"
+               "&nbsp;<A HREF=\"/display_edit_event?msgnum=0\">"
+               "Add new calendar event</A>"
+               "<BR><BR>\n");
 
        wprintf("<A HREF=\"readfwd?calview=month&year=%d&month=%d&day=1\">"
-               "Back to month view</A><BR>\n", year, month);
+               "Back to month view</A>\n", year, month);
+
+       wprintf("</FONT></CENTER>\n");
+
+       wprintf("</TD>");                       /* end stuff-on-the-left */
+
+       /* Innermost table (contains hours etc.) */
+       wprintf("<TD WIDTH=50%%>"
+               "<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
+               "bgcolor=#4444FF>\n");
+
+       /* Now do 7 hours */
+       for (i = 0; i < 7; ++i) {
+               wprintf("<TR><TD BGCOLOR=FFFFFF HEIGHT=60 VALIGN=TOP>");
+
+               /* put the data here, stupid  ... FIXME add hour */
+               calendar_month_view_display_events(thetime);
+
+               wprintf("</TD></TR>\n");
+       }
+
+       wprintf("</TABLE>"                      /* end of innermost table */
+               "</TD></TR></TABLE>"            /* end of inner table */
+               "</TD></TR></TABLE>"            /* end of outer table */
+       );
+
+
+
 }
 
 
index 70d9a64030fda3055d5d9fd9cd6d5946c5b23aa0..d9ae239f8da0a4c30fb59ee4ab8d0b52e495a0b5 100644 (file)
@@ -79,7 +79,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        }
        wprintf("\"><BR>\n");
 
-       wprintf("Start date: ");
+       wprintf("Start date/time: ");
        p = icalcomponent_get_first_property(vevent, ICAL_DTSTART_PROPERTY);
        if (p != NULL) {
                t = icalproperty_get_dtstart(p);
@@ -90,6 +90,17 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        display_icaltimetype_as_webform(&t, "dtstart");
        wprintf("<BR>\n");
 
+       wprintf("End date/time: ");
+       p = icalcomponent_get_first_property(vevent, ICAL_DTEND_PROPERTY);
+       if (p != NULL) {
+               t = icalproperty_get_dtend(p);
+       }
+       else {
+               t = icaltime_from_timet(now, 0);
+       }
+       display_icaltimetype_as_webform(&t, "dtend");
+       wprintf("<BR>\n");
+
        wprintf("<CENTER><TEXTAREA NAME=\"description\" wrap=soft "
                "ROWS=10 COLS=80 WIDTH=80>\n"
        );
index 9066d4149e2be02bd4b3179f0027058ef3be4a56..2428675db3e7f91915b5cf62ee4717e4b4e0b14f 100644 (file)
@@ -902,6 +902,7 @@ void readloop(char *oper)
         * messages, then display the selector bar
         */
        if (num_displayed > 1) {
+          if ((!is_tasks) && (!is_calendar)) {
                wprintf("<CENTER>"
                        "<TABLE BORDER=0 WIDTH=100%% BGCOLOR=DDDDDD><TR><TD>"
                        "Reading #%d-%d of %d messages.</TD>\n"
@@ -950,6 +951,7 @@ void readloop(char *oper)
                        WC->msgarr[0]);
 
                wprintf("</TD></TR></TABLE></CENTER>\n");
+           }
        }
        if (is_summary) wprintf("</FORM>\n");
 
@@ -962,12 +964,6 @@ DONE:
 
        if (is_calendar) {
                do_calendar_view();     /* Render the calendar */
-
-               wprintf("<A HREF=\"/display_edit_event?msgnum=0\">"
-                       "Add new calendar event</A>\n"
-               );
-
-
        }
 
        wDumpContent(1);