From: Thierry Pasqualier Date: Tue, 23 Oct 2007 17:22:19 +0000 (+0000) Subject: implemented Bubble Tooltips on calendar day view X-Git-Tag: v7.86~2926 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=44e721c9efc9cc12e32144b369c4b4e20fac40b6 implemented Bubble Tooltips on calendar day view correct the default hour value to create an event --- diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index ffa6356d6..52632d3ad 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -804,6 +804,10 @@ void calendar_day_view_display_events(time_t thetime, int year, int month, int diffmin = 0; int endmin = 0; + char buf[256]; + struct tm d_tm; + char d_str[32]; + if (WCC->num_cal == 0) { // \todo FIXME wprintf("


\n"); return; @@ -875,29 +879,76 @@ void calendar_day_view_display_events(time_t thetime, int year, int month, /* If we determined that this event occurs today, then display it. */ p = icalcomponent_get_first_property(Cal->cal,ICAL_SUMMARY_PROPERTY); + if ((show_event) && (p != NULL)) { if ((event_te.tm_mday != today_start_t.day) && (event_tm.tm_mday != today_start_t.day)) ongoing_event = 1; if (all_day_event) { - wprintf("
  • " - "", - Cal->cal_msgnum, year, month, day, hour); - escputs((char *) icalproperty_get_comment(p)); - wprintf(" ("); - wprintf(_("All day event")); - wprintf(")
  • \n"); + wprintf("
  • " + "cal_msgnum, year, month, day, hour); + wprintf("%s
    ", _("All day event")); + wprintf("%s ", _("Summary:")); + escputs((char *) icalproperty_get_comment(p)); + wprintf("
    "); + q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY); + if (q) { + wprintf("%s ", _("Location:")); + escputs((char *)icalproperty_get_comment(q)); + wprintf("
    "); + } + memset(&d_tm, 0, sizeof d_tm); + d_tm.tm_year = t.year - 1900; + d_tm.tm_mon = t.month - 1; + d_tm.tm_mday = t.day; + wc_strftime(d_str, sizeof d_str, "%x", &d_tm); + wprintf("%s %s
    ",_("Date:"), d_str); + q = icalcomponent_get_first_property(Cal->cal,ICAL_DESCRIPTION_PROPERTY); + if (q) { + wprintf("%s ", _("Notes:")); + escputs((char *)icalproperty_get_comment(q)); + wprintf("
    "); + } + wprintf("\">"); + escputs((char *) icalproperty_get_comment(p)); + wprintf("
    ("); + wprintf(_("All day event")); + wprintf(")
  • \n"); } else if (ongoing_event && (hour == -1)) { wprintf("
  • " "", - Cal->cal_msgnum, year, month, day, hour); + " class=\"event_title\" " + "btt_tooltext=\"", + Cal->cal_msgnum, year, month, day, hour); + wprintf("%s
    ", _("Ongoing event")); + wprintf("%s ", _("Summary:")); + escputs((char *) icalproperty_get_comment(p)); + wprintf("
    "); + q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY); + if (q) { + wprintf("%s ", _("Location:")); + escputs((char *)icalproperty_get_comment(q)); + wprintf("
    "); + } + fmt_date(buf, event_tt, 1); + wprintf("%s %s
    ", _("Starting date/time:"), buf); + fmt_date(buf, event_tte, 1); + wprintf("%s %s
    ", _("Ending date/time:"), buf); + q = icalcomponent_get_first_property(Cal->cal,ICAL_DESCRIPTION_PROPERTY); + if (q) { + wprintf("%s ", _("Notes:")); + escputs((char *)icalproperty_get_comment(q)); + wprintf("
    "); + } + wprintf("\">"); escputs((char *) icalproperty_get_comment(p)); wprintf("
    ("); wprintf(_("Ongoing event")); @@ -944,7 +995,7 @@ void calendar_day_view_display_events(time_t thetime, int year, int month, if ((event_te.tm_hour > dend) && (event_tm.tm_hour > dend)) { startmin = diffmin = event_te.tm_min / 6; endmin = event_tm.tm_min / 6; - top = (dstart * 10) + ((dend - dstart + 1) * 30) + ((event_tm.tm_hour - event_te.tm_hour) * 10) + startmin - 1; + top = (dstart * 10) + ((dend - dstart) * 30) + ((event_tm.tm_hour - event_te.tm_hour) * 10) + startmin - 1; height = ((event_tm.tm_hour - event_te.tm_hour) * 10) + endmin - diffmin; } wprintf("
    ", + "class=\"event_title\" " + "btt_tooltext=\"", Cal->cal_msgnum, year, month, day, t.hour, hour); + wprintf("%s ", _("Summary:")); + escputs((char *) icalproperty_get_comment(p)); + wprintf("
    "); + q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY); + if (q) { + wprintf("%s ", _("Location:")); + escputs((char *)icalproperty_get_comment(q)); + wprintf("
    "); + } + fmt_date(buf, event_tt, 1); + wprintf("%s %s
    ", _("Starting date/time:"), buf); + fmt_date(buf, event_tte, 1); + wprintf("%s %s
    ", _("Ending date/time:"), buf); + q = icalcomponent_get_first_property(Cal->cal,ICAL_DESCRIPTION_PROPERTY); + if (q) { + wprintf("%s ", _("Notes:")); + escputs((char *)icalproperty_get_comment(q)); + wprintf("
    "); + } + wprintf("\">"); + escputs((char *) icalproperty_get_comment(p)); wprintf("
    \n"); } diff --git a/webcit/event.c b/webcit/event.c index 5b89dbf46..ad729ae5e 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -233,7 +233,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) * from the start time. */ t_end = t_start; - t_end.hour += 1; + t_end.hour += 0; t_end.second = 0; t_end = icaltime_normalize(t_end); /* t_end = icaltime_from_timet(now, 0); */