* Create the Calendar> and Tasks> rooms at login time, and set their default
authorArt Cancro <ajc@citadel.org>
Tue, 17 Sep 2002 03:18:15 +0000 (03:18 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 17 Sep 2002 03:18:15 +0000 (03:18 +0000)
  views to calendar and tasklist views.  Renamed "My Calendar>" to "Calendar>"
  to be in sync with the KDE groupware project.

citadel/ChangeLog
citadel/serv_calendar.c
citadel/sysconfig.h

index cb1403a02df0c3d2e93a251cd1da765c53bf19cc..c8b6d5046bbd16a9054246d5851d66db0dc1fb26 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 601.7  2002/09/17 03:18:15  ajc
+ * Create the Calendar> and Tasks> rooms at login time, and set their default
+   views to calendar and tasklist views.  Renamed "My Calendar>" to "Calendar>"
+   to be in sync with the KDE groupware project.
+
  Revision 601.6  2002/09/15 03:24:28  ajc
  * Renamed decode_base64() to CtdlDecodeBase64()
  * Renamed decode_quoted_printable() to CtdlDecodeQuotedPrintable()
@@ -4004,3 +4009,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index f101f0b0b7054c44d37bcc3ba8cf82cc1c58c430..acff373bbd2cf766270ac9e173e2a56feb8e81d4 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * $Id$ 
  *
- * This module implements iCalendar object processing and the My Calendar>
+ * This module implements iCalendar object processing and the Calendar>
  * room on a Citadel/UX server.  It handles iCalendar objects using the
  * iTIP protocol.  See RFCs 2445 and 2446.
  *
@@ -42,13 +42,17 @@ void cmd_ical(char *argbuf)
 }
 
 
-/* We don't know if the calendar room exists so we just create it at login */
+/*
+ * We don't know if the calendar room exists so we just create it at login
+ */
 void ical_create_room(void)
 {
        struct quickroom qr;
+       struct visit vbuf;
 
-       /* Create the room if it doesn't already exist */
+       /* Create the calendar room if it doesn't already exist */
        create_room(USERCALENDARROOM, 4, "", 0, 1, 0);
+
        /* Set expiration policy to manual; otherwise objects will be lost! */
        if (lgetroom(&qr, USERCALENDARROOM)) {
                lprintf(3, "Couldn't get the user calendar room!\n");
@@ -56,7 +60,28 @@ void ical_create_room(void)
        }
        qr.QRep.expire_mode = EXPIRE_MANUAL;
        lputroom(&qr);
-       lprintf(9, "Set user calendar room to manual expire\n");
+
+       /* Set the view to a calendar view */
+       CtdlGetRelationship(&vbuf, &CC->usersupp, &qr);
+       vbuf.v_view = 3;        /* 3 = calendar */
+       CtdlSetRelationship(&vbuf, &CC->usersupp, &qr);
+
+       /* Create the tasks list room if it doesn't already exist */
+       create_room(USERTASKSROOM, 4, "", 0, 1, 0);
+
+       /* Set expiration policy to manual; otherwise objects will be lost! */
+       if (lgetroom(&qr, USERTASKSROOM)) {
+               lprintf(3, "Couldn't get the user calendar room!\n");
+               return;
+       }
+       qr.QRep.expire_mode = EXPIRE_MANUAL;
+       lputroom(&qr);
+
+       /* Set the view to a task list view */
+       CtdlGetRelationship(&vbuf, &CC->usersupp, &qr);
+       vbuf.v_view = 4;        /* 4 = tasks */
+       CtdlSetRelationship(&vbuf, &CC->usersupp, &qr);
+
        return;
 }
 
@@ -70,8 +95,8 @@ int ical_obj_beforesave(struct CtdlMessage *msg)
        
        /*
         * Only messages with content-type text/calendar or text/x-calendar
-        * may be saved to My Calendar>.  If the message is bound for
-        * My Calendar> but doesn't have this content-type, throw an error
+        * may be saved to Calendar>.  If the message is bound for
+        * Calendar> but doesn't have this content-type, throw an error
         * so that the message may not be posted.
         */
 
index f2d79b21d69ef15930daeb3556aad28421b54bdb..8fc4d7af0d0b89b9eb4a367029b4b36157a2ee7a 100644 (file)
 #define SENTITEMS              "Sent Items"
 #define AIDEROOM               "Aide"
 #define USERCONFIGROOM         "My Citadel Config"
-#define USERCALENDARROOM       "My Calendar"
+#define USERCALENDARROOM       "Calendar"
+#define USERTASKSROOM          "Tasks"
 #define PAGELOGROOM            "Sent/Received Pages"
 #define SYSCONFIGROOM          "Local System Configuration"
 #define SMTP_SPOOLOUT_ROOM     "__CitadelSMTPspoolout__"