Fixes #241604 (bnc).
authorChenthill Palanisamy <pchen@src.gnome.org>
Mon, 13 Apr 2009 08:44:39 +0000 (08:44 +0000)
committerChenthill Palanisamy <pchen@src.gnome.org>
Mon, 13 Apr 2009 08:44:39 +0000 (08:44 +0000)
Fixes monthly recurring appointments to be created on correct dates.

svn path=/trunk/; revision=10206

calendar/ChangeLog
calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
servers/groupwise/ChangeLog
servers/groupwise/e-gw-item.c
servers/groupwise/e-gw-recur-utils.h

index 40cb859..cdfbcad 100644 (file)
@@ -1,3 +1,11 @@
+2009-04-13  Chenthill Palanisamy  <pchenthill@novell.com>
+
+       Fixes #241604 (bnc)
+       * calendar/backends/groupwise/e-cal-backend-groupwise-utils.c:
+       * servers/groupwise/e-gw-item.c:
+       * servers/groupwise/e-gw-recur-utils.h: Fixes monthly recurring 
+       appointments to appear on proper dates.
+
 2009-04-06  Milan Crha  <mcrha@redhat.com>
 
        ** Fix for bug #571677
index 0fa18d1..263fbee 100644 (file)
@@ -521,6 +521,8 @@ set_rrule_from_comp (ECalComponent *comp, EGwItem *item, ECalBackendGroupwise *c
                        item_rrule->by_year_day[i] = ical_recur->by_year_day[i];
                for (i = 0; i < ICAL_BY_MONTH_SIZE; i++)
                        item_rrule->by_month[i] = ical_recur->by_month[i];
+               for (i = 0; i < ICAL_BY_SETPOS_SIZE; i++)
+                       item_rrule->by_setpos[i] = ical_recur->by_set_pos[i];
 
                e_gw_item_set_rrule (item, item_rrule);
 
index 9e058f7..b72c78d 100644 (file)
@@ -1,3 +1,11 @@
+2009-04-13  Chenthill Palanisamy  <pchenthill@novell.com>
+
+       Fixes #241604 (bnc)
+       * calendar/backends/groupwise/e-cal-backend-groupwise-utils.c:
+       * servers/groupwise/e-gw-item.c:
+       * servers/groupwise/e-gw-recur-utils.h: Fixes monthly recurring
+       appointments to be created on proper dates.
+
 2009-03-05  Chenthill Palanisamy  <pchenthill@novell.com>
 
        Fixes #465364
index dc6e29b..0a78049 100644 (file)
@@ -3119,12 +3119,20 @@ e_gw_item_set_calendar_item_elements (EGwItem *item, SoupSoapMessage *msg)
                        max_elements = sizeof (rrule->by_day) / sizeof (rrule->by_day[0]);
                        /* expand into  a sequence of 'day' here  */
                        for (i = 0; i < max_elements && rrule->by_day [i] != E_GW_ITEM_RECUR_END_MARKER; i++) {
-                               /*TODO occurence attribute */
-                               e_gw_message_write_string_parameter (msg, "day", NULL,
-                                               e_gw_recur_get_day_of_week (rrule->by_day [i]));
+                               const char *dow = e_gw_recur_get_day_of_week (rrule->by_day [i]);
+
+                               if (rrule->by_setpos [i] == E_GW_ITEM_RECUR_END_MARKER)
+                                       e_gw_message_write_string_parameter (msg, "day", NULL, dow);
+                               else {
+                                       char occur [3];
+
+                                       g_sprintf (occur, "%d", rrule->by_setpos [i]);
+                                       e_gw_message_write_string_parameter_with_attribute (msg, "day", NULL, dow, "occurrence", occur);
+                               }
                        }
                        soup_soap_message_end_element (msg);
                }
+
                /* byMonthDay*/
                if (rrule->by_month_day) {
                        int i, max_elements;
index ad37029..b39a516 100644 (file)
@@ -50,6 +50,7 @@
 #define E_GW_ITEM_BY_MONTHDAY_SIZE 32
 #define E_GW_ITEM_BY_YEARDAY_SIZE 367
 #define E_GW_ITEM_BY_MONTH_SIZE 13
+#define E_GW_ITEM_BY_SETPOS_SIZE 367
 
 typedef struct {
        char *frequency;
@@ -60,6 +61,7 @@ typedef struct {
        short by_month_day[E_GW_ITEM_BY_MONTHDAY_SIZE];
        short by_year_day[E_GW_ITEM_BY_YEARDAY_SIZE];
        short by_month[E_GW_ITEM_BY_MONTH_SIZE];
+       short by_setpos [E_GW_ITEM_BY_SETPOS_SIZE];
 } EGwItemRecurrenceRule;