]> code.citadel.org Git - citadel.git/blob - webcit/calendar_view.c
* A few logging hacks
[citadel.git] / webcit / calendar_view.c
1 /*
2  * $Id$
3  *
4  *
5  */
6
7 #include <ctype.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10 #include <stdio.h>
11 #include <fcntl.h>
12 #include <signal.h>
13 #include <sys/types.h>
14 #include <sys/wait.h>
15 #include <sys/socket.h>
16 #include <limits.h>
17 #include <netinet/in.h>
18 #include <netdb.h>
19 #include <string.h>
20 #include <pwd.h>
21 #include <errno.h>
22 #include <stdarg.h>
23 #include <pthread.h>
24 #include <signal.h>
25 #include <time.h>
26 #include "webcit.h"
27 #include "webserver.h"
28
29 #ifndef WEBCIT_WITH_CALENDAR_SERVICE
30
31 void do_calendar_view(void) {   /* stub for non-libical builds */
32         wprintf("<CENTER><I>Calendar view not available</I></CENTER><br />\n");
33 }
34
35 void do_tasks_view(void) {      /* stub for non-libical builds */
36         wprintf("<CENTER><I>Tasks view not available</I></CENTER><br />\n");
37 }
38
39 #else   /* WEBCIT_WITH_CALENDAR_SERVICE */
40
41 /****************************************************************************/
42
43
44 void calendar_month_view_display_events(time_t thetime) {
45         int i;
46         time_t event_tt;
47         struct tm event_tm;
48         struct tm today_tm;
49         icalproperty *p;
50         struct icaltimetype t;
51         int month, day, year;
52         int all_day_event = 0;
53
54         if (WC->num_cal == 0) {
55                 wprintf("<br /><br /><br />\n");
56                 return;
57         }
58
59         localtime_r(&thetime, &today_tm);
60         month = today_tm.tm_mon + 1;
61         day = today_tm.tm_mday;
62         year = today_tm.tm_year + 1900;
63
64         for (i=0; i<(WC->num_cal); ++i) {
65                 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
66                                                 ICAL_DTSTART_PROPERTY);
67                 if (p != NULL) {
68                         t = icalproperty_get_dtstart(p);
69                         event_tt = icaltime_as_timet(t);
70
71                         if (t.is_date) all_day_event = 1;
72                         else all_day_event = 0;
73
74                         if (all_day_event) {
75                                 gmtime_r(&event_tt, &event_tm);
76                         }
77                         else {
78                                 localtime_r(&event_tt, &event_tm);
79                         }
80
81 lprintf(9, "Event: %04d-%s-%02d, Now: %04d-%s-%02d\n",
82         event_tm.tm_year + 1900,
83         ascmonths[event_tm.tm_mon],
84         event_tm.tm_mday,
85         today_tm.tm_year + 1900,
86         ascmonths[today_tm.tm_mon],
87         today_tm.tm_mday);
88
89                         if ((event_tm.tm_year == today_tm.tm_year)
90                            && (event_tm.tm_mon == today_tm.tm_mon)
91                            && (event_tm.tm_mday == today_tm.tm_mday)) {
92
93                                 p = icalcomponent_get_first_property(
94                                                         WC->disp_cal[i].cal,
95                                                         ICAL_SUMMARY_PROPERTY);
96                                 if (p != NULL) {
97
98                                         if (all_day_event) {
99                                                 wprintf("<TABLE border=0 cellpadding=2><TR>"
100                                                         "<TD BGCOLOR=\"#CCCCDD\">"
101                                                 );
102                                         }
103
104                                         wprintf("<FONT SIZE=-1>"
105                                                 "<A HREF=\"/display_edit_event?msgnum=%ld&calview=%s&year=%s&month=%s&day=%s\">",
106                                                 WC->disp_cal[i].cal_msgnum,
107                                                 bstr("calview"),
108                                                 bstr("year"),
109                                                 bstr("month"),
110                                                 bstr("day")
111                                         );
112                                         escputs((char *)
113                                                 icalproperty_get_comment(p));
114                                         wprintf("</A></FONT><br />\n");
115
116                                         if (all_day_event) {
117                                                 wprintf("</TD></TR></TABLE>");
118                                         }
119
120                                 }
121
122                         }
123
124
125                 }
126         }
127 }
128
129
130
131 void calendar_month_view(int year, int month, int day) {
132         struct tm starting_tm;
133         struct tm tm;
134         time_t thetime;
135         int i;
136         time_t previous_month;
137         time_t next_month;
138
139         /* Determine what day to start.
140          * First, back up to the 1st of the month...
141          */
142         memset(&starting_tm, 0, sizeof(struct tm));
143         starting_tm.tm_year = year - 1900;
144         starting_tm.tm_mon = month - 1;
145         starting_tm.tm_mday = day;
146         thetime = mktime(&starting_tm);
147
148         memcpy(&tm, &starting_tm, sizeof(struct tm));
149         while (tm.tm_mday != 1) {
150                 thetime = thetime - (time_t)86400;      /* go back 24 hours */
151                 localtime_r(&thetime, &tm);
152         }
153
154         /* Determine previous and next months ... for links */
155         previous_month = thetime - (time_t)864000L;     /* back 10 days */
156         next_month = thetime + (time_t)(31L * 86400L);  /* ahead 31 days */
157
158         /* Now back up until we're on a Sunday */
159         localtime_r(&thetime, &tm);
160         while (tm.tm_wday != 0) {
161                 thetime = thetime - (time_t)86400;      /* go back 24 hours */
162                 localtime_r(&thetime, &tm);
163         }
164
165         /* Outer table (to get the background color) */
166         wprintf("<TABLE width=100%% border=0 cellpadding=0 cellspacing=0 "
167                 "bgcolor=#204B78><TR><TD>\n");
168
169         wprintf("<TABLE width=100%% border=0 cellpadding=0 cellspacing=0>"
170                 "<TR><TD align=left><font color=#FFFFFF>"
171                 "&nbsp;<A HREF=\"/display_edit_event?msgnum=0"
172                 "&year=%d&month=%d&day=%d\">"
173                 "Add new calendar event</A>"
174                 "</font></TD>\n",
175                 year, month, day
176         );
177
178         wprintf("<TD ALIGN=CENTER>");
179
180         localtime_r(&previous_month, &tm);
181         wprintf("<A HREF=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
182                 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
183         wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/back.gif\" BORDER=0></A>\n");
184
185         wprintf("&nbsp;&nbsp;"
186                 "<FONT SIZE=+1 COLOR=\"#FFFFFF\">"
187                 "%s %d"
188                 "</FONT>"
189                 "&nbsp;&nbsp;", months[month-1], year);
190
191         localtime_r(&next_month, &tm);
192         wprintf("<A HREF=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
193                 (int)(tm.tm_year)+1900, tm.tm_mon + 1);
194         wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/forward.gif\" BORDER=0></A>\n");
195
196         wprintf("</TD><TD align=right><font color=#FFFFFF size=-2>"
197                 "Click on any date for day view&nbsp;"
198                 "</FONT></TD></TR></TABLE>\n");
199
200         /* Inner table (the real one) */
201         wprintf("<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
202                 "bgcolor=#204B78><TR>");
203         for (i=0; i<7; ++i) {
204                 wprintf("<TD ALIGN=CENTER WIDTH=14%%>"
205                         "<FONT COLOR=\"#FFFFFF\">%s</FONT></TH>", days[i]);
206         }
207         wprintf("</TR>\n");
208
209         /* Now do 35 days */
210         for (i = 0; i < 35; ++i) {
211                 localtime_r(&thetime, &tm);
212
213                 /* Before displaying Sunday, start a new row */
214                 if ((i % 7) == 0) {
215                         wprintf("<TR>");
216                 }
217
218                 wprintf("<TD BGCOLOR=\"#%s\" WIDTH=14%% HEIGHT=60 VALIGN=TOP><B>",
219                         ((tm.tm_mon != month-1) ? "DDDDDD" :
220                         ((tm.tm_wday==0 || tm.tm_wday==6) ? "EEEECC" :
221                         "FFFFFF"))
222                 );
223                 if ((i==0) || (tm.tm_mday == 1)) {
224                         wprintf("%s ", months[tm.tm_mon]);
225                 }
226                 wprintf("<A HREF=\"readfwd?calview=day&year=%d&month=%d&day=%d\">"
227                         "%d</A></B><br />",
228                         tm.tm_year + 1900,
229                         tm.tm_mon + 1,
230                         tm.tm_mday,
231                         tm.tm_mday);
232
233                 /* put the data here, stupid */
234                 calendar_month_view_display_events(thetime);
235
236                 wprintf("</TD>");
237
238                 /* After displaying Saturday, end the row */
239                 if ((i % 7) == 6) {
240                         wprintf("</TR>\n");
241                 }
242
243                 thetime += (time_t)86400;               /* ahead 24 hours */
244         }
245
246         wprintf("</TABLE>"                      /* end of inner table */
247                 "</TD></TR></TABLE>"            /* end of outer table */
248                 "</CENTER>\n");
249 }
250
251
252 void calendar_week_view(int year, int month, int day) {
253         wprintf("<CENTER><I>week view FIXME</I></CENTER><br />\n");
254 }
255
256
257 /*
258  * Display events for a particular hour of a particular day.
259  * (Specify hour < 0 to show "all day" events)
260  */
261 void calendar_day_view_display_events(int year, int month,
262                                         int day, int hour) {
263         int i;
264         icalproperty *p;
265         struct icaltimetype t;
266         time_t event_tt;
267         struct tm *event_tm;
268         int all_day_event = 0;
269
270         if (WC->num_cal == 0) {
271                 wprintf("<br /><br /><br />\n");
272                 return;
273         }
274
275         for (i=0; i<(WC->num_cal); ++i) {
276                 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
277                                                 ICAL_DTSTART_PROPERTY);
278                 if (p != NULL) {
279                         t = icalproperty_get_dtstart(p);
280                         event_tt = icaltime_as_timet(t);
281                         if (t.is_date) all_day_event = 1;
282
283                         if (all_day_event) {
284                                 event_tm = gmtime(&event_tt);
285                         }
286                         else {
287                                 event_tm = localtime(&event_tt);
288                         }
289
290                         if ((event_tm->tm_year == (year-1900))
291                            && (event_tm->tm_mon == (month-1))
292                            && (event_tm->tm_mday == day)
293                            && ( ((event_tm->tm_hour == hour)&&(!t.is_date)) || ((hour<0)&&(t.is_date)) )
294                            ) {
295
296
297                                 p = icalcomponent_get_first_property(
298                                                         WC->disp_cal[i].cal,
299                                                         ICAL_SUMMARY_PROPERTY);
300                                 if (p != NULL) {
301
302                                         if (all_day_event) {
303                                                 wprintf("<TABLE border=1 cellpadding=2><TR>"
304                                                         "<TD BGCOLOR=\"#CCCCCC\">"
305                                                 );
306                                         }
307
308                                         wprintf("<FONT SIZE=-1>"
309                                                 "<A HREF=\"/display_edit_event?msgnum=%ld&calview=day&year=%d&month=%d&day=%d\">",
310                                                 WC->disp_cal[i].cal_msgnum,
311                                                 year, month, day
312                                         );
313                                         escputs((char *)
314                                                 icalproperty_get_comment(p));
315                                         wprintf("</A></FONT><br />\n");
316
317                                         if (all_day_event) {
318                                                 wprintf("</TD></TR></TABLE>");
319                                         }
320                                 }
321
322                         }
323
324
325                 }
326         }
327 }
328
329
330
331 void calendar_day_view(int year, int month, int day) {
332         int hour;
333         struct icaltimetype today, yesterday, tomorrow;
334
335
336         /* Figure out the dates for "yesterday" and "tomorrow" links */
337
338         memset(&today, 0, sizeof(struct icaltimetype));
339         today.year = year;
340         today.month = month;
341         today.day = day;
342         today.is_date = 1;
343
344         memcpy(&yesterday, &today, sizeof(struct icaltimetype));
345         --yesterday.day;
346         yesterday = icaltime_normalize(yesterday);
347
348         memcpy(&tomorrow, &today, sizeof(struct icaltimetype));
349         ++tomorrow.day;
350         tomorrow = icaltime_normalize(tomorrow);
351
352
353         /* Outer table (to get the background color) */
354         wprintf("<TABLE width=100%% border=0 cellpadding=0 cellspacing=0 "
355                 "bgcolor=#204B78><TR><TD>\n");
356
357         /* Inner table (the real one) */
358         wprintf("<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
359                 "bgcolor=#204B78><TR>\n");
360
361         /* Innermost table (contains hours etc.) */
362         wprintf("<TD WIDTH=80%%>"
363                 "<TABLE width=100%% border=0 cellpadding=1 cellspacing=1 "
364                 "bgcolor=#204B78>\n");
365
366         /* Display events before 8:00 (hour=-1 is all-day events) */
367         wprintf("<TR>"
368                 "<TD BGCOLOR=\"#CCCCDD\" VALIGN=MIDDLE WIDTH=10%%></TD>"
369                 "<TD BGCOLOR=\"#FFFFFF\" VALIGN=TOP>");
370         for (hour = (-1); hour <= 7; ++hour) {
371                 calendar_day_view_display_events(year, month, day, hour);
372         }
373         wprintf("</TD></TR>\n");
374
375         /* Now the middle of the day... */      
376         for (hour = 8; hour <= 17; ++hour) {    /* could do HEIGHT=xx */
377                 wprintf("<TR HEIGHT=30><TD BGCOLOR=\"#CCCCDD\" ALIGN=MIDDLE "
378                         "VALIGN=MIDDLE WIDTH=10%%>");
379                 wprintf("<A HREF=\"/display_edit_event?msgnum=0"
380                         "&year=%d&month=%d&day=%d&hour=%d&minute=0\">",
381                         year, month, day, hour
382                 );
383                 wprintf("%d:00%s</A> ",
384                         (hour <= 12 ? hour : hour-12),
385                         (hour < 12 ? "am" : "pm")
386                 );
387                 wprintf("</TD><TD BGCOLOR=\"#FFFFFF\" VALIGN=TOP>");
388
389                 /* put the data here, stupid */
390                 calendar_day_view_display_events(year, month, day, hour);
391
392                 wprintf("</TD></TR>\n");
393         }
394
395         /* Display events after 5:00... */
396         wprintf("<TR>"
397                 "<TD BGCOLOR=\"#CCCCDD\" VALIGN=MIDDLE WIDTH=10%%></TD>"
398                 "<TD BGCOLOR=\"#FFFFFF\" VALIGN=TOP>");
399         for (hour = 18; hour <= 23; ++hour) {
400                 calendar_day_view_display_events(year, month, day, hour);
401         }
402         wprintf("</TD></TR>\n");
403
404
405         wprintf("</TABLE>"                      /* end of innermost table */
406                 "</TD>"
407         );
408
409         wprintf("<TD WIDTH=20%% VALIGN=top>");  /* begin stuff-on-the-right */
410
411
412         /* Begin todays-date-with-left-and-right-arrows */
413         wprintf("<TABLE BORDER=0 WIDTH=100%% "
414                 "CELLSPACING=0 CELLPADDING=0 BGCOLOR=\"#FFFFFF\">\n");
415         wprintf("<TR>");
416
417         /* Left arrow */        
418         wprintf("<TD ALIGN=CENTER>");
419         wprintf("<A HREF=\"readfwd?calview=day&year=%d&month=%d&day=%d\">",
420                 yesterday.year, yesterday.month, yesterday.day);
421         wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/back.gif\" BORDER=0></A>");
422         wprintf("</TD>");
423
424         /* Today's date */
425         wprintf("<TD ALIGN=CENTER>");
426         wprintf("<FONT SIZE=+2>%s</FONT><br />"
427                 "<FONT SIZE=+3>%d</FONT><br />"
428                 "<FONT SIZE=+2>%d</FONT><br />",
429                 months[month-1], day, year);
430         wprintf("</TD>");
431
432         /* Right arrow */
433         wprintf("<TD ALIGN=CENTER>");
434         wprintf("<A HREF=\"readfwd?calview=day&year=%d&month=%d&day=%d\">",
435                 tomorrow.year, tomorrow.month, tomorrow.day);
436         wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/forward.gif\""
437                 " BORDER=0></A>\n");
438         wprintf("</TD>");
439
440         wprintf("</TR></TABLE>\n");
441         /* End todays-date-with-left-and-right-arrows */
442
443         wprintf("<br /><br /><CENTER><font color=#FFFFFF>"
444                 "&nbsp;<A HREF=\"/display_edit_event?msgnum=0"
445                 "&year=%d&month=%d&day=%d\">"
446                 "Add new calendar event</A>"
447                 "<br /><br />\n",
448                 year, month, day
449         );
450
451         wprintf("<A HREF=\"readfwd?calview=month&year=%d&month=%d&day=1\">"
452                 "Back to month view</A>\n", year, month);
453
454         wprintf("</FONT></CENTER>\n");
455
456         wprintf("</TD>");                       /* end stuff-on-the-right */
457
458
459
460         wprintf("</TR></TABLE>"                 /* end of inner table */
461                 "</TD></TR></TABLE>"            /* end of outer table */
462         );
463
464
465
466 }
467
468 /*
469  * Display today's events.
470  */
471 void calendar_summary_view(void) {
472         int i;
473         icalproperty *p;
474         struct icaltimetype t;
475         time_t event_tt;
476         struct tm event_tm;
477         struct tm today_tm;
478         time_t now;
479         int all_day_event = 0;
480         char timestring[SIZ];
481
482         if (WC->num_cal == 0) {
483                 return;
484         }
485
486         now = time(NULL);
487         localtime_r(&now, &today_tm);
488
489         for (i=0; i<(WC->num_cal); ++i) {
490                 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
491                                                 ICAL_DTSTART_PROPERTY);
492                 if (p != NULL) {
493                         t = icalproperty_get_dtstart(p);
494                         event_tt = icaltime_as_timet(t);
495                         if (t.is_date) all_day_event = 1;
496                         fmt_time(timestring, event_tt);
497
498                         if (all_day_event) {
499                                 gmtime_r(&event_tt, &event_tm);
500                         }
501                         else {
502                                 localtime_r(&event_tt, &event_tm);
503                         }
504
505                         if ( (event_tm.tm_year == today_tm.tm_year)
506                            && (event_tm.tm_mon == today_tm.tm_mon)
507                            && (event_tm.tm_mday == today_tm.tm_mday)
508                            ) {
509
510
511                                 p = icalcomponent_get_first_property(
512                                                         WC->disp_cal[i].cal,
513                                                         ICAL_SUMMARY_PROPERTY);
514                                 if (p != NULL) {
515                                         escputs((char *)
516                                                 icalproperty_get_comment(p));
517                                         wprintf(" (%s)<br />\n", timestring);
518                                 }
519                         }
520                 }
521         }
522         free_calendar_buffer();
523 }
524
525
526
527 void free_calendar_buffer(void) {
528         int i;
529         if (WC->num_cal) for (i=0; i<(WC->num_cal); ++i) {
530                 icalcomponent_free(WC->disp_cal[i].cal);
531         }
532         WC->num_cal = 0;
533         free(WC->disp_cal);
534         WC->disp_cal = NULL;
535 }
536
537
538
539
540 void do_calendar_view(void) {
541         time_t now;
542         struct tm tm;
543         int year, month, day;
544         char calview[SIZ];
545
546         /* In case no date was specified, go with today */
547         now = time(NULL);
548         localtime_r(&now, &tm);
549         year = tm.tm_year + 1900;
550         month = tm.tm_mon + 1;
551         day = tm.tm_mday;
552
553         /* Now see if a date was specified */
554         if (strlen(bstr("year")) > 0) year = atoi(bstr("year"));
555         if (strlen(bstr("month")) > 0) month = atoi(bstr("month"));
556         if (strlen(bstr("day")) > 0) day = atoi(bstr("day"));
557
558         /* How would you like that cooked? */
559         if (strlen(bstr("calview")) > 0) {
560                 strcpy(calview, bstr("calview"));
561         }
562         else {
563                 strcpy(calview, "month");
564         }
565
566         /* Display the selected view */
567         if (!strcasecmp(calview, "day")) {
568                 calendar_day_view(year, month, day);
569         }
570         else if (!strcasecmp(calview, "week")) {
571                 calendar_week_view(year, month, day);
572         }
573         else {
574                 calendar_month_view(year, month, day);
575         }
576
577         /* Free the calendar stuff */
578         free_calendar_buffer();
579
580 }
581
582
583 /*
584  * Helper function for do_tasks_view().  Returns the date/time due.
585  */
586 time_t get_task_due_date(icalcomponent *vtodo) {
587         icalproperty *p;
588
589         if (vtodo == NULL) {
590                 return(0L);
591         }
592
593         /* If we're looking at a fully encapsulated VCALENDAR
594          * rather than a VTODO component, recurse into the data
595          * structure until we get a VTODO.
596          */
597         if (icalcomponent_isa(vtodo) == ICAL_VCALENDAR_COMPONENT) {
598                 return get_task_due_date(
599                         icalcomponent_get_first_component(
600                                 vtodo, ICAL_VTODO_COMPONENT
601                         )
602                 );
603         }
604
605         p = icalcomponent_get_first_property(vtodo, ICAL_DUE_PROPERTY);
606         if (p != NULL) {
607                 return(icaltime_as_timet(icalproperty_get_due(p)));
608         }
609         else {
610                 return(0L);
611         }
612 }
613
614
615 /*
616  * Compare the due dates of two tasks (this is for sorting)
617  */
618 int task_due_cmp(const void *task1, const void *task2) {
619         time_t t1;
620         time_t t2;
621
622         t1 =  get_task_due_date(((struct disp_cal *)task1)->cal);
623         t2 =  get_task_due_date(((struct disp_cal *)task2)->cal);
624
625         if (t1 < t2) return(-1);
626         if (t1 > t2) return(1);
627         return(0);
628 }
629
630
631
632
633
634 void do_tasks_view(void) {
635         int i;
636         time_t due;
637         int bg = 0;
638         char buf[SIZ];
639         icalproperty *p;
640
641         do_template("beginbox_nt");
642
643         wprintf("<TABLE BORDER=0 CELLSPACING=0 WIDTH=100%%>\n<TR>\n"
644                 "<TH>Name of task</TH>\n"
645                 "<TH>Date due</TH></TR>\n"
646         );
647
648         /* Sort them if necessary */
649         if (WC->num_cal > 1) {
650                 qsort(WC->disp_cal,
651                         WC->num_cal,
652                         sizeof(struct disp_cal),
653                         task_due_cmp
654                 );
655         }
656
657         if (WC->num_cal) for (i=0; i<(WC->num_cal); ++i) {
658
659                 bg = 1 - bg;
660                 wprintf("<TR BGCOLOR=\"#%s\"><TD>",
661                         (bg ? "DDDDDD" : "FFFFFF")
662                 );
663
664                 p = icalcomponent_get_first_property(WC->disp_cal[i].cal,
665                                                         ICAL_SUMMARY_PROPERTY);
666                 wprintf("<A HREF=\"/display_edit_task?msgnum=%ld&taskrm=",
667                         WC->disp_cal[i].cal_msgnum );
668                 urlescputs(WC->wc_roomname);
669                 wprintf("\">");
670                 if (p != NULL) {
671                         escputs((char *)icalproperty_get_comment(p));
672                 }
673                 wprintf("</A>\n");
674                 wprintf("</TD>\n");
675
676                 due = get_task_due_date(WC->disp_cal[i].cal);
677                 fmt_date(buf, due);
678                 wprintf("<TD><FONT");
679                 if (due < time(NULL)) {
680                         wprintf(" COLOR=\"#FF0000\"");
681                 }
682                 wprintf(">%s</FONT></TD></TR>\n", buf);
683         }
684
685         wprintf("</TABLE>\n");
686
687         wprintf("<hr /><A HREF=\"/display_edit_task?msgnum=0\">"
688                 "Add new task</A>\n"
689         );
690
691         do_template("endbox");
692
693
694         /* Free the list */
695         free_calendar_buffer();
696
697 }
698
699 #endif  /* WEBCIT_WITH_CALENDAR_SERVICE */