Daily vue of Calendar.
authorThierry Pasqualier <thierry@uncensored.citadel.org>
Sun, 14 Oct 2007 09:41:00 +0000 (09:41 +0000)
committerThierry Pasqualier <thierry@uncensored.citadel.org>
Sun, 14 Oct 2007 09:41:00 +0000 (09:41 +0000)
I began to rewrite my code.
IG and Dothebart: you can verify the coherence with your codes
I continue later to fix the calculations of position and height of each  events.
I fix later the events wich span several days

webcit/calendar_view.c
webcit/static/webcit.css

index ae4cc32ded989feee9b638b2d45c3e53bdde0ca6..7e5337f45e68473ff1385af5b372862884701230 100644 (file)
@@ -1,4 +1,4 @@
-/*
+ /*
  * $Id$
  */
 /**
@@ -628,6 +628,8 @@ void calendar_day_view_display_events(time_t thetime, int year, int month,
        icalproperty *q = NULL;
        time_t event_start;
        time_t event_end;
+       time_t event_tt;
+       time_t event_tte;
        struct tm event_te;
        struct tm event_tm;
        int show_event = 0;
@@ -670,7 +672,7 @@ void calendar_day_view_display_events(time_t thetime, int year, int month,
        ending_tm.tm_hour = hour;
        ending_tm.tm_min = 59;
        today_end_t = icaltime_from_timet_with_zone(mktime(&ending_tm), 0, icaltimezone_get_utc_timezone());
-       today_end_t.is_utc = 1;
+/*     today_end_t.is_utc = 1;*/
 
        /* Now loop through our list of events to see which ones occur today.
         */
@@ -681,6 +683,7 @@ void calendar_day_view_display_events(time_t thetime, int year, int month,
                q = icalcomponent_get_first_property(Cal->cal, ICAL_DTSTART_PROPERTY);
                if (q != NULL) {
                        t = icalproperty_get_dtstart(q);
+                       event_tt = icaltime_as_timet(t);
                }
                else {
                        memset(&t, 0, sizeof t);
@@ -701,6 +704,7 @@ void calendar_day_view_display_events(time_t thetime, int year, int month,
                else
                {
                        show_event = ical_ctdl_is_overlap(t, end_t, today_start_t, today_end_t);
+                       localtime_r(&event_tt, &event_te);
                }
 
                /* If we determined that this event occurs today, then display it.
@@ -716,17 +720,22 @@ void calendar_day_view_display_events(time_t thetime, int year, int month,
                        }
                        else 
                        {
+                               event_tte = icaltime_as_timet(end_t);
+                               localtime_r(&event_tte, &event_tm);
+                               if (hour == event_te.tm_hour) {
                                wprintf("<dd  class=\"event\" "
                                        "style=\"position: absolute; "
                                        "top:%dpx; left:100px; "
                                        "height:%dpx; \" >",
-                                       (100 + (event_tm.tm_min / 2) + (event_te.tm_hour - hour) + (hour * 30) - (dstart * 30)),
-                                       (((event_te.tm_min - event_tm.tm_min) / 2) +(event_te.tm_hour - hour) * 30)
-                               );
-                               wprintf("<a href=\"display_edit_event?msgnum=%ld&calview=day&year=%d&month=%d&day=%d&hour=%d\">",
-                                       Cal->cal_msgnum, year, month, day, hour);
+                                       ((dstart * 11) + (event_te.tm_hour - dstart) * (event_te.tm_hour < dstart? 11 : 31)),
+                                       ((event_tm.tm_hour - event_te.tm_hour) * 30)
+                                       );
+                               wprintf("<a href=\"display_edit_event?msgnum=%ld&calview=day&year=%d&month=%d&day=%d&hour=%d&case=%d\">",
+                                       Cal->cal_msgnum, year, month, day, t.hour, hour);
                                escputs((char *) icalproperty_get_comment(p));
                                wprintf("</a></dd>\n");
+                               }
+                               
                        }
                }
        }
index d24bad9362b4420dace350e6435a3482522681ce..45e52b7558cc9c9c3cc2348048a26a29ca3c08bc 100644 (file)
@@ -1169,9 +1169,17 @@ td.events_of_the_day {
 }
 
 .event {
-       opacity: .5;
+       filter:alpha(opacity=50);   /* Internet Explorer 6     */
+       -moz-opacity:0.5;           /* Mozilla 1.6 and prec.   */
+       opacity: 0.5;               /* CSS3 and Mozilla  */
        border: solid 1px red;
        background-color: yellow;
        z-index: 10;
 }
 
+.event a {
+   filter:alpha(opacity=100); 
+   -moz-opacity:1.0;         
+   opacity: 1.0;            
+}
+