+
+ if ((event_te.tm_mday != day) || (event_tm.tm_mday != day)) ongoing_event = 1;
+
+ if (all_day_event && notime_events)
+ {
+ wc_printf("<li class=\"event_framed%s\"> "
+ "<a href=\"display_edit_event?"
+ "msgnum=%ld?calview=day?year=%d?month=%d?day=%d\" "
+ " class=\"event_title\">"
+ ,
+ (Cal->unread)?"_unread":"_read",
+ Cal->cal_msgnum, year, month, day
+ );
+ escputs((char *) icalproperty_get_comment(p));
+ wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
+ wc_printf("<i>%s</i><br>", _("All day event"));
+ wc_printf("<i>%s: %s</i><br>", _("From"), Cal->from);
+ wc_printf("<i>%s</i> ", _("Summary:"));
+ escputs((char *) icalproperty_get_comment(p));
+ wc_printf("<br>");
+ q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
+ if (q) {
+ wc_printf("<i>%s</i> ", _("Location:"));
+ escputs((char *)icalproperty_get_comment(q));
+ wc_printf("<br>");
+ }
+ if (!icaltime_compare(t, end_t)) { /* one day only */
+ webcit_fmt_date(buf, 256, event_tt, DATEFMT_LOCALEDATE);
+ wc_printf("<i>%s</i> %s<br>", _("Date:"), buf);
+ }
+ else {
+ webcit_fmt_date(buf, 256, event_tt, DATEFMT_LOCALEDATE);
+ wc_printf("<i>%s</i> %s<br>", _("Starting date:"), buf);
+ webcit_fmt_date(buf, 256, event_tte, DATEFMT_LOCALEDATE);
+ wc_printf("<i>%s</i> %s<br>", _("Ending date:"), buf);
+ }
+ q = icalcomponent_get_first_property(Cal->cal,ICAL_DESCRIPTION_PROPERTY);
+ if (q) {
+ wc_printf("<i>%s</i> ", _("Notes:"));
+ escputs((char *)icalproperty_get_comment(q));
+ wc_printf("<br>");
+ }
+ wc_printf("</span><span class=\"bttbottom\"></span></span>");
+ wc_printf("</a> <span>(");
+ wc_printf(_("All day event"));
+ wc_printf(")</span></li>\n");
+ }
+ else if (ongoing_event && notime_events)
+ {
+ wc_printf("<li class=\"event_framed%s\"> "
+ "<a href=\"display_edit_event?"
+ "msgnum=%ld&calview=day?year=%d?month=%d?day=%d\" "
+ " class=\"event_title\">"
+ ,
+ (Cal->unread)?"_unread":"_read",
+ Cal->cal_msgnum, year, month, day
+ );
+ escputs((char *) icalproperty_get_comment(p));
+ wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
+ wc_printf("<i>%s</i><br>", _("Ongoing event"));
+ wc_printf("<i>%s: %s</i><br>", _("From"), Cal->from);
+ wc_printf("<i>%s</i> ", _("Summary:"));
+ escputs((char *) icalproperty_get_comment(p));
+ wc_printf("<br>");
+ q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
+ if (q) {
+ wc_printf("<i>%s</i> ", _("Location:"));
+ escputs((char *)icalproperty_get_comment(q));
+ wc_printf("<br>");
+ }
+ webcit_fmt_date(buf, 256, event_tt, DATEFMT_BRIEF);
+ wc_printf("<i>%s</i> %s<br>", _("Starting date/time:"), buf);
+ webcit_fmt_date(buf, 256, event_tte, DATEFMT_BRIEF);
+ wc_printf("<i>%s</i> %s<br>", _("Ending date/time:"), buf);
+ q = icalcomponent_get_first_property(Cal->cal,ICAL_DESCRIPTION_PROPERTY);
+ if (q) {
+ wc_printf("<i>%s</i> ", _("Notes:"));
+ escputs((char *)icalproperty_get_comment(q));
+ wc_printf("<br>");
+ }
+ wc_printf("</span><span class=\"bttbottom\"></span></span>");
+ wc_printf("</a> <span>(");
+ wc_printf(_("Ongoing event"));
+ wc_printf(")</span></li>\n");
+ }
+ else if (!all_day_event && !notime_events)
+ {
+ gap++;
+
+ if (event_te.tm_mday != day) event_te.tm_hour = 0;
+ if (event_tm.tm_mday != day) event_tm.tm_hour = 24;
+
+ /* Calculate the location of the top of the box */
+ if (event_te.tm_hour < dstart) {
+ startmin = diffmin = event_te.tm_min / 6;
+ top = (event_te.tm_hour * EXTRATIMELINE) + startmin;
+ }
+ else if ((event_te.tm_hour >= dstart) && (event_te.tm_hour <= dend)) {
+ startmin = diffmin = (event_te.tm_min / 2);
+ top = (dstart * EXTRATIMELINE) + ((event_te.tm_hour - dstart) * TIMELINE) + startmin;
+ }
+ else if (event_te.tm_hour >dend) {
+ startmin = diffmin = event_te.tm_min / 6;
+ top = (dstart * EXTRATIMELINE) + ((dend - dstart - 1) * TIMELINE) + ((event_tm.tm_hour - dend + 1) * EXTRATIMELINE) + startmin ;
+ }
+ else {
+ /* should never get here */
+ }
+
+ /* Calculate the location of the bottom of the box */
+ if (event_tm.tm_hour < dstart) {
+ endmin = diffmin = event_tm.tm_min / 6;
+ bottom = (event_tm.tm_hour * EXTRATIMELINE) + endmin;
+ }
+ else if ((event_tm.tm_hour >= dstart) && (event_tm.tm_hour <= dend)) {
+ endmin = diffmin = (event_tm.tm_min / 2);
+ bottom = (dstart * EXTRATIMELINE) + ((event_tm.tm_hour - dstart) * TIMELINE) + endmin ;
+ }
+ else if (event_tm.tm_hour >dend) {
+ endmin = diffmin = event_tm.tm_min / 6;
+ bottom = (dstart * EXTRATIMELINE) + ((dend - dstart + 1) * TIMELINE) + ((event_tm.tm_hour - dend - 1) * EXTRATIMELINE) + endmin;
+ }
+ else {
+ /* should never get here */
+ }
+
+ wc_printf("<dd class=\"event_framed%s\" "
+ "style=\"position: absolute; "
+ "top:%dpx; left:%dpx; "
+ "height:%dpx; \" >",
+ (Cal->unread)?"_unread":"_read",
+ top, (gap * 40), (bottom-top)
+ );
+ wc_printf("<a href=\"display_edit_event?"
+ "msgnum=%ld?calview=day?year=%d?month=%d?day=%d?hour=%d\" "
+ "class=\"event_title\">"
+ ,
+ Cal->cal_msgnum, year, month, day, t.hour
+ );
+ escputs((char *) icalproperty_get_comment(p));
+ wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
+ wc_printf("<i>%s: %s</i><br>", _("From"), Cal->from);
+ wc_printf("<i>%s</i> ", _("Summary:"));
+ escputs((char *) icalproperty_get_comment(p));
+ wc_printf("<br>");
+ q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
+ if (q) {
+ wc_printf("<i>%s</i> ", _("Location:"));
+ escputs((char *)icalproperty_get_comment(q));
+ wc_printf("<br>");
+ }
+ if (!icaltime_compare(t, end_t)) { /* one day only */
+ webcit_fmt_date(buf, 256, event_tt, DATEFMT_BRIEF);
+ wc_printf("<i>%s</i> %s<br>", _("Date/time:"), buf);
+ }
+ else {
+ webcit_fmt_date(buf, 256, event_tt, DATEFMT_BRIEF);
+ wc_printf("<i>%s</i> %s<br>", _("Starting date/time:"), buf);
+ webcit_fmt_date(buf, 256, event_tte, DATEFMT_BRIEF);
+ wc_printf("<i>%s</i> %s<br>", _("Ending date/time:"), buf);
+ }
+ q = icalcomponent_get_first_property(Cal->cal,ICAL_DESCRIPTION_PROPERTY);
+ if (q) {
+ wc_printf("<i>%s</i> ", _("Notes:"));
+ escputs((char *)icalproperty_get_comment(q));
+ wc_printf("<br>");
+ }
+ wc_printf("</span><span class=\"bttbottom\"></span></span>");
+ wc_printf("</a></dd>\n");