From 9dc5ef3965aec20af2a60918dd07628fa1b3bea5 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Mon, 13 Apr 2009 08:44:39 +0000 Subject: [PATCH] Fixes #241604 (bnc). Fixes monthly recurring appointments to be created on correct dates. svn path=/trunk/; revision=10206 --- calendar/ChangeLog | 8 ++++++++ .../backends/groupwise/e-cal-backend-groupwise-utils.c | 2 ++ servers/groupwise/ChangeLog | 8 ++++++++ servers/groupwise/e-gw-item.c | 14 +++++++++++--- servers/groupwise/e-gw-recur-utils.h | 2 ++ 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 40cb859..cdfbcad 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2009-04-13 Chenthill Palanisamy + + 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 ** Fix for bug #571677 diff --git a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c index 0fa18d1..263fbee 100644 --- a/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c +++ b/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c @@ -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); diff --git a/servers/groupwise/ChangeLog b/servers/groupwise/ChangeLog index 9e058f7..b72c78d 100644 --- a/servers/groupwise/ChangeLog +++ b/servers/groupwise/ChangeLog @@ -1,3 +1,11 @@ +2009-04-13 Chenthill Palanisamy + + 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 Fixes #465364 diff --git a/servers/groupwise/e-gw-item.c b/servers/groupwise/e-gw-item.c index dc6e29b..0a78049 100644 --- a/servers/groupwise/e-gw-item.c +++ b/servers/groupwise/e-gw-item.c @@ -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; diff --git a/servers/groupwise/e-gw-recur-utils.h b/servers/groupwise/e-gw-recur-utils.h index ad37029..b39a516 100644 --- a/servers/groupwise/e-gw-recur-utils.h +++ b/servers/groupwise/e-gw-recur-utils.h @@ -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; -- 2.7.4