* \param cal Our calendar to process
* \param msgnum number of the mesage in our db
*/
-void display_individual_cal(icalcomponent *cal, long msgnum)
+void display_individual_cal(icalcomponent *cal, long msgnum, char *from, int unread)
{
struct wcsession *WCC = WC; /* stack this for faster access (WC is a function) */
WCC->num_cal += 1;
WCC->disp_cal = realloc(WC->disp_cal, (sizeof(struct disp_cal) * WCC->num_cal) );
WCC->disp_cal[WCC->num_cal - 1].cal = icalcomponent_new_clone(cal);
+ WCC->disp_cal[WCC->num_cal - 1].unread = unread;
+ WCC->disp_cal[WCC->num_cal - 1].from = malloc (strlen(from) + 1);
+ strcpy (WCC->disp_cal[WCC->num_cal - 1].from, from);
ical_dezonify(WCC->disp_cal[WCC->num_cal - 1].cal);
WCC->disp_cal[WCC->num_cal - 1].cal_msgnum = msgnum;
}
* \param supplied_vtodo the todo item we want to edit
* \param msgnum number of the mesage in our db
*/
-void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
+void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum, char *from, int unread) {
icalcomponent *vtodo;
icalproperty *p;
struct icaltimetype t;
display_edit_individual_task(
icalcomponent_get_first_component(
vtodo, ICAL_VTODO_COMPONENT
- ), msgnum
+ ),
+ msgnum,
+ from, unread
);
return;
}
* \param supplied_vtodo the task to save
* \param msgnum number of the mesage in our db
*/
-void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
+void save_individual_task(icalcomponent *supplied_vtodo, long msgnum, char* from, int unread) {
char buf[SIZ];
int delete_existing = 0;
icalproperty *prop;
if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
save_individual_task(
icalcomponent_get_first_component(
- vtodo, ICAL_VTODO_COMPONENT
- ), msgnum
+ vtodo, ICAL_VTODO_COMPONENT),
+ msgnum, from, unread
);
return;
}
* \param callback a funcion \todo
*
*/
-void display_using_handler(long msgnum,
- icalcomponent_kind which_kind,
- void (*callback)(icalcomponent *, long)
+void display_using_handler(long msgnum, int unread,
+ icalcomponent_kind which_kind,
+ void (*callback)(icalcomponent *, long, char*, int)
) {
char buf[1024];
+ char from[128] = "";
char mime_partnum[256];
char mime_filename[256];
char mime_content_type[256];
strcpy(relevant_partnum, mime_partnum);
}
}
+ else if (!strncasecmp(buf, "from=", 4)) {
+ extract_token(from, buf, 1, '=', sizeof(from));
+ }
}
if (!IsEmptyStr(relevant_partnum)) {
/** Simple components of desired type */
if (icalcomponent_isa(cal) == which_kind) {
- callback(cal, msgnum);
+ callback(cal, msgnum, from, unread);
}
/** Subcomponents of desired type */
(c != 0);
c = icalcomponent_get_next_component(cal,
which_kind)) {
- callback(c, msgnum);
+ callback(c, msgnum, from, unread);
}
icalcomponent_free(cal);
}
* \brief display whole calendar
* \param msgnum number of the mesage in our db
*/
-void display_calendar(long msgnum) {
- display_using_handler(msgnum,
+void display_calendar(long msgnum, int unread) {
+ display_using_handler(msgnum, unread,
ICAL_VEVENT_COMPONENT,
display_individual_cal);
}
* \brief display whole taksview
* \param msgnum number of the mesage in our db
*/
-void display_task(long msgnum) {
- display_using_handler(msgnum,
+void display_task(long msgnum, int unread) {
+ display_using_handler(msgnum, unread,
ICAL_VTODO_COMPONENT,
display_individual_cal);
}
msgnum = atol(bstr("msgnum"));
if (msgnum > 0L) {
/** existing task */
- display_using_handler(msgnum,
+ display_using_handler(msgnum, 0,
ICAL_VTODO_COMPONENT,
display_edit_individual_task);
}
else {
/** new task */
- display_edit_individual_task(NULL, 0L);
+ display_edit_individual_task(NULL, 0L, "", 0);
}
}
msgnum = atol(bstr("msgnum"));
if (msgnum > 0L) {
- display_using_handler(msgnum,
+ display_using_handler(msgnum, 0,
ICAL_VTODO_COMPONENT,
save_individual_task);
}
else {
- save_individual_task(NULL, 0L);
+ save_individual_task(NULL, 0L, "", 0);
}
}
msgnum = atol(bstr("msgnum"));
if (msgnum > 0L) {
/* existing event */
- display_using_handler(msgnum,
+ display_using_handler(msgnum, 0,
ICAL_VEVENT_COMPONENT,
display_edit_individual_event);
}
else {
/* new event */
- display_edit_individual_event(NULL, 0L);
+ display_edit_individual_event(NULL, 0L, "", 0);
}
}
msgnum = atol(bstr("msgnum"));
if (msgnum > 0L) {
- display_using_handler(msgnum,
+ display_using_handler(msgnum, 0,
ICAL_VEVENT_COMPONENT,
save_individual_event);
}
else {
- save_individual_event(NULL, 0L);
+ save_individual_event(NULL, 0L, "", 0);
}
}
}
wprintf("<font size=-1>"
- "<a href=\"display_edit_event?"
+ "<a class=\"event%s\" href=\"display_edit_event?"
"msgnum=%ld&calview=month&year=%d&month=%d&day=%d\""
" btt_tooltext=\"",
+ (Cal->unread)?"_unread":"_read",
WC->disp_cal[i].cal_msgnum,
year, month, day
);
- wprintf("<i>%s</i> ", _("Summary:"));
+ wprintf("<i>%s: %s</i><br />", _("From"), Cal->from);
+ wprintf("<i>%s</i> ", _("Summary:"));
escputs((char *)icalproperty_get_comment(p));
wprintf("<br />");
time_t event_tt;
time_t event_tts;
time_t event_tte;
+ struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */
struct tm event_tms;
struct tm event_tme;
struct tm today_tm;
icalproperty *p;
icalproperty *e;
struct icaltimetype t;
+ struct disp_cal *Cal;
int month, day, year;
int all_day_event = 0;
char *timeformat;
year = today_tm.tm_year + 1900;
for (i=0; i<(WC->num_cal); ++i) {
- p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
+ Cal = &WCC->disp_cal[i];
+ p = icalcomponent_get_first_property(Cal->cal,
ICAL_DTSTART_PROPERTY);
if (p != NULL) {
t = icalproperty_get_dtstart(p);
hours=(int)(difftime / 60);
minutes=difftime % 60;
wprintf("<tr><td bgcolor='%s'>%i:%2i</td><td bgcolor='%s'>"
- "<font size=-1>"
- "<a href=\"display_edit_event?msgnum=%ld&calview=calbrief&year=%s&month=%s&day=%s\">",
- daycolor,
- hours, minutes,
- daycolor,
- WC->disp_cal[i].cal_msgnum,
- bstr("year"),
- bstr("month"),
- bstr("day")
- );
+ "<font size=-1>"
+ "<a class=\"event%s\" href=\"display_edit_event?msgnum=%ld&calview=calbrief&year=%s&month=%s&day=%s\">",
+ daycolor,
+ hours, minutes,
+ (Cal->unread)?"_unread":"_read",
+ daycolor,
+ WC->disp_cal[i].cal_msgnum,
+ bstr("year"),
+ bstr("month"),
+ bstr("day")
+ );
escputs((char *)
icalproperty_get_comment(p));
if (all_day_event && notime_events)
{
- wprintf("<li class=\"event\"> "
+ wprintf("<li class=\"event_framed%s\"> "
"<a href=\"display_edit_event?"
"msgnum=%ld&calview=day&year=%d&month=%d&day=%d\" "
" class=\"event_title\" "
" btt_tooltext=\"",
+ (Cal->unread)?"_unread":"_read",
Cal->cal_msgnum, year, month, day);
- wprintf("<i>%s</i><br />", _("All day event"));
- wprintf("<i>%s</i> ", _("Summary:"));
+ wprintf("<i>%s</i><br />", _("All day event"));
+ wprintf("<i>%s: %s</i><br />", _("From"), Cal->from);
+ wprintf("<i>%s</i> ", _("Summary:"));
escputs((char *) icalproperty_get_comment(p));
wprintf("<br />");
q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
}
else if (ongoing_event && notime_events)
{
- wprintf("<li class=\"event\"> "
+ wprintf("<li class=\"event_framed%s\"> "
"<a href=\"display_edit_event?"
"msgnum=%ld&calview=day&year=%d&month=%d&day=%d\" "
" class=\"event_title\" "
"btt_tooltext=\"",
+ (Cal->unread)?"_unread":"_read",
Cal->cal_msgnum, year, month, day);
- wprintf("<i>%s</i><br />", _("Ongoing event"));
- wprintf("<i>%s</i> ", _("Summary:"));
+ wprintf("<i>%s</i><br />", _("Ongoing event"));
+ wprintf("<i>%s: %s</i><br />", _("From"), Cal->from);
+ wprintf("<i>%s</i> ", _("Summary:"));
escputs((char *) icalproperty_get_comment(p));
wprintf("<br />");
q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
/* should never get here */
}
- wprintf("<dd class=\"event\" "
+ wprintf("<dd class=\"event_framed%s\" "
"style=\"position: absolute; "
"top:%dpx; left:%dpx; "
"height:%dpx; \" >",
+ (Cal->unread)?"_unread":"_read",
top, (gap * 40), (bottom-top)
);
wprintf("<a href=\"display_edit_event?"
"class=\"event_title\" "
"btt_tooltext=\"",
Cal->cal_msgnum, year, month, day, t.hour);
- wprintf("<i>%s</i> ", _("Summary:"));
+ wprintf("<i>%s: %s</i><br />", _("From"), Cal->from);
+ wprintf("<i>%s</i> ", _("Summary:"));
escputs((char *) icalproperty_get_comment(p));
wprintf("<br />");
q = icalcomponent_get_first_property(Cal->cal,ICAL_LOCATION_PROPERTY);
* \param supplied_vevent the event to edit
* \param msgnum reference on the citserver
*/
-void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) {
+void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, char *from, int unread) {
icalcomponent *vevent;
icalproperty *p;
icalvalue *v;
if (icalcomponent_isa(vevent) == ICAL_VCALENDAR_COMPONENT) {
display_edit_individual_event(
icalcomponent_get_first_component(
- vevent, ICAL_VEVENT_COMPONENT
- ), msgnum
+ vevent, ICAL_VEVENT_COMPONENT),
+ msgnum, from, unread
);
return;
}
* \param supplied_vevent the event to save
* \param msgnum the index on the citserver
*/
-void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
+void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *from, int unread) {
char buf[SIZ];
icalproperty *prop;
icalcomponent *vevent, *encaps;
if (icalcomponent_isa(vevent) == ICAL_VCALENDAR_COMPONENT) {
save_individual_event(
icalcomponent_get_first_component(
- vevent, ICAL_VEVENT_COMPONENT
- ), msgnum
+ vevent, ICAL_VEVENT_COMPONENT),
+ msgnum, from, unread
);
return;
}
check_attendee_availability(encaps);
/** This displays the form again, with our annotations */
- display_edit_individual_event(encaps, msgnum);
+ display_edit_individual_event(encaps, msgnum, from, unread);
icalcomponent_free(encaps);
}
* new messages.
*/
strcpy(old_msgs, "");
- if (is_summary) {
+ if ((is_summary) || (WCC->wc_default_view == VIEW_CALENDAR)){
serv_puts("GTSN");
serv_getln(buf, sizeof buf);
if (buf[0] == '2') {
if (WCC->wc_default_view == VIEW_CALENDAR) { /**< calendar */
is_calendar = 1;
- strcpy(cmd, "MSGS ALL");
+ strcpy(cmd, "MSGS ALL|||1");
maxmsgs = 32767;
}
if (WCC->wc_default_view == VIEW_TASKS) { /**< tasks */
goto DONE;
}
- if (is_summary) {
+ if ((is_summary) || (WCC->wc_default_view == VIEW_CALENDAR)){
for (a = 0; a < nummsgs; ++a) {
/** Are you a new message, or an old message? */
if (is_summary) {
addrbook[num_ab-1].ab_msgnum = WCC->msgarr[a];
}
else if (is_calendar) {
- display_calendar(WCC->msgarr[a]);
+ display_calendar(WCC->msgarr[a], WCC->summ[a].is_new);
}
else if (is_tasks) {
- display_task(WCC->msgarr[a]);
+ display_task(WCC->msgarr[a], WCC->summ[a].is_new);
}
else if (is_notes) {
- display_note(WCC->msgarr[a]);
+ display_note(WCC->msgarr[a], WCC->summ[a].is_new);
}
else {
if (displayed_msgs == NULL) {
* \brief display sticky notes
* \param msgnum the citadel mesage number
*/
-void display_note(long msgnum)
+void display_note(long msgnum, int unread)
{
char buf[SIZ];
char notetext[SIZ];
vertical-align: top;
}
-.event {
+.event_framed_unread {
filter:alpha(opacity=50); /* Internet Explorer 6 */
-moz-opacity:0.5; /* Mozilla 1.6 and prec. */
opacity: 0.5; /* CSS3 draft and Mozilla */
padding: 0 4px 0 4px;
}
-li.event span, a.event_title {
+li.event_framed_unread span, a.event_title {
+ filter:alpha(opacity=100);
+ -moz-opacity:1.0;
+ opacity: 1.0;
+ font-size: 11px;
+}
+
+.event_framed_read {
+ filter:alpha(opacity=50); /* Internet Explorer 6 */
+ -moz-opacity:0.5; /* Mozilla 1.6 and prec. */
+ opacity: 0.5; /* CSS3 draft and Mozilla */
+ -moz-border-radius: 8px; /* CSS3 draft and Mozilla */
+ border: solid 1px red;
+ background-color: yellow;
+ z-index: 10;
+ padding: 0 4px 0 4px;
+}
+
+li.event_framed_read span, a.event_title {
+ filter:alpha(opacity=100);
+ -moz-opacity:1.0;
+ opacity: 1.0;
+ font-size: 11px;
+}
+
+.event_read {
+}
+
+li.event_read span, a.event_read_title {
+ filter:alpha(opacity=100);
+ -moz-opacity:1.0;
+ opacity: 1.0;
+ font-size: 11px;
+}
+
+.event_unread {
+}
+
+li.event_unread span, a.event_read_title {
filter:alpha(opacity=100);
-moz-opacity:1.0;
opacity: 1.0;
}
else {
for (i=0; i<num_msgs; ++i) {
- display_task(WC->msgarr[i]);
+ display_task(WC->msgarr[i], 0);
}
}
}
else {
for (i=0; i<num_msgs; ++i) {
- display_calendar(WC->msgarr[i]);
+ display_calendar(WC->msgarr[i], 0);
}
calendar_summary_view();
}
struct disp_cal {
icalcomponent *cal; /**< cal items for display */
long cal_msgnum; /**< cal msgids for display */
+ char *from; /**< owner of this component */
+ int unread; /**< already seen by the user? */
} *disp_cal;
int num_cal; /**< number of calendar items for display */
#endif
void summary_inner_div(void);
ssize_t write(int fd, const void *buf, size_t count);
void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum);
-void display_calendar(long msgnum);
-void display_task(long msgnum);
-void display_note(long msgnum);
+void display_calendar(long msgnum, int unread);
+void display_task(long msgnum, int unread);
+void display_note(long msgnum, int unread);
void updatenote(void);
void do_calendar_view(void);
void do_tasks_view(void);
void list_all_rooms_by_floor(char *viewpref);
void display_room_directory(void);
void display_picture(void);
+void display_pictureview(void);
void download_file(char *);
void upload_file(void);
void display_icaltimetype_as_webform(struct icaltimetype *, char *);
void icaltime_from_webform(struct icaltimetype *result, char *prefix);
void icaltime_from_webform_dateonly(struct icaltimetype *result, char *prefix);
-void display_edit_individual_event(icalcomponent *supplied_vtodo, long msgnum);
-void save_individual_event(icalcomponent *supplied_vtodo, long msgnum);
+void display_edit_individual_event(icalcomponent *supplied_vtodo, long msgnum, char *from, int unread);
+void save_individual_event(icalcomponent *supplied_vtodo, long msgnum, char *from, int unread);
void respond_to_request(void);
void handle_rsvp(void);
void ical_dezonify(icalcomponent *cal);