evolution-data-server r9882 - in trunk/addressbook: . backends/groupwise



Author: abharath
Date: Wed Jan  7 06:18:44 2009
New Revision: 9882
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9882&view=rev

Log:
2009-01-07  Ashish Shrivastava  <shashish novell com>

       ** Fix for BNC bug #435599

       * backends/groupwise/e-book-backend-groupwise.c:
        (fill_contact_from_gw_item), (e_book_backend_groupwise_modify_contact): 
        Don't do to displaying and creation of organization's contact in evolution.


Modified:
   trunk/addressbook/ChangeLog
   trunk/addressbook/backends/groupwise/e-book-backend-groupwise.c

Modified: trunk/addressbook/backends/groupwise/e-book-backend-groupwise.c
==============================================================================
--- trunk/addressbook/backends/groupwise/e-book-backend-groupwise.c	(original)
+++ trunk/addressbook/backends/groupwise/e-book-backend-groupwise.c	Wed Jan  7 06:18:44 2009
@@ -1197,8 +1197,11 @@
 	int element_type;
 	int i;
 	gboolean is_contact_list;
+	gboolean is_organization;
 
+	is_organization = e_gw_item_get_item_type (item) == E_GW_ITEM_TYPE_ORGANISATION ? TRUE: FALSE;
 	is_contact_list = e_gw_item_get_item_type (item) == E_GW_ITEM_TYPE_GROUP ? TRUE: FALSE;
+
 	e_contact_set (contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (is_contact_list));
 	if (is_contact_list)
 		e_contact_set (contact, E_CONTACT_LIST_SHOW_ADDRESSES, GINT_TO_POINTER (TRUE));
@@ -1208,9 +1211,11 @@
 
 		if(element_type == ELEMENT_TYPE_SIMPLE) {
 			if (mappings[i].field_id != E_CONTACT_BOOK_URI) {
-				value = e_gw_item_get_field_value (item, mappings[i].element_name);
-				if(value != NULL)
-					e_contact_set (contact, mappings[i].field_id, value);
+				if (!is_organization) {
+					value = e_gw_item_get_field_value (item, mappings[i].element_name);
+					if(value != NULL)
+						e_contact_set (contact, mappings[i].field_id, value);
+				}				
 			}
 		} else if (element_type == ELEMENT_TYPE_COMPLEX) {
 			if (mappings[i].field_id == E_CONTACT_CATEGORIES) {
@@ -1280,10 +1285,6 @@
 			element_type = mappings[i].element_type;
 			if (element_type == ELEMENT_TYPE_SIMPLE)  {
 				value =  e_contact_get(contact, mappings[i].field_id);
-				if (mappings[i].field_id == E_CONTACT_ORG) {
-					set_organization_in_gw_item (item, contact, egwb);
-					continue;
-				}
 				if (value != NULL)
 					e_gw_item_set_field_value (item, mappings[i].element_name, value);
 			} else if (element_type == ELEMENT_TYPE_COMPLEX) {
@@ -1482,13 +1483,6 @@
 
 		if (e_contact_get (contact, E_CONTACT_IS_LIST))
 			set_member_changes (new_item, old_item, egwb);
-		new_org = e_gw_item_get_field_value (new_item, "organization");
-		old_org = e_gw_item_get_field_value (old_item, "organization");
-		if (new_org && *new_org) {
-
-			if ((old_org == NULL) || (old_org && strcmp (new_org, old_org)) != 0)
-				set_organization_in_gw_item (new_item, contact, egwb);
-		}
 
 		set_changes_in_gw_item (new_item, old_item);
 



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