Pos = GetNewHashPos(WCC->disp_cal_items, 0);
while (GetNextHashPos(WCC->disp_cal_items, Pos, &hklen, &HashKey, &vCal)) {
Cal = (disp_cal*)vCal;
- p = icalcomponent_get_first_property(Cal->cal,
- ICAL_DTSTART_PROPERTY);
+ p = icalcomponent_get_first_property(Cal->cal, ICAL_DTSTART_PROPERTY);
if (p != NULL) {
t = icalproperty_get_dtstart(p);
event_tt = icaltime_as_timet(t);
if ( (event_tm.tm_year == today_tm.tm_year)
&& (event_tm.tm_mon == today_tm.tm_mon)
- && (event_tm.tm_mday == today_tm.tm_mday)
+ && (event_tm.tm_mday == today_tm.tm_mday)
) {
+ p = icalcomponent_get_first_property(Cal->cal, ICAL_SUMMARY_PROPERTY);
+ if (p != NULL) {
- p = icalcomponent_get_first_property(
- Cal->cal,
- ICAL_SUMMARY_PROPERTY);
- if (p != NULL) {
- escputs((char *)
- icalproperty_get_comment(p));
- wprintf(" (%s)<br />\n", timestring);
- }
+
+ if (WCC->wc_view == VIEW_TASKS) {
+ wprintf("<a href=\"display_edit_task"
+ "?msgnum=%ld"
+ "?return_to_summary=1"
+ "?gotofirst=",
+ Cal->cal_msgnum
+ );
+ escputs(ChrPtr(WCC->wc_roomname));
+ wprintf("\">");
+ }
+ else {
+ wprintf("<a href=\"display_edit_event"
+ "?msgnum=%ld"
+ "?calview=summary"
+ "?year=%d"
+ "?month=%d"
+ "?day=%d"
+ "?gotofirst=",
+ Cal->cal_msgnum,
+ today_tm.tm_year + 1900,
+ today_tm.tm_mon + 1,
+ today_tm.tm_mday
+ );
+ escputs(ChrPtr(WCC->wc_roomname));
+ wprintf("\">");
+ }
+ escputs((char *) icalproperty_get_comment(p));
+ wprintf(" (%s)</a><br />\n", timestring);
+ }
}
}
}
DeleteHash(&WC->disp_cal_items);
}
-
/*
* Parse the URL variables in order to determine the scope and display of a calendar view
*/
else if (!strcasecmp(calview, "week")) {
c->view = calview_week;
}
+ else if (!strcasecmp(calview, "summary")) { /* shouldn't ever happen, but just in case */
+ c->view = calview_day;
+ }
else {
if (WC->wc_view == VIEW_CALBRIEF) {
c->view = calview_brief;
if (c->view == calview_brief) span = 3888000;
if (c->view == calview_week) span = 604800;
if (c->view == calview_day) span = 86400;
+ if (c->view == calview_summary) span = 86400;
c->lower_bound = now - span;
c->upper_bound = now + span;
wprintf("disabled=\"disabled\">\n</td><td>");
p = icalcomponent_get_first_property(Cal->cal,
ICAL_SUMMARY_PROPERTY);
- wprintf("<a href=\"display_edit_task?msgnum=%ld&taskrm=",
- Cal->cal_msgnum );
- urlescputs(WC->wc_roomname);
+ wprintf("<a href=\"display_edit_task?msgnum=%ld?taskrm=", Cal->cal_msgnum);
+ urlescputs(ChrPtr(WC->wc_roomname));
wprintf("\">");
/* wprintf("<img align=middle "
"src=\"static/taskmanag_16x.gif\" border=0> "); */