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:%2i</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 wc_strftime(&sbuf[0], sizeof(sbuf), timeformat, &event_tms);
200 wc_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;
232 time_t colheader_time;
233 struct tm colheader_tm;
234 char colheader_label[32];
236 /** Determine what day to start.
237 * First, back up to the 1st of the month...
239 memset(&starting_tm, 0, sizeof(struct tm));
240 starting_tm.tm_year = year - 1900;
241 starting_tm.tm_mon = month - 1;
242 starting_tm.tm_mday = day;
243 thetime = mktime(&starting_tm);
245 memcpy(&tm, &starting_tm, sizeof(struct tm));
246 while (tm.tm_mday != 1) {
247 thetime = thetime - (time_t)86400; /* go back 24 hours */
248 localtime_r(&thetime, &tm);
251 /** Determine previous and next months ... for links */
252 previous_month = thetime - (time_t)864000L; /* back 10 days */
253 next_month = thetime + (time_t)(31L * 86400L); /* ahead 31 days */
255 /** Now back up until we're on a Sunday */
256 localtime_r(&thetime, &tm);
257 while (tm.tm_wday != 0) {
258 thetime = thetime - (time_t)86400; /* go back 24 hours */
259 localtime_r(&thetime, &tm);
262 /** Outer table (to get the background color) */
263 wprintf("<div class=\"fix_scrollbar_bug\">"
264 "<table width=100%% border=0 cellpadding=0 cellspacing=0 "
265 "bgcolor=#204B78><TR><TD>\n");
267 wprintf("<table width=100%% border=0 cellpadding=0 cellspacing=0><tr>\n");
269 wprintf("<td align=center>");
271 localtime_r(&previous_month, &tm);
272 wprintf("<a href=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
273 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
274 wprintf("<img align=middle src=\"static/prevdate_32x.gif\" border=0></A>\n");
276 wc_strftime(colheader_label, sizeof colheader_label, "%B", &starting_tm);
277 wprintf(" "
278 "<font size=+1 color=\"#FFFFFF\">"
281 " ", colheader_label, year);
283 localtime_r(&next_month, &tm);
284 wprintf("<a href=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
285 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
286 wprintf("<img align=middle src=\"static/nextdate_32x.gif\" border=0></A>\n");
288 wprintf("</td></tr></table>\n");
290 /** Inner table (the real one) */
291 wprintf("<table width=100%% border=0 cellpadding=1 cellspacing=1 "
292 "bgcolor=#204B78><tr>");
293 colheader_time = thetime;
294 for (i=0; i<7; ++i) {
295 colheader_time = thetime + (i * 86400) ;
296 localtime_r(&colheader_time, &colheader_tm);
297 wc_strftime(colheader_label, sizeof colheader_label, "%A", &colheader_tm);
298 wprintf("<td align=center width=14%%>"
299 "<font color=\"#FFFFFF\">%s</font></th>", colheader_label);
304 /** Now do 35 days */
305 for (i = 0; i < 35; ++i) {
306 localtime_r(&thetime, &tm);
308 /** Before displaying Sunday, start a new row */
313 wprintf("<td bgcolor=\"#%s\" width=14%% height=60 align=left valign=top><b>",
314 ((tm.tm_mon != month-1) ? "DDDDDD" :
315 ((tm.tm_wday==0 || tm.tm_wday==6) ? "EEEECC" :
318 if ((i==0) || (tm.tm_mday == 1)) {
319 wc_strftime(colheader_label, sizeof colheader_label, "%B", &tm);
320 wprintf("%s ", colheader_label);
322 wprintf("<a href=\"readfwd?calview=day&year=%d&month=%d&day=%d\">"
329 /** put the data here, stupid */
330 calendar_month_view_display_events(thetime);
334 /** After displaying Saturday, end the row */
339 thetime += (time_t)86400; /** ahead 24 hours */
342 wprintf("</table>" /** end of inner table */
343 "</td></tr></table>" /** end of outer table */
348 * \brief view one month. brief view
349 * \param year the year
350 * \param month the month
351 * \param day the actual day we want to see
353 void calendar_brief_month_view(int year, int month, int day) {
354 struct tm starting_tm;
358 time_t previous_month;
360 char month_label[32];
362 /** Determine what day to start.
363 * First, back up to the 1st of the month...
365 memset(&starting_tm, 0, sizeof(struct tm));
366 starting_tm.tm_year = year - 1900;
367 starting_tm.tm_mon = month - 1;
368 starting_tm.tm_mday = day;
369 thetime = mktime(&starting_tm);
371 memcpy(&tm, &starting_tm, sizeof(struct tm));
372 while (tm.tm_mday != 1) {
373 thetime = thetime - (time_t)86400; /* go back 24 hours */
374 localtime_r(&thetime, &tm);
377 /** Determine previous and next months ... for links */
378 previous_month = thetime - (time_t)864000L; /* back 10 days */
379 next_month = thetime + (time_t)(31L * 86400L); /* ahead 31 days */
381 /** Now back up until we're on a Sunday */
382 localtime_r(&thetime, &tm);
383 while (tm.tm_wday != 0) {
384 thetime = thetime - (time_t)86400; /* go back 24 hours */
385 localtime_r(&thetime, &tm);
388 /** Outer table (to get the background color) */
389 wprintf("<div class=\"fix_scrollbar_bug\">"
390 "<table width=100%% border=0 cellpadding=0 cellspacing=0 "
391 "bgcolor=#204B78><TR><TD>\n");
393 wprintf("<table width=100%% border=0 cellpadding=0 cellspacing=0><tr>\n");
395 wprintf("<td align=center>");
397 localtime_r(&previous_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/prevdate_32x.gif\" border=0></A>\n");
402 wc_strftime(month_label, sizeof month_label, "%B", &tm);
403 wprintf(" "
404 "<font size=+1 color=\"#FFFFFF\">"
407 " ", month_label, year);
409 localtime_r(&next_month, &tm);
410 wprintf("<a href=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
411 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
412 wprintf("<img align=middle src=\"static/nextdate_32x.gif\" border=0></A>\n");
414 wprintf("</td></tr></table>\n");
416 /** Inner table (the real one) */
417 wprintf("<table width=100%% border=0 cellpadding=1 cellspacing=1 "
418 "bgcolor=#EEEECC><TR>");
420 wprintf("<tr><td colspan=\"100%\">\n");
422 /** Now do 35 days */
423 for (i = 0; i < 35; ++i) {
424 char weeknumber[255];
425 char weekday_name[32];
427 localtime_r(&thetime, &tm);
430 /** Before displaying Sunday, start a new CELL */
432 wc_strftime(&weeknumber[0], sizeof(weeknumber), "%U", &tm);
433 wprintf("<table border='0' bgcolor=\"#EEEECC\" width='100%'> <tr><th colspan='4'>%s %s</th></tr>"
434 " <tr><td>%s</td><td width='70%'>%s</td><td>%s</td><td>%s</td></tr>\n",
444 daycolor=((tm.tm_mon != month-1) ? "DDDDDD" :
445 ((tm.tm_wday==0 || tm.tm_wday==6) ? "EEEECC" :
449 wc_strftime(weekday_name, sizeof weekday_name, "%A", &tm);
450 wprintf("<tr><td bgcolor='%s' colspan='1' align='left'> %s,%i."
451 "</td><td bgcolor='%s' colspan='3'><hr></td></tr>\n",
453 weekday_name,tm.tm_mday,
456 /** put the data of one day here, stupid */
457 calendar_month_view_brief_events(thetime, daycolor);
460 /** After displaying Saturday, end the row */
462 wprintf("</td></tr></table>\n");
465 thetime += (time_t)86400; /** ahead 24 hours */
468 wprintf("</table>" /** end of inner table */
469 "</td></tr></table>" /** end of outer table */
474 * \brief view one week
475 * this should view just one week, but it's not here yet.
476 * \todo ny implemented
477 * \param year the year
478 * \param month the month
479 * \param day the day which we want to see the week around
481 void calendar_week_view(int year, int month, int day) {
482 wprintf("<center><i>week view FIXME</i></center><br />\n");
487 * \brief display one day
488 * Display events for a particular hour of a particular day.
489 * (Specify hour < 0 to show "all day" events)
490 * \param year the year
491 * \param month the month
493 * \param hour the hour we want to start displaying?????
495 void calendar_day_view_display_events(int year, int month,
499 struct icaltimetype t;
502 int all_day_event = 0;
504 if (WC->num_cal == 0) {
505 // \todo FIXME wprintf("<br /><br /><br />\n");
509 for (i=0; i<(WC->num_cal); ++i) {
510 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
511 ICAL_DTSTART_PROPERTY);
513 t = icalproperty_get_dtstart(p);
514 event_tt = icaltime_as_timet(t);
523 event_tm = gmtime(&event_tt);
526 event_tm = localtime(&event_tt);
529 if ((event_tm->tm_year == (year-1900))
530 && (event_tm->tm_mon == (month-1))
531 && (event_tm->tm_mday == day)
532 && ( ((event_tm->tm_hour == hour)&&(!t.is_date)) || ((hour<0)&&(t.is_date)) )
536 p = icalcomponent_get_first_property(
538 ICAL_SUMMARY_PROPERTY);
542 wprintf("<table border=1 cellpadding=2><TR>"
543 "<td bgcolor=\"#CCCCCC\">"
547 wprintf("<font size=-1>"
548 "<a href=\"display_edit_event?msgnum=%ld&calview=day&year=%d&month=%d&day=%d\">",
549 WC->disp_cal[i].cal_msgnum,
553 icalproperty_get_comment(p));
554 wprintf("</a></font><br />\n");
557 wprintf("</td></tr></table>");
570 * \brief view one day
571 * \param year the year
572 * \param month the month
573 * \param day the day we want to display
575 void calendar_day_view(int year, int month, int day) {
577 struct icaltimetype today, yesterday, tomorrow;
578 char calhourformat[16];
581 char daystart_str[16], dayend_str[16];
585 get_preference("calhourformat", calhourformat, sizeof calhourformat);
586 get_preference("daystart", daystart_str, sizeof daystart_str);
587 if (strlen(daystart_str) > 0) daystart = atoi(daystart_str);
588 get_preference("dayend", dayend_str, sizeof dayend_str);
589 if (strlen(dayend_str) > 0) dayend = atoi(dayend_str);
592 /** Figure out the dates for "yesterday" and "tomorrow" links */
594 memset(&today, 0, sizeof(struct icaltimetype));
600 memcpy(&yesterday, &today, sizeof(struct icaltimetype));
602 yesterday = icaltime_normalize(yesterday);
604 memcpy(&tomorrow, &today, sizeof(struct icaltimetype));
606 tomorrow = icaltime_normalize(tomorrow);
609 /** Outer table (to get the background color) */
610 wprintf("<div class=\"fix_scrollbar_bug\">"
611 "<table width=100%% border=0 cellpadding=0 cellspacing=0 "
612 "bgcolor=#204B78><tr><td>\n");
614 /** Inner table (the real one) */
615 wprintf("<table width=100%% border=0 cellpadding=1 cellspacing=1 "
616 "bgcolor=#204B78><tr>\n");
618 /** Innermost table (contains hours etc.) */
619 wprintf("<td width=80%%>"
620 "<table width=100%% border=0 cellpadding=1 cellspacing=1 "
621 "bgcolor=#204B78>\n");
623 /** Display events before 8:00 (hour=-1 is all-day events) */
625 "<td bgcolor=\"#CCCCDD\" valign=middle width=10%%></td>"
626 "<td bgcolor=\"#FFFFFF\" valign=top>");
627 for (hour = (-1); hour <= (daystart-1); ++hour) {
628 calendar_day_view_display_events(year, month, day, hour);
630 wprintf("</td></tr>\n");
632 /** Now the middle of the day... */
633 for (hour = daystart; hour <= dayend; ++hour) { /* could do HEIGHT=xx */
634 wprintf("<tr height=30><td bgcolor=\"#CCCCDD\" align=middle "
635 "valign=middle width=10%%>");
636 wprintf("<a href=\"display_edit_event?msgnum=0"
637 "&year=%d&month=%d&day=%d&hour=%d&minute=0\">",
638 year, month, day, hour
641 if (!strcasecmp(calhourformat, "24")) {
642 wprintf("%2d:00</a> ", hour);
645 wprintf("%d:00%s</a> ",
646 (hour <= 12 ? hour : hour-12),
647 (hour < 12 ? "am" : "pm")
651 wprintf("</td><td bgcolor=\"#FFFFFF\" valign=top>");
653 /* put the data here, stupid */
654 calendar_day_view_display_events(year, month, day, hour);
656 wprintf("</td></tr>\n");
659 /** Display events after 5:00... */
661 "<td bgcolor=\"#CCCCDD\" valign=middle width=10%%></td>"
662 "<td bgcolor=\"#FFFFFF\" valign=top>");
663 for (hour = (dayend+1); hour <= 23; ++hour) {
664 calendar_day_view_display_events(year, month, day, hour);
666 wprintf("</td></tr>\n");
669 wprintf("</table>" /* end of innermost table */
673 wprintf("<td width=20%% valign=top>"); /* begin stuff-on-the-right */
676 /** Begin todays-date-with-left-and-right-arrows */
677 wprintf("<table border=0 width=100%% "
678 "cellspacing=0 cellpadding=0 bgcolor=\"#FFFFFF\">\n");
682 wprintf("<td align=center>");
683 wprintf("<a href=\"readfwd?calview=day&year=%d&month=%d&day=%d\">",
684 yesterday.year, yesterday.month, yesterday.day);
685 wprintf("<img align=middle src=\"static/prevdate_32x.gif\" border=0></A>");
689 memset(&d_tm, 0, sizeof d_tm);
690 d_tm.tm_year = year - 1900;
691 d_tm.tm_mon = month - 1;
693 wc_strftime(d_str, sizeof d_str,
695 "<font size=+2>%B</font><br />"
696 "<font size=+3>%d</font><br />"
697 "<font size=+2>%Y</font><br />"
701 wprintf("%s", d_str);
704 wprintf("<td align=center>");
705 wprintf("<a href=\"readfwd?calview=day&year=%d&month=%d&day=%d\">",
706 tomorrow.year, tomorrow.month, tomorrow.day);
707 wprintf("<img align=middle src=\"static/nextdate_32x.gif\""
711 wprintf("</tr></table>\n");
712 /** End todays-date-with-left-and-right-arrows */
714 /** \todo In the future we might want to put a month-o-matic here */
716 wprintf("</font></center>\n");
718 wprintf("</td>"); /** end stuff-on-the-right */
722 wprintf("</tr></table>" /** end of inner table */
723 "</td></tr></table></div>" /** end of outer table */
731 * \brief Display today's events.
733 void calendar_summary_view(void) {
736 struct icaltimetype t;
741 int all_day_event = 0;
742 char timestring[SIZ];
744 if (WC->num_cal == 0) {
749 localtime_r(&now, &today_tm);
751 for (i=0; i<(WC->num_cal); ++i) {
752 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
753 ICAL_DTSTART_PROPERTY);
755 t = icalproperty_get_dtstart(p);
756 event_tt = icaltime_as_timet(t);
763 fmt_time(timestring, event_tt);
766 gmtime_r(&event_tt, &event_tm);
769 localtime_r(&event_tt, &event_tm);
772 if ( (event_tm.tm_year == today_tm.tm_year)
773 && (event_tm.tm_mon == today_tm.tm_mon)
774 && (event_tm.tm_mday == today_tm.tm_mday)
778 p = icalcomponent_get_first_property(
780 ICAL_SUMMARY_PROPERTY);
783 icalproperty_get_comment(p));
784 wprintf(" (%s)<br />\n", timestring);
789 free_calendar_buffer();
794 * \brief clean up ical memory
795 * \todo this could get troubel with future ical versions
797 void free_calendar_buffer(void) {
799 if (WC->num_cal) for (i=0; i<(WC->num_cal); ++i) {
800 icalcomponent_free(WC->disp_cal[i].cal);
810 * \brief do the whole calendar page
811 * view any part of the calender. decide which way, etc.
813 void do_calendar_view(void) {
816 int year, month, day;
819 /** In case no date was specified, go with today */
821 localtime_r(&now, &tm);
822 year = tm.tm_year + 1900;
823 month = tm.tm_mon + 1;
826 /** Now see if a date was specified */
827 if (strlen(bstr("year")) > 0) year = atoi(bstr("year"));
828 if (strlen(bstr("month")) > 0) month = atoi(bstr("month"));
829 if (strlen(bstr("day")) > 0) day = atoi(bstr("day"));
831 /** How would you like that cooked? */
832 if (strlen(bstr("calview")) > 0) {
833 strcpy(calview, bstr("calview"));
836 strcpy(calview, "month");
839 /** Display the selected view */
840 if (!strcasecmp(calview, "day")) {
841 calendar_day_view(year, month, day);
843 else if (!strcasecmp(calview, "week")) {
844 calendar_week_view(year, month, day);
847 if (WC->wc_view == VIEW_CALBRIEF) {
848 calendar_brief_month_view(year, month, day);
851 calendar_month_view(year, month, day);
855 /** Free the calendar stuff */
856 free_calendar_buffer();
862 * \brief get task due date
863 * Helper function for do_tasks_view().
864 * \param vtodo a task to get the due date
865 * \return the date/time due.
867 time_t get_task_due_date(icalcomponent *vtodo) {
875 * If we're looking at a fully encapsulated VCALENDAR
876 * rather than a VTODO component, recurse into the data
877 * structure until we get a VTODO.
879 if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
880 return get_task_due_date(
881 icalcomponent_get_first_component(
882 vtodo, ICAL_VTODO_COMPONENT
887 p = icalcomponent_get_first_property(vtodo, ICAL_DUE_PROPERTY);
889 return(icaltime_as_timet(icalproperty_get_due(p)));
898 * \brief Compare the due dates of two tasks (this is for sorting)
899 * \param task1 first task to compare
900 * \param task2 second task to compare
902 int task_due_cmp(const void *task1, const void *task2) {
906 t1 = get_task_due_date(((struct disp_cal *)task1)->cal);
907 t2 = get_task_due_date(((struct disp_cal *)task2)->cal);
909 if (t1 < t2) return(-1);
910 if (t1 > t2) return(1);
918 * \brief do the whole task view stuff
920 void do_tasks_view(void) {
927 wprintf("<div class=\"fix_scrollbar_bug\">"
928 "<table border=0 cellspacing=0 width=100%% bgcolor=\"#FFFFFF\">\n<tr>\n"
930 wprintf(_("Name of task"));
931 wprintf("</th><th>");
932 wprintf(_("Date due"));
933 wprintf("</th></tr>\n"
936 /** Sort them if necessary */
937 if (WC->num_cal > 1) {
940 sizeof(struct disp_cal),
945 if (WC->num_cal) for (i=0; i<(WC->num_cal); ++i) {
948 wprintf("<tr bgcolor=\"#%s\"><td>",
949 (bg ? "DDDDDD" : "FFFFFF")
952 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
953 ICAL_SUMMARY_PROPERTY);
954 wprintf("<a href=\"display_edit_task?msgnum=%ld&taskrm=",
955 WC->disp_cal[i].cal_msgnum );
956 urlescputs(WC->wc_roomname);
958 wprintf("<img align=middle "
959 "src=\"static/taskmanag_16x.gif\" border=0> ");
961 escputs((char *)icalproperty_get_comment(p));
966 due = get_task_due_date(WC->disp_cal[i].cal);
967 fmt_date(buf, due, 0);
968 wprintf("<td><font");
969 if (due < time(NULL)) {
970 wprintf(" color=\"#FF0000\"");
972 wprintf(">%s</font></td></tr>\n", buf);
975 wprintf("</table></div>\n");
978 free_calendar_buffer();
982 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */