From: Thierry Pasqualier Date: Sun, 14 Oct 2007 09:41:00 +0000 (+0000) Subject: Daily vue of Calendar. X-Git-Tag: v7.86~2960 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=ece4bfc2c527bc277660b782d4c4b9969f987f1c Daily vue of Calendar. 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 --- diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index ae4cc32de..7e5337f45 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -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("
", - (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("", - 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("", + Cal->cal_msgnum, year, month, day, t.hour, hour); escputs((char *) icalproperty_get_comment(p)); wprintf("
\n"); + } + } } } diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index d24bad936..45e52b755 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -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; +} +