[evolution-patches] Fix for the bug #67031 [tasks]



Hi,
   For posted tasks due to the absence of completion date in the soap
schema we set it as the current time so that the task is shown as
completed in the view. 

thanks, chenthill.
? 1
? 62868.diff
? 64682.diff
? 66484.diff
? 67031.diff
? completed.diff
? orbit-test1
? addressbook/libebook/libebook-1.2.pc
? addressbook/libebook/libebook.pc
? addressbook/libedata-book/libedata-book-1.2.pc
? addressbook/libedata-book/libedata-book.pc
? calendar/libecal/libecal-1.2.pc
? calendar/libecal/libecal.pc
? calendar/libedata-cal/libedata-cal-1.2.pc
? calendar/libedata-cal/libedata-cal.pc
? calendar/libical/src/libicalss/icalssyacc.output
? libedataserver/e-data-server-marshal.c
? libedataserver/e-data-server-marshal.h
? libedataserverui/e-data-server-ui-marshal.c
? libedataserverui/e-data-server-ui-marshal.h
? po/1
? servers/groupwise/.65200.diff.swp
? servers/groupwise/65200.diff
? servers/groupwise/invalid_session
? servers/groupwise/libegroupwise.pc
? servers/groupwise/doc/.gw-soap-methods.xsd.swp
? servers/groupwise/doc/.gw-soap-types.xsd.swp
? src/GNOME_Evolution_DataServer_1.2.server
Index: calendar/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/ChangeLog,v
retrieving revision 1.344
diff -u -p -r1.344 ChangeLog
--- calendar/ChangeLog	14 Oct 2004 05:25:05 -0000	1.344
+++ calendar/ChangeLog	14 Oct 2004 14:37:27 -0000
@@ -1,3 +1,13 @@
+2004-10-14  Chenthill Palanisamy <pchenthill novell com>
+	
+	Fixes #67031
+	* backends/groupwise/e-cal-backends-groupwise-utils.c
+	(e_gw_item_to_cal_component): Set the completed date. For
+	posted tasks set it as the current time.
+	* backends/groupwise/e-cal-backends-groupwise.c
+	(e_cal_backend_groupwise_modify_object): Update the item in
+	the cache after completing the task.
+	
 2004-10-14  Harish Krishnaswamy  <kharish novell com>
 	* backends/groupwise/e-cal-backend-groupwise.c:
 	(get_deltas) : removed stray debug code that should not have
Index: calendar/backends/groupwise/e-cal-backend-groupwise-utils.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise-utils.c,v
retrieving revision 1.37
diff -u -p -r1.37 e-cal-backend-groupwise-utils.c
--- calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	13 Oct 2004 09:34:47 -0000	1.37
+++ calendar/backends/groupwise/e-cal-backend-groupwise-utils.c	14 Oct 2004 14:37:27 -0000
@@ -660,9 +660,28 @@ e_gw_item_to_cal_component (EGwItem *ite
 		e_cal_component_set_priority (comp, &priority);
 
 		/* EGwItem's completed is a boolean */
-		if (e_gw_item_get_completed (item)) 
+		if (e_gw_item_get_completed (item)) {
 			percent = 100;
-		else 
+			
+			t = e_gw_item_get_completed_date (item);
+			if (t) {
+				itt_utc = icaltime_from_string (t);
+				if (!icaltime_get_timezone (itt_utc))
+					icaltime_set_timezone (&itt_utc, icaltimezone_get_utc_timezone());
+				if (default_zone) {
+					itt = icaltime_convert_to_zone (itt_utc, default_zone); 
+					icaltime_set_timezone (&itt, default_zone);
+					e_cal_component_set_completed (comp, &itt);
+				} else 
+					e_cal_component_set_completed (comp, &itt_utc);
+			} else {
+				/* We are setting the completion date as the current time due to
+				   the absence of completion element in the soap interface for posted
+				   tasks */
+				itt = icaltime_today ();
+				e_cal_component_set_completed (comp,&itt);
+			}
+		} else 
 			percent =0;
 		e_cal_component_set_percent (comp, &percent);
 
Index: calendar/backends/groupwise/e-cal-backend-groupwise.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/calendar/backends/groupwise/e-cal-backend-groupwise.c,v
retrieving revision 1.100
diff -u -p -r1.100 e-cal-backend-groupwise.c
--- calendar/backends/groupwise/e-cal-backend-groupwise.c	14 Oct 2004 05:25:05 -0000	1.100
+++ calendar/backends/groupwise/e-cal-backend-groupwise.c	14 Oct 2004 14:37:28 -0000
@@ -1358,6 +1358,7 @@ e_cal_backend_groupwise_modify_object (E
 					g_object_unref (cache_comp);
 					return GNOME_Evolution_Calendar_OtherError;
 				}
+				e_cal_backend_cache_put_component (priv->cache, comp);
 				break;
 			}
 		}
