*/
#include "webcit.h"
+#include "calendar.h"
/*
* Display today's date in a friendly format
long HKLen;
void *vMsg;
message_summary *Msg;
- struct wcsession *WCC = WC;
-
- gotoroom("_TASKS_");
+ wcsession *WCC = WC;
+ StrBuf *Buf;
+ SharedMessageStatus Stat;
+
+ memset(&Stat, 0, sizeof(SharedMessageStatus));
+ Buf = NewStrBufPlain(HKEY("_TASKS_"));
+ gotoroom(Buf);
+ FreeStrBuf(&Buf);
if (WCC->wc_view != VIEW_TASKS) {
num_msgs = 0;
}
else {
- num_msgs = load_msg_ptrs("MSGS ALL", 0);
+ num_msgs = load_msg_ptrs("MSGS ALL", &Stat);
}
- if (num_msgs < 1) {
- wprintf("<i>");
- wprintf(_("(None)"));
- wprintf("</i><br />\n");
- }
- else {
- at = GetNewHashPos();
+ 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_summary_view();
+ if (calendar_summary_view() < 1) {
+ wprintf("<i>");
+ wprintf(_("(None)"));
+ wprintf("</i><br />\n");
+ }
}
* Calendar section
*/
void calendar_section(void) {
+ char cmd[SIZ];
int num_msgs = 0;
HashPos *at;
const char *HashKey;
long HKLen;
void *vMsg;
message_summary *Msg;
- struct wcsession *WCC = WC;
- struct calview c;
-
- gotoroom("_CALENDAR_");
+ wcsession *WCC = WC;
+ calview c;
+ StrBuf *Buf;
+ void *v = &c;
+ SharedMessageStatus Stat;
+
+ memset(&Stat, 0, sizeof(SharedMessageStatus));
+ Buf = NewStrBufPlain(HKEY("_CALENDAR_"));
+ gotoroom(Buf);
+ FreeStrBuf(&Buf);
if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
num_msgs = 0;
}
else {
- num_msgs = load_msg_ptrs("MSGS ALL", 0);
+ num_msgs = load_msg_ptrs("MSGS ALL", &Stat);
}
-
- parse_calendar_view_request(&c);
-
- if (num_msgs < 1) {
- wprintf("<i>");
- wprintf(_("(Nothing)"));
- wprintf("</i><br />\n");
- }
- else {
- at = GetNewHashPos();
+ calendar_GetParamsGetServerCall(&Stat,
+ &c,
+ 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);
}
- calendar_summary_view();
+ DeleteHashPos(&at);
+ }
+ if (calendar_summary_view() < 1) {
+ wprintf("<i>");
+ wprintf(_("(Nothing)"));
+ wprintf("</i><br />\n");
}
}
*/
void server_info_section(void) {
char message[512];
+ wcsession *WCC = WC;
snprintf(message, sizeof message,
_("You are connected to %s, running %s with %s, server build %s and located in %s. Your system administrator is %s."),
- serv_info.serv_humannode,
- serv_info.serv_software,
- PACKAGE_STRING,
- serv_info.serv_svn_revision,
- serv_info.serv_bbs_city,
- serv_info.serv_sysadm);
+ ChrPtr(WCC->serv_info->serv_humannode),
+ ChrPtr(WCC->serv_info->serv_software),
+ PACKAGE_STRING,
+ ChrPtr(WCC->serv_info->serv_svn_revision),
+ ChrPtr(WCC->serv_info->serv_bbs_city),
+ ChrPtr(WCC->serv_info->serv_sysadm));
escputs(message);
}
wprintf("<div class=\"room_banner\">");
wprintf("<img src=\"static/summscreen_48x.gif\">");
wprintf("<h1>");
- snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
+ snprintf(title, sizeof title, _("Summary page for %s"), ChrPtr(WC->wc_fullname));
escputs(title);
wprintf("</h1><h2>");
output_date();
wprintf("</h2></div>");
+ wprintf("<div id=\"actiondiv\">");
wprintf("<ul class=\"room_actions\">\n");
wprintf("<li class=\"start_page\">");
- offer_start_page(NULL, 0, NULL, NULL, CTX_NONE);
+ offer_start_page(NULL, &NoCtx);
wprintf("</li></ul>");
wprintf("</div>");
+ wprintf("</div>");
/*
* You guessed it ... we're going to refresh using ajax.