]> code.citadel.org Git - citadel.git/commitdiff
* Display a nicer looking screen when replying to calendar invitations
authorArt Cancro <ajc@citadel.org>
Tue, 12 Nov 2002 05:57:27 +0000 (05:57 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 12 Nov 2002 05:57:27 +0000 (05:57 +0000)
* When displaying day view, don't show all day events twice
* Day or month view: denote all day events by displaying them inside
  a grey box.

webcit/ChangeLog
webcit/calendar_view.c

index 84515b1cb23d569db063823ae7b463f94f54831d..a28e61d1c8f2d4bf4cdd5379692b3780703bc15b 100644 (file)
@@ -1,4 +1,10 @@
 $Log$
+Revision 400.47  2002/11/12 05:57:27  ajc
+* Display a nicer looking screen when replying to calendar invitations
+* When displaying day view, don't show all day events twice
+* Day or month view: denote all day events by displaying them inside
+  a grey box.
+
 Revision 400.46  2002/11/12 03:26:39  ajc
 * Tell the user about broken Citadel server connections instead of
   simply printing "Goodbye"
@@ -1098,3 +1104,4 @@ 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 a015a869c39720479f8567f1b6cba5755129058e..c2bcab35e41f98035925728ca4e3725ed6723a72 100644 (file)
@@ -42,6 +42,7 @@ void calendar_month_view_display_events(time_t thetime) {
        icalproperty *p;
        struct icaltimetype t;
        int month, day, year;
+       int all_day_event = 0;
 
        if (WC->num_cal == 0) {
                wprintf("<BR><BR><BR>\n");
@@ -62,10 +63,19 @@ void calendar_month_view_display_events(time_t thetime) {
                           && (t.month == month)
                           && (t.day == day)) {
 
+                               if (t.is_date) all_day_event = 1;
+
                                p = icalcomponent_get_first_property(
                                                        WC->disp_cal[i],
                                                        ICAL_SUMMARY_PROPERTY);
                                if (p != NULL) {
+
+                                       if (all_day_event) {
+                                               wprintf("<TABLE border=1 cellpadding=2><TR>"
+                                                       "<TD BGCOLOR=#CCCCCC>"
+                                               );
+                                       }
+
                                        wprintf("<FONT SIZE=-1>"
                                                "<A HREF=\"/display_edit_event?msgnum=%ld&calview=%s&year=%s&month=%s&day=%s\">",
                                                WC->cal_msgnum[i],
@@ -77,6 +87,11 @@ void calendar_month_view_display_events(time_t thetime) {
                                        escputs((char *)
                                                icalproperty_get_comment(p));
                                        wprintf("</A></FONT><BR>\n");
+
+                                       if (all_day_event) {
+                                               wprintf("</TD></TR></TABLE>");
+                                       }
+
                                }
 
                        }
@@ -214,6 +229,7 @@ void calendar_day_view_display_events(int year, int month,
        int i;
        icalproperty *p;
        struct icaltimetype t;
+       int all_day_event = 0;
 
        if (WC->num_cal == 0) {
                wprintf("<BR><BR><BR>\n");
@@ -228,13 +244,22 @@ void calendar_day_view_display_events(int year, int month,
                        if ((t.year == year)
                           && (t.month == month)
                           && (t.day == day)
-                          && ( (t.hour == hour) || ((hour<0)&&(t.is_date)) )
+                          && ( ((t.hour == hour)&&(!t.is_date)) || ((hour<0)&&(t.is_date)) )
                           ) {
 
+                               if (t.is_date) all_day_event = 1;
+
                                p = icalcomponent_get_first_property(
                                                        WC->disp_cal[i],
                                                        ICAL_SUMMARY_PROPERTY);
                                if (p != NULL) {
+
+                                       if (all_day_event) {
+                                               wprintf("<TABLE border=1 cellpadding=2><TR>"
+                                                       "<TD BGCOLOR=#CCCCCC>"
+                                               );
+                                       }
+
                                        wprintf("<FONT SIZE=-1>"
                                                "<A HREF=\"/display_edit_event?msgnum=%ld&calview=day&year=%d&month=%d&day=%d\">",
                                                WC->cal_msgnum[i],
@@ -243,6 +268,10 @@ void calendar_day_view_display_events(int year, int month,
                                        escputs((char *)
                                                icalproperty_get_comment(p));
                                        wprintf("</A></FONT><BR>\n");
+
+                                       if (all_day_event) {
+                                               wprintf("</TD></TR></TABLE>");
+                                       }
                                }
 
                        }