5 * \defgroup CalHtmlHandles Handles the HTML display of calendar items.
10 #include "webserver.h"
12 #ifndef WEBCIT_WITH_CALENDAR_SERVICE
14 /**\brief stub for non-libical builds */
15 void do_calendar_view(void) {
16 wprintf("<CENTER><I>");
17 wprintf(_("The calendar view is not available."));
18 wprintf("</I></CENTER><br />\n");
21 /**\brief stub for non-libical builds */
22 void do_tasks_view(void) {
23 wprintf("<CENTER><I>");
24 wprintf(_("The tasks view is not available."));
25 wprintf("</I></CENTER><br />\n");
28 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
30 /****************************************************************************/
33 * \brief Display one day of a whole month view of a calendar
34 * \param thetime the month we want to see
36 void calendar_month_view_display_events(time_t thetime) {
42 struct icaltimetype t;
44 int all_day_event = 0;
46 if (WC->num_cal == 0) {
47 wprintf("<br /><br /><br />\n");
51 localtime_r(&thetime, &today_tm);
52 month = today_tm.tm_mon + 1;
53 day = today_tm.tm_mday;
54 year = today_tm.tm_year + 1900;
56 for (i=0; i<(WC->num_cal); ++i) {
57 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
58 ICAL_DTSTART_PROPERTY);
60 t = icalproperty_get_dtstart(p);
61 event_tt = icaltime_as_timet(t);
63 if (t.is_date) all_day_event = 1;
64 else all_day_event = 0;
67 gmtime_r(&event_tt, &event_tm);
70 localtime_r(&event_tt, &event_tm);
73 if ((event_tm.tm_year == today_tm.tm_year)
74 && (event_tm.tm_mon == today_tm.tm_mon)
75 && (event_tm.tm_mday == today_tm.tm_mday)) {
77 p = icalcomponent_get_first_property(
79 ICAL_SUMMARY_PROPERTY);
83 wprintf("<TABLE border=0 cellpadding=2><TR>"
84 "<TD BGCOLOR=\"#CCCCDD\">"
88 wprintf("<FONT SIZE=-1>"
89 "<a href=\"display_edit_event?msgnum=%ld&calview=%s&year=%s&month=%s&day=%s\">",
90 WC->disp_cal[i].cal_msgnum,
97 icalproperty_get_comment(p));
98 wprintf("</A></FONT><br />\n");
101 wprintf("</TD></TR></TABLE>");
115 * \brief Display one day of a whole month view of a calendar
116 * \param thetime the month we want to see
118 void calendar_month_view_brief_events(time_t thetime, const char *daycolor) {
128 struct icaltimetype t;
129 int month, day, year;
130 int all_day_event = 0;
131 char calhourformat[16];
134 get_preference("calhourformat", calhourformat, sizeof calhourformat);
135 if (!strcasecmp(calhourformat, "24")) timeformat="%k:%M";
136 else timeformat="%I:%M %p";
138 localtime_r(&thetime, &today_tm);
139 month = today_tm.tm_mon + 1;
140 day = today_tm.tm_mday;
141 year = today_tm.tm_year + 1900;
143 for (i=0; i<(WC->num_cal); ++i) {
144 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
145 ICAL_DTSTART_PROPERTY);
147 t = icalproperty_get_dtstart(p);
148 event_tt = icaltime_as_timet(t);
150 if (t.is_date) all_day_event = 1;
151 else all_day_event = 0;
154 gmtime_r(&event_tts, &event_tms);
157 localtime_r(&event_tts, &event_tms);
159 /** \todo epoch &! daymask */
160 if ((event_tms.tm_year == today_tm.tm_year)
161 && (event_tms.tm_mon == today_tm.tm_mon)
162 && (event_tms.tm_mday == today_tm.tm_mday)) {
168 p = icalcomponent_get_first_property(
170 ICAL_SUMMARY_PROPERTY);
171 e = icalcomponent_get_first_property(
173 ICAL_DTEND_PROPERTY);
174 if ((p != NULL) && (e != NULL)) {
177 t = icalproperty_get_dtend(e);
178 event_tte = icaltime_as_timet(t);
179 localtime_r(&event_tte, &event_tme);
180 difftime=(event_tte-event_tts)/60;
181 hours=(int)(difftime / 60);
182 minutes=difftime % 60;
183 wprintf("<tr><td bgcolor='%s'>%i:%i</td><td bgcolor='%s'>"
185 "<a href=\"display_edit_event?msgnum=%ld&calview=%s&year=%s&month=%s&day=%s\">",
189 WC->disp_cal[i].cal_msgnum,
197 icalproperty_get_comment(p));
198 /** \todo: allso ammitime format */
199 strftime(&sbuf[0],sizeof(sbuf),timeformat,&event_tms);
200 strftime(&ebuf[0],sizeof(sbuf),timeformat,&event_tme);
202 wprintf("</a></font></td>"
203 "<td bgcolor='%s'>%s</td><td bgcolor='%s'>%s</td></tr>",
220 * \brief view one month. pretty view
221 * \param year the year
222 * \param month the month
223 * \param day the actual day we want to see
225 void calendar_month_view(int year, int month, int day) {
226 struct tm starting_tm;
230 time_t previous_month;
233 /** Determine what day to start.
234 * First, back up to the 1st of the month...
236 memset(&starting_tm, 0, sizeof(struct tm));
237 starting_tm.tm_year = year - 1900;
238 starting_tm.tm_mon = month - 1;
239 starting_tm.tm_mday = day;
240 thetime = mktime(&starting_tm);
242 memcpy(&tm, &starting_tm, sizeof(struct tm));
243 while (tm.tm_mday != 1) {
244 thetime = thetime - (time_t)86400; /* go back 24 hours */
245 localtime_r(&thetime, &tm);
248 /** Determine previous and next months ... for links */
249 previous_month = thetime - (time_t)864000L; /* back 10 days */
250 next_month = thetime + (time_t)(31L * 86400L); /* ahead 31 days */
252 /** Now back up until we're on a Sunday */
253 localtime_r(&thetime, &tm);
254 while (tm.tm_wday != 0) {
255 thetime = thetime - (time_t)86400; /* go back 24 hours */
256 localtime_r(&thetime, &tm);
259 /** Outer table (to get the background color) */
260 wprintf("<div class=\"fix_scrollbar_bug\">"
261 "<TABLE width=100%% border=0 cellpadding=0 cellspacing=0 "
262 "bgcolor=#204B78><TR><TD>\n");
264 wprintf("<TABLE width=100%% border=0 cellpadding=0 cellspacing=0><tr>\n");
266 wprintf("<TD ALIGN=CENTER>");
268 localtime_r(&previous_month, &tm);
269 wprintf("<a href=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
270 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
271 wprintf("<IMG ALIGN=MIDDLE src=\"static/prevdate_32x.gif\" BORDER=0></A>\n");
273 wprintf(" "
274 "<FONT SIZE=+1 COLOR=\"#FFFFFF\">"
277 " ", months[month-1], year);
279 localtime_r(&next_month, &tm);
280 wprintf("<a href=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
281 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
282 wprintf("<IMG ALIGN=MIDDLE src=\"static/nextdate_32x.gif\" BORDER=0></A>\n");
284 wprintf("</TD></TR></TABLE>\n");
286 /** Inner table (the real one) */
287 wprintf("<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
288 "bgcolor=#204B78><TR>");
289 for (i=0; i<7; ++i) {
290 wprintf("<TD ALIGN=CENTER WIDTH=14%%>"
291 "<FONT COLOR=\"#FFFFFF\">%s</FONT></TH>", wdays[i]);
295 /** Now do 35 days */
296 for (i = 0; i < 35; ++i) {
297 localtime_r(&thetime, &tm);
299 /** Before displaying Sunday, start a new row */
304 wprintf("<TD BGCOLOR=\"#%s\" WIDTH=14%% HEIGHT=60 align=left VALIGN=TOP><B>",
305 ((tm.tm_mon != month-1) ? "DDDDDD" :
306 ((tm.tm_wday==0 || tm.tm_wday==6) ? "EEEECC" :
309 if ((i==0) || (tm.tm_mday == 1)) {
310 wprintf("%s ", months[tm.tm_mon]);
312 wprintf("<a href=\"readfwd?calview=day&year=%d&month=%d&day=%d\">"
319 /** put the data here, stupid */
320 calendar_month_view_display_events(thetime);
324 /** After displaying Saturday, end the row */
329 thetime += (time_t)86400; /** ahead 24 hours */
332 wprintf("</TABLE>" /** end of inner table */
333 "</TD></TR></TABLE>" /** end of outer table */
338 * \brief view one month. brief view
339 * \param year the year
340 * \param month the month
341 * \param day the actual day we want to see
343 void calendar_brief_month_view(int year, int month, int day) {
344 struct tm starting_tm;
348 time_t previous_month;
351 /** Determine what day to start.
352 * First, back up to the 1st of the month...
354 memset(&starting_tm, 0, sizeof(struct tm));
355 starting_tm.tm_year = year - 1900;
356 starting_tm.tm_mon = month - 1;
357 starting_tm.tm_mday = day;
358 thetime = mktime(&starting_tm);
360 memcpy(&tm, &starting_tm, sizeof(struct tm));
361 while (tm.tm_mday != 1) {
362 thetime = thetime - (time_t)86400; /* go back 24 hours */
363 localtime_r(&thetime, &tm);
366 /** Determine previous and next months ... for links */
367 previous_month = thetime - (time_t)864000L; /* back 10 days */
368 next_month = thetime + (time_t)(31L * 86400L); /* ahead 31 days */
370 /** Now back up until we're on a Sunday */
371 localtime_r(&thetime, &tm);
372 while (tm.tm_wday != 0) {
373 thetime = thetime - (time_t)86400; /* go back 24 hours */
374 localtime_r(&thetime, &tm);
377 /** Outer table (to get the background color) */
378 wprintf("<div class=\"fix_scrollbar_bug\">"
379 "<TABLE width=100%% border=0 cellpadding=0 cellspacing=0 "
380 "bgcolor=#204B78><TR><TD>\n");
382 wprintf("<TABLE width=100%% border=0 cellpadding=0 cellspacing=0><tr>\n");
384 wprintf("<TD ALIGN=CENTER>");
386 localtime_r(&previous_month, &tm);
387 wprintf("<a href=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
388 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
389 wprintf("<IMG ALIGN=MIDDLE src=\"static/prevdate_32x.gif\" BORDER=0></A>\n");
391 wprintf(" "
392 "<FONT SIZE=+1 COLOR=\"#FFFFFF\">"
395 " ", months[month-1], year);
397 localtime_r(&next_month, &tm);
398 wprintf("<a href=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
399 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
400 wprintf("<IMG ALIGN=MIDDLE src=\"static/nextdate_32x.gif\" BORDER=0></A>\n");
402 wprintf("</TD></TR></TABLE>\n");
404 /** Inner table (the real one) */
405 wprintf("<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
406 "bgcolor=#EEEECC><TR>");
408 wprintf("<TR><TD COLSPAN=\"100%\">\n");
410 /** Now do 35 days */
411 for (i = 0; i < 35; ++i) {
412 char weeknumber[255];
414 localtime_r(&thetime, &tm);
417 /** Before displaying Sunday, start a new CELL */
419 strftime(&weeknumber[0],sizeof(weeknumber),"%U",&tm);
420 wprintf("<TABLE border='0' BGCOLOR=\"#EEEECC\" width='100%'> <tr><th colspan='4'>%s %s</th></tr>"
421 " <tr><td>%s</td><td width='70%'>%s</td><td>%s</td><td>%s</td></tr>\n",
431 daycolor=((tm.tm_mon != month-1) ? "DDDDDD" :
432 ((tm.tm_wday==0 || tm.tm_wday==6) ? "EEEECC" :
436 wprintf("<tr><td BGCOLOR='%s' colspan='1' align='left'> %s</td><td BGCOLOR='%s' colspan='3'><hr></td></tr>\n",
441 /** put the data of one day here, stupid */
442 calendar_month_view_brief_events(thetime, daycolor);
445 /** After displaying Saturday, end the row */
447 wprintf("</td></tr></table>\n");
450 thetime += (time_t)86400; /** ahead 24 hours */
453 wprintf("</TABLE>" /** end of inner table */
454 "</TD></TR></TABLE>" /** end of outer table */
459 * \brief view one week
460 * this should view just one week, but it's not here yet.
461 * \todo ny implemented
462 * \param year the year
463 * \param month the month
464 * \param day the day which we want to see the week around
466 void calendar_week_view(int year, int month, int day) {
467 wprintf("<CENTER><I>week view FIXME</I></CENTER><br />\n");
472 * \brief display one day
473 * Display events for a particular hour of a particular day.
474 * (Specify hour < 0 to show "all day" events)
475 * \param year the year
476 * \param month the month
478 * \param hour the hour we want to start displaying?????
480 void calendar_day_view_display_events(int year, int month,
484 struct icaltimetype t;
487 int all_day_event = 0;
489 if (WC->num_cal == 0) {
490 // \todo FIXME wprintf("<br /><br /><br />\n");
494 for (i=0; i<(WC->num_cal); ++i) {
495 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
496 ICAL_DTSTART_PROPERTY);
498 t = icalproperty_get_dtstart(p);
499 event_tt = icaltime_as_timet(t);
508 event_tm = gmtime(&event_tt);
511 event_tm = localtime(&event_tt);
514 if ((event_tm->tm_year == (year-1900))
515 && (event_tm->tm_mon == (month-1))
516 && (event_tm->tm_mday == day)
517 && ( ((event_tm->tm_hour == hour)&&(!t.is_date)) || ((hour<0)&&(t.is_date)) )
521 p = icalcomponent_get_first_property(
523 ICAL_SUMMARY_PROPERTY);
527 wprintf("<TABLE border=1 cellpadding=2><TR>"
528 "<TD BGCOLOR=\"#CCCCCC\">"
532 wprintf("<FONT SIZE=-1>"
533 "<a href=\"display_edit_event?msgnum=%ld&calview=day&year=%d&month=%d&day=%d\">",
534 WC->disp_cal[i].cal_msgnum,
538 icalproperty_get_comment(p));
539 wprintf("</A></FONT><br />\n");
542 wprintf("</TD></TR></TABLE>");
555 * \brief view one day
556 * \param year the year
557 * \param month the month
558 * \param day the day we want to display
560 void calendar_day_view(int year, int month, int day) {
562 struct icaltimetype today, yesterday, tomorrow;
563 char calhourformat[16];
566 char daystart_str[16], dayend_str[16];
568 get_preference("calhourformat", calhourformat, sizeof calhourformat);
569 get_preference("daystart", daystart_str, sizeof daystart_str);
570 if (strlen(daystart_str) > 0) daystart = atoi(daystart_str);
571 get_preference("dayend", dayend_str, sizeof dayend_str);
572 if (strlen(dayend_str) > 0) dayend = atoi(dayend_str);
575 /** Figure out the dates for "yesterday" and "tomorrow" links */
577 memset(&today, 0, sizeof(struct icaltimetype));
583 memcpy(&yesterday, &today, sizeof(struct icaltimetype));
585 yesterday = icaltime_normalize(yesterday);
587 memcpy(&tomorrow, &today, sizeof(struct icaltimetype));
589 tomorrow = icaltime_normalize(tomorrow);
592 /** Outer table (to get the background color) */
593 wprintf("<div class=\"fix_scrollbar_bug\">"
594 "<TABLE width=100%% border=0 cellpadding=0 cellspacing=0 "
595 "bgcolor=#204B78><TR><TD>\n");
597 /** Inner table (the real one) */
598 wprintf("<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
599 "bgcolor=#204B78><TR>\n");
601 /** Innermost table (contains hours etc.) */
602 wprintf("<TD WIDTH=80%%>"
603 "<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
604 "bgcolor=#204B78>\n");
606 /** Display events before 8:00 (hour=-1 is all-day events) */
608 "<TD BGCOLOR=\"#CCCCDD\" VALIGN=MIDDLE WIDTH=10%%></TD>"
609 "<TD BGCOLOR=\"#FFFFFF\" VALIGN=TOP>");
610 for (hour = (-1); hour <= (daystart-1); ++hour) {
611 calendar_day_view_display_events(year, month, day, hour);
613 wprintf("</TD></TR>\n");
615 /** Now the middle of the day... */
616 for (hour = daystart; hour <= dayend; ++hour) { /* could do HEIGHT=xx */
617 wprintf("<TR HEIGHT=30><TD BGCOLOR=\"#CCCCDD\" ALIGN=MIDDLE "
618 "VALIGN=MIDDLE WIDTH=10%%>");
619 wprintf("<a href=\"display_edit_event?msgnum=0"
620 "&year=%d&month=%d&day=%d&hour=%d&minute=0\">",
621 year, month, day, hour
624 if (!strcasecmp(calhourformat, "24")) {
625 wprintf("%2d:00</A> ", hour);
628 wprintf("%d:00%s</A> ",
629 (hour <= 12 ? hour : hour-12),
630 (hour < 12 ? "am" : "pm")
634 wprintf("</TD><TD BGCOLOR=\"#FFFFFF\" VALIGN=TOP>");
636 /* put the data here, stupid */
637 calendar_day_view_display_events(year, month, day, hour);
639 wprintf("</TD></TR>\n");
642 /** Display events after 5:00... */
644 "<TD BGCOLOR=\"#CCCCDD\" VALIGN=MIDDLE WIDTH=10%%></TD>"
645 "<TD BGCOLOR=\"#FFFFFF\" VALIGN=TOP>");
646 for (hour = (dayend+1); hour <= 23; ++hour) {
647 calendar_day_view_display_events(year, month, day, hour);
649 wprintf("</TD></TR>\n");
652 wprintf("</TABLE>" /* end of innermost table */
656 wprintf("<TD WIDTH=20%% VALIGN=top>"); /* begin stuff-on-the-right */
659 /** Begin todays-date-with-left-and-right-arrows */
660 wprintf("<TABLE BORDER=0 WIDTH=100%% "
661 "CELLSPACING=0 CELLPADDING=0 BGCOLOR=\"#FFFFFF\">\n");
665 wprintf("<TD ALIGN=CENTER>");
666 wprintf("<a href=\"readfwd?calview=day&year=%d&month=%d&day=%d\">",
667 yesterday.year, yesterday.month, yesterday.day);
668 wprintf("<IMG ALIGN=MIDDLE src=\"static/prevdate_32x.gif\" BORDER=0></A>");
672 wprintf("<TD ALIGN=CENTER>");
673 wprintf("<FONT SIZE=+2>%s</FONT><br />"
674 "<FONT SIZE=+3>%d</FONT><br />"
675 "<FONT SIZE=+2>%d</FONT><br />",
676 months[month-1], day, year);
680 wprintf("<TD ALIGN=CENTER>");
681 wprintf("<a href=\"readfwd?calview=day&year=%d&month=%d&day=%d\">",
682 tomorrow.year, tomorrow.month, tomorrow.day);
683 wprintf("<IMG ALIGN=MIDDLE src=\"static/nextdate_32x.gif\""
687 wprintf("</TR></TABLE>\n");
688 /** End todays-date-with-left-and-right-arrows */
690 /** \todo In the future we might want to put a month-o-matic here */
692 wprintf("</FONT></CENTER>\n");
694 wprintf("</TD>"); /** end stuff-on-the-right */
698 wprintf("</TR></TABLE>" /** end of inner table */
699 "</TD></TR></TABLE></div>" /** end of outer table */
707 * \brief Display today's events.
709 void calendar_summary_view(void) {
712 struct icaltimetype t;
717 int all_day_event = 0;
718 char timestring[SIZ];
720 if (WC->num_cal == 0) {
725 localtime_r(&now, &today_tm);
727 for (i=0; i<(WC->num_cal); ++i) {
728 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
729 ICAL_DTSTART_PROPERTY);
731 t = icalproperty_get_dtstart(p);
732 event_tt = icaltime_as_timet(t);
739 fmt_time(timestring, event_tt);
742 gmtime_r(&event_tt, &event_tm);
745 localtime_r(&event_tt, &event_tm);
748 if ( (event_tm.tm_year == today_tm.tm_year)
749 && (event_tm.tm_mon == today_tm.tm_mon)
750 && (event_tm.tm_mday == today_tm.tm_mday)
754 p = icalcomponent_get_first_property(
756 ICAL_SUMMARY_PROPERTY);
759 icalproperty_get_comment(p));
760 wprintf(" (%s)<br />\n", timestring);
765 free_calendar_buffer();
770 * \brief clean up ical memory
771 * \todo this could get troubel with future ical versions
773 void free_calendar_buffer(void) {
775 if (WC->num_cal) for (i=0; i<(WC->num_cal); ++i) {
776 icalcomponent_free(WC->disp_cal[i].cal);
786 * \brief do the whole calendar page
787 * view any part of the calender. decide which way, etc.
789 void do_calendar_view(void) {
792 int year, month, day;
795 /** In case no date was specified, go with today */
797 localtime_r(&now, &tm);
798 year = tm.tm_year + 1900;
799 month = tm.tm_mon + 1;
802 /** Now see if a date was specified */
803 if (strlen(bstr("year")) > 0) year = atoi(bstr("year"));
804 if (strlen(bstr("month")) > 0) month = atoi(bstr("month"));
805 if (strlen(bstr("day")) > 0) day = atoi(bstr("day"));
807 /** How would you like that cooked? */
808 if (strlen(bstr("calview")) > 0) {
809 strcpy(calview, bstr("calview"));
812 strcpy(calview, "month");
815 /** Display the selected view */
816 if (!strcasecmp(calview, "day")) {
817 calendar_day_view(year, month, day);
819 else if (!strcasecmp(calview, "week")) {
820 calendar_week_view(year, month, day);
823 if (WC->wc_view == VIEW_CALBRIEF) {
824 calendar_brief_month_view(year, month, day);
827 calendar_month_view(year, month, day);
831 /** Free the calendar stuff */
832 free_calendar_buffer();
838 * \brief get task due date
839 * Helper function for do_tasks_view().
840 * \param vtodo a task to get the due date
841 * \return the date/time due.
843 time_t get_task_due_date(icalcomponent *vtodo) {
851 * If we're looking at a fully encapsulated VCALENDAR
852 * rather than a VTODO component, recurse into the data
853 * structure until we get a VTODO.
855 if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
856 return get_task_due_date(
857 icalcomponent_get_first_component(
858 vtodo, ICAL_VTODO_COMPONENT
863 p = icalcomponent_get_first_property(vtodo, ICAL_DUE_PROPERTY);
865 return(icaltime_as_timet(icalproperty_get_due(p)));
874 * \brief Compare the due dates of two tasks (this is for sorting)
875 * \param task1 first task to compare
876 * \param task2 second task to compare
878 int task_due_cmp(const void *task1, const void *task2) {
882 t1 = get_task_due_date(((struct disp_cal *)task1)->cal);
883 t2 = get_task_due_date(((struct disp_cal *)task2)->cal);
885 if (t1 < t2) return(-1);
886 if (t1 > t2) return(1);
894 * \brief do the whole task view stuff
896 void do_tasks_view(void) {
903 wprintf("<div class=\"fix_scrollbar_bug\">"
904 "<table border=0 cellspacing=0 width=100%% bgcolor=\"#FFFFFF\">\n<tr>\n"
906 wprintf(_("Name of task"));
907 wprintf("</TH><TH>");
908 wprintf(_("Date due"));
909 wprintf("</TH></TR>\n"
912 /** Sort them if necessary */
913 if (WC->num_cal > 1) {
916 sizeof(struct disp_cal),
921 if (WC->num_cal) for (i=0; i<(WC->num_cal); ++i) {
924 wprintf("<TR BGCOLOR=\"#%s\"><TD>",
925 (bg ? "DDDDDD" : "FFFFFF")
928 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
929 ICAL_SUMMARY_PROPERTY);
930 wprintf("<a href=\"display_edit_task?msgnum=%ld&taskrm=",
931 WC->disp_cal[i].cal_msgnum );
932 urlescputs(WC->wc_roomname);
934 wprintf("<IMG ALIGN=MIDDLE "
935 "src=\"static/taskmanag_16x.gif\" BORDER=0> ");
937 escputs((char *)icalproperty_get_comment(p));
942 due = get_task_due_date(WC->disp_cal[i].cal);
943 fmt_date(buf, due, 0);
944 wprintf("<TD><FONT");
945 if (due < time(NULL)) {
946 wprintf(" COLOR=\"#FF0000\"");
948 wprintf(">%s</FONT></TD></TR>\n", buf);
951 wprintf("</table></div>\n");
954 free_calendar_buffer();
958 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */