*/
#include "webcit.h"
+#include "calendar.h"
/*
* Display today's date in a friendly format
message_summary *Msg;
wcsession *WCC = WC;
StrBuf *Buf;
+ SharedMessageStatus Stat;
+
+ memset(&Stat, 0, sizeof(SharedMessageStatus));
+ Stat.maxload = 10000;
+ Stat.lowest_found = (-1);
+ Stat.highest_found = (-1);
Buf = NewStrBufPlain(HKEY("_TASKS_"));
gotoroom(Buf);
num_msgs = 0;
}
else {
- num_msgs = load_msg_ptrs("MSGS ALL", 0, NULL, NULL);
+ num_msgs = load_msg_ptrs("MSGS ALL", &Stat);
}
if (num_msgs > 0) {
at = GetNewHashPos(WCC->summ, 0);
while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
Msg = (message_summary*) vMsg;
- display_task(Msg, 0);
+ tasks_LoadMsgFromServer(NULL, NULL, Msg, 0, 0);
}
DeleteHashPos(&at);
}
* Calendar section
*/
void calendar_section(void) {
+ char cmd[SIZ];
int num_msgs = 0;
HashPos *at;
const char *HashKey;
void *vMsg;
message_summary *Msg;
wcsession *WCC = WC;
- struct calview c;
StrBuf *Buf;
-
+ void *v = NULL;
+ SharedMessageStatus Stat;
+
+ memset(&Stat, 0, sizeof(SharedMessageStatus));
+ Stat.maxload = 10000;
+ Stat.lowest_found = (-1);
+ Stat.highest_found = (-1);
+
Buf = NewStrBufPlain(HKEY("_CALENDAR_"));
gotoroom(Buf);
FreeStrBuf(&Buf);
num_msgs = 0;
}
else {
- num_msgs = load_msg_ptrs("MSGS ALL", 0, NULL, NULL);
+ num_msgs = load_msg_ptrs("MSGS ALL", &Stat);
}
-
- parse_calendar_view_request(&c);
+ calendar_GetParamsGetServerCall(&Stat,
+ &v,
+ readnew,
+ cmd,
+ sizeof(cmd));
if (num_msgs > 0) {
at = GetNewHashPos(WCC->summ, 0);
while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) {
Msg = (message_summary*) vMsg;
- load_calendar_item(Msg, 0, &c);
+ calendar_LoadMsgFromServer(NULL, &v, Msg, 0, 0);
}
DeleteHashPos(&at);
}
wprintf(_("(Nothing)"));
wprintf("</i><br />\n");
}
+ __calendar_Cleanup(&v);
}
/*
InitModule_SUMMARY
(void)
{
- WebcitAddUrlHandler(HKEY("new_messages_html"), new_messages_section, AJAX);
- WebcitAddUrlHandler(HKEY("tasks_inner_html"), tasks_section, AJAX);
- WebcitAddUrlHandler(HKEY("calendar_inner_html"), calendar_section, AJAX);
- WebcitAddUrlHandler(HKEY("mini_calendar"), ajax_mini_calendar, AJAX);
- WebcitAddUrlHandler(HKEY("summary"), summary, 0);
- WebcitAddUrlHandler(HKEY("summary_inner_div"), summary_inner_div, AJAX);
+ WebcitAddUrlHandler(HKEY("new_messages_html"), "", 0, new_messages_section, AJAX);
+ WebcitAddUrlHandler(HKEY("tasks_inner_html"), "", 0, tasks_section, AJAX);
+ WebcitAddUrlHandler(HKEY("calendar_inner_html"), "", 0, calendar_section, AJAX);
+ WebcitAddUrlHandler(HKEY("mini_calendar"), "", 0, ajax_mini_calendar, AJAX);
+ WebcitAddUrlHandler(HKEY("summary"), "", 0, summary, 0);
+ WebcitAddUrlHandler(HKEY("summary_inner_div"), "", 0, summary_inner_div, AJAX);
}