Index: servers/groupwise/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/ChangeLog,v
retrieving revision 1.74
diff -u -p -r1.74 ChangeLog
--- servers/groupwise/ChangeLog	13 Oct 2004 11:46:39 -0000	1.74
+++ servers/groupwise/ChangeLog	14 Oct 2004 14:37:29 -0000
@@ -1,4 +1,16 @@
-2004-10-13 Sivaiah Nallagatla    <snallagatla novell com>
+22004-10-14  Chenthill Palanisamy <pchenthill novell com>
+
+	Fixes #67031
+	* e-gw-item.[ch] (e_gw_item_set_completed_date), 
+	(e_gw_item_get_completed_date):
+	Added apis to get and set the completion date for tasks.
+	* e-gw-item.c (set_recipient_list_from_soap_parameter):
+	Set the completion date for group tasks.
+	(_EGwItemPrivate): Added a string variable completed_date.
+	(e_gw_item_init): Initialized the variable.
+	(e_gw_item_dispose): Free all the dates.
+
+004-10-13 Sivaiah Nallagatla    <snallagatla novell com>
                                                                                                     
         * e-gw-connection.c (reauthenitcate) : new function to reautheicate
         to server when the sessionid we have becomes invalid because of timeouts
Index: servers/groupwise/e-gw-item.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-item.c,v
retrieving revision 1.47
diff -u -p -r1.47 e-gw-item.c
--- servers/groupwise/e-gw-item.c	7 Oct 2004 06:45:00 -0000	1.47
+++ servers/groupwise/e-gw-item.c	14 Oct 2004 14:37:30 -0000
@@ -42,6 +42,7 @@ struct _EGwItemPrivate {
 	char *start_date;
 	char *end_date;
 	char *due_date;
+	char *completed_date;
 	gboolean completed;
 	gboolean is_allday_event;
 	char *subject;
@@ -195,6 +196,31 @@ e_gw_item_dispose (GObject *object)
 			priv->id = NULL;
 		}
 
+		if (priv->completed_date) {
+			g_free (priv->completed_date);
+			priv->completed_date = NULL;
+		}
+
+		if (priv->creation_date) {
+			g_free (priv->creation_date);
+			priv->creation_date = NULL;
+		}
+
+		if (priv->start_date) {
+			g_free (priv->start_date);
+			priv->start_date = NULL;
+		}
+		
+		if (priv->end_date) {
+			g_free (priv->end_date);
+			priv->end_date = NULL;
+		}
+
+		if (priv->due_date) {
+			g_free (priv->due_date);
+			priv->due_date = NULL;
+		}
+
 		if (priv->subject) {
 			g_free (priv->subject);
 			priv->subject = NULL;
@@ -328,6 +354,7 @@ e_gw_item_init (EGwItem *item, EGwItemCl
 	priv->start_date = NULL;
 	priv->end_date = NULL; 
 	priv->due_date = NULL; 
+	priv->completed_date = NULL;
 	priv->trigger = 0;
 	priv->recipient_list = NULL;
 	priv->organizer = NULL;
@@ -435,6 +462,15 @@ set_recipient_list_from_soap_parameter (
 				recipient->status = E_GW_ITEM_STAT_ACCEPTED;
 			else 	
 				recipient->status = E_GW_ITEM_STAT_NONE;
+			subparam = soup_soap_parameter_get_first_child_by_name (subparam, "completed");
+			if (subparam) {
+				char *formatted_date, *value; 
+				value = soup_soap_parameter_get_string_value (subparam);
+				formatted_date = e_gw_connection_format_date_string (value);
+				e_gw_item_set_completed_date (item, formatted_date);
+				g_free (value);
+				g_free (formatted_date);
+			}
                 }
 		else {
 			/* if recipientStatus is not provided, use the
@@ -1643,6 +1679,24 @@ e_gw_item_set_due_date (EGwItem *item, c
 	if (item->priv->due_date)
 		g_free (item->priv->due_date);
 	item->priv->due_date = g_strdup (new_date);
+}
+
+char *
+e_gw_item_get_completed_date (EGwItem *item)
+{
+	g_return_val_if_fail (E_IS_GW_ITEM (item), NULL);
+
+	return item->priv->completed_date;
+}
+
+void 
+e_gw_item_set_completed_date (EGwItem *item, const char *new_date)
+{
+	g_return_if_fail (E_IS_GW_ITEM (item));
+
+	if (item->priv->completed_date)
+		g_free (item->priv->completed_date);
+	item->priv->completed_date = g_strdup (new_date);
 }
 
 const char *
Index: servers/groupwise/e-gw-item.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/servers/groupwise/e-gw-item.h,v
retrieving revision 1.20
diff -u -p -r1.20 e-gw-item.h
--- servers/groupwise/e-gw-item.h	8 Sep 2004 11:34:12 -0000	1.20
+++ servers/groupwise/e-gw-item.h	14 Oct 2004 14:37:30 -0000
@@ -119,6 +119,8 @@ char       *e_gw_item_get_creation_date 
 void        e_gw_item_set_creation_date (EGwItem *item, const char *new_date);
 char       *e_gw_item_get_start_date (EGwItem *item);
 void        e_gw_item_set_start_date (EGwItem *item, const char *new_date);
+char       *e_gw_item_get_completed_date (EGwItem *item);
+void        e_gw_item_set_completed_date (EGwItem *item, const char *new_date);
 char       *e_gw_item_get_end_date (EGwItem *item);
 void        e_gw_item_set_end_date (EGwItem *item, const char *new_date);
 char       *e_gw_item_get_due_date (EGwItem *item);


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