evolution-data-server r10206 - in trunk: calendar calendar/backends/groupwise servers/groupwise



Author: pchen
Date: Mon Apr 13 08:44:39 2009
New Revision: 10206
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=10206&view=rev

Log:
Fixes #241604 (bnc).
Fixes monthly recurring appointments to be created on correct dates.

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

Modified: trunk/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
==============================================================================
--- trunk/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	(original)
+++ trunk/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	Mon Apr 13 08:44:39 2009
@@ -521,6 +521,8 @@
 			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);
 

Modified: trunk/servers/groupwise/e-gw-item.c
==============================================================================
--- trunk/servers/groupwise/e-gw-item.c	(original)
+++ trunk/servers/groupwise/e-gw-item.c	Mon Apr 13 08:44:39 2009
@@ -3119,12 +3119,20 @@
 			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;

Modified: trunk/servers/groupwise/e-gw-recur-utils.h
==============================================================================
--- trunk/servers/groupwise/e-gw-recur-utils.h	(original)
+++ trunk/servers/groupwise/e-gw-recur-utils.h	Mon Apr 13 08:44:39 2009
@@ -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 @@
 	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;
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]