* THIS IS 5.04
authorArt Cancro <ajc@citadel.org>
Tue, 3 Feb 2004 03:09:54 +0000 (03:09 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 3 Feb 2004 03:09:54 +0000 (03:09 +0000)
webcit/ChangeLog
webcit/calendar.c
webcit/calendar_tools.c
webcit/calendar_view.c
webcit/webcit.h

index 1aaa3d3080153e7076b70e9d874e11b7b6367338..7a0ff9cc659befa6679f689ff69061e4c32ad7d6 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 504.1  2004/02/03 03:09:51  ajc
+* THIS IS 5.04
+
 Revision 503.0  2004/01/28 04:31:31  ajc
 * THIS IS 5.03
 
@@ -1633,3 +1636,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 9185c3edbd0af1c6c66c1beefacdf67e668a4720..6992d3de7132f11d1e6d98cf02da3b27c9daa448 100644 (file)
@@ -71,8 +71,6 @@ void display_task(long msgnum) {
  * Process a calendar object
  * ...at this point it's already been deserialized by cal_process_attachment()
  *
- * ok for complete vcalendar objects
- *
  */
 void cal_process_object(icalcomponent *cal,
                        int recursion_level,
@@ -327,7 +325,6 @@ void cal_process_object(icalcomponent *cal,
 /*
  * Deserialize a calendar object in a message so it can be processed.
  * (This is the main entry point for these things)
- * ok for complete vcalendar objects
  */
 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
        icalcomponent *cal;
@@ -505,7 +502,6 @@ void display_individual_task(icalcomponent *vtodo, long msgnum) {
 /*
  * Display a task by itself (for editing)
  *
- * ok for complete vcalendar objects
  */
 void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
        icalcomponent *vtodo;
@@ -610,7 +606,6 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
 /*
  * Save an edited task
  *
- * ok 
  */
 void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
        char buf[SIZ];
@@ -729,7 +724,6 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
  * the relevant part, deserialize it into a libical component, filter it for
  * the requested object type, and feed it to the specified handler.
  *
- * ok
  */
 void display_using_handler(long msgnum,
                        char *mimetype,
index e276cf3937fa6dd3e1a439975924a1a1cf35925f..bea5fc10933e27fec9b5e24b918e542663615dd2 100644 (file)
@@ -65,23 +65,27 @@ char *hourname[] = {
 
 void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
        int i;
-
        time_t now;
        struct tm tm_now;
        int this_year;
-
        time_t tt;
        struct tm tm;
-
        const int span = 10;
+       int all_day_event = 0;
 
        now = time(NULL);
        memcpy(&tm_now, localtime(&now), sizeof(struct tm));
        this_year = tm_now.tm_year + 1900;
 
        if (t == NULL) return;
+       if (t->is_date) all_day_event = 1;
        tt = icaltime_as_timet(*t);
-       memcpy(&tm, localtime(&tt), sizeof(struct tm));
+       if (all_day_event) {
+               memcpy(&tm, gmtime(&tt), sizeof(struct tm));
+       }
+       else {
+               memcpy(&tm, localtime(&tt), sizeof(struct tm));
+       }
 
        wprintf("Month: ");
        wprintf("<SELECT NAME=\"%s_month\" SIZE=\"1\">\n", prefix);
index 9124a7c9cb7c6cf33d6419bac052e46b94bf8867..0b133d106fdef3857ca3f6964c6ad0829fe6841e 100644 (file)
@@ -63,14 +63,30 @@ void calendar_month_view_display_events(time_t thetime) {
                if (p != NULL) {
                        t = icalproperty_get_dtstart(p);
                        event_tt = icaltime_as_timet(t);
-                       memcpy(&event_tm, localtime(&event_tt), sizeof(struct tm));
+
+                       if (t.is_date) all_day_event = 1;
+                       else all_day_event = 0;
+
+                       if (all_day_event) {
+                               memcpy(&event_tm, gmtime(&event_tt), sizeof(struct tm));
+                       }
+                       else {
+                               memcpy(&event_tm, localtime(&event_tt), sizeof(struct tm));
+                       }
+
+lprintf(9, "Event: %04d/%02d/%02d, Now: %04d/%02d/%02d\n",
+       event_tm.tm_year,
+       event_tm.tm_mon,
+       event_tm.tm_mday,
+       today_tm.tm_year,
+       today_tm.tm_mon,
+       today_tm.tm_mday);
+
+
                        if ((event_tm.tm_year == today_tm.tm_year)
                           && (event_tm.tm_mon == today_tm.tm_mon)
                           && (event_tm.tm_mday == today_tm.tm_mday)) {
 
-                               if (t.is_date) all_day_event = 1;
-                               else all_day_event = 0;
-
                                p = icalcomponent_get_first_property(
                                                        WC->disp_cal[i],
                                                        ICAL_SUMMARY_PROPERTY);
@@ -259,14 +275,21 @@ void calendar_day_view_display_events(int year, int month,
                if (p != NULL) {
                        t = icalproperty_get_dtstart(p);
                        event_tt = icaltime_as_timet(t);
-                       event_tm = localtime(&event_tt);
+                       if (t.is_date) all_day_event = 1;
+
+                       if (all_day_event) {
+                               event_tm = gmtime(&event_tt);
+                       }
+                       else {
+                               event_tm = localtime(&event_tt);
+                       }
+
                        if ((event_tm->tm_year == (year-1900))
                           && (event_tm->tm_mon == (month-1))
                           && (event_tm->tm_mday == day)
                           && ( ((event_tm->tm_hour == hour)&&(!t.is_date)) || ((hour<0)&&(t.is_date)) )
                           ) {
 
-                               if (t.is_date) all_day_event = 1;
 
                                p = icalcomponent_get_first_property(
                                                        WC->disp_cal[i],
@@ -466,14 +489,21 @@ void calendar_summary_view(void) {
                if (p != NULL) {
                        t = icalproperty_get_dtstart(p);
                        event_tt = icaltime_as_timet(t);
+                       if (t.is_date) all_day_event = 1;
                        fmt_time(timestring, event_tt);
-                       memcpy(&event_tm, localtime(&event_tt), sizeof(struct tm));
+
+                       if (all_day_event) {
+                               memcpy(&event_tm, gmtime(&event_tt), sizeof(struct tm));
+                       }
+                       else {
+                               memcpy(&event_tm, localtime(&event_tt), sizeof(struct tm));
+                       }
+
                        if ( (event_tm.tm_year == today_tm.tm_year)
                           && (event_tm.tm_mon == today_tm.tm_mon)
                           && (event_tm.tm_mday == today_tm.tm_mday)
                           ) {
 
-                               if (t.is_date) all_day_event = 1;
 
                                p = icalcomponent_get_first_property(
                                                        WC->disp_cal[i],
index e81d01cc2febdf4e8b0067eec16078c8e44e13cb..233770a1f9f3ba69728eb0ddfc0bc0d1a18ce585 100644 (file)
 #define SLEEPING               180             /* TCP connection timeout */
 #define WEBCIT_TIMEOUT         900             /* WebCit session timeout */
 #define PORT_NUM               2000            /* port number to listen on */
-#define SERVER                 "WebCit v5.03"  /* who's in da house */
+#define SERVER                 "WebCit v5.04"  /* who's in da house */
 #define DEVELOPER_ID           0
 #define CLIENT_ID              4
-#define CLIENT_VERSION         503             /* This version of WebCit */
+#define CLIENT_VERSION         504             /* This version of WebCit */
 #define MINIMUM_CIT_VERSION    611             /* min required Citadel vers */
 #define DEFAULT_HOST           "localhost"     /* Default Citadel server */
 #define DEFAULT_PORT           "504"