diff --git a/SoObjects/Contacts/SOGoContactGCSFolder.m b/SoObjects/Contacts/SOGoContactGCSFolder.m index 54cb7efc2..6d9fa4f5a 100644 --- a/SoObjects/Contacts/SOGoContactGCSFolder.m +++ b/SoObjects/Contacts/SOGoContactGCSFolder.m @@ -218,11 +218,6 @@ static NSArray *folderListingFields = nil; { NSString *data; - // c_component => tag - data = [contactRecord objectForKey: @"c_component"]; - if ([data length]) - [contactRecord setObject: data forKey: @"tag"]; - // c_categories => categories data = [contactRecord objectForKey: @"c_categories"]; if ([data length]) @@ -235,9 +230,7 @@ static NSArray *folderListingFields = nil; // c_cn => fn data = [contactRecord objectForKey: @"c_cn"]; - if ([data length]) - [contactRecord setObject: data forKey: @"fn"]; - else + if (![data length]) { data = [contactRecord keysWithFormat: @"%{c_givenname} %{c_sn}"]; if ([data length] > 1) @@ -251,25 +244,10 @@ static NSArray *folderListingFields = nil; } } - // c_givenname => givenname - data = [contactRecord objectForKey: @"c_givenname"]; - if ([data length]) - [contactRecord setObject: data forKey: @"givenname"]; - - // c_sn => sn - data = [contactRecord objectForKey: @"c_sn"]; - if ([data length]) - [contactRecord setObject: data forKey: @"sn"]; - // c_screenname => X-AIM if (![contactRecord objectForKey: @"c_screenname"]) [contactRecord setObject: @"" forKey: @"c_screenname"]; - // c_o => org - data = [contactRecord objectForKey: @"c_o"]; - if ([data length]) - [contactRecord setObject: data forKey: @"org"]; - // c_mail => emails[] data = [contactRecord objectForKey: @"c_mail"]; if ([data length]) diff --git a/SoObjects/Contacts/SOGoContactSourceFolder.m b/SoObjects/Contacts/SOGoContactSourceFolder.m index 368d65128..a52ec20b9 100644 --- a/SoObjects/Contacts/SOGoContactSourceFolder.m +++ b/SoObjects/Contacts/SOGoContactSourceFolder.m @@ -318,12 +318,12 @@ if (data) { [newRecord setObject: data forKey: @"isGroup"]; - [newRecord setObject: @"vlist" forKey: @"tag"]; + [newRecord setObject: @"vlist" forKey: @"c_component"]; } #warning TODO: create a custom icon for resources else { - [newRecord setObject: @"vcard" forKey: @"tag"]; + [newRecord setObject: @"vcard" forKey: @"c_component"]; } // c_info => note diff --git a/UI/Contacts/UIxContactEditor.m b/UI/Contacts/UIxContactEditor.m index 4d78f9c05..d2c0df009 100644 --- a/UI/Contacts/UIxContactEditor.m +++ b/UI/Contacts/UIxContactEditor.m @@ -351,11 +351,11 @@ static Class SOGoContactGCSEntryK = Nil; id o; unsigned int i, year, month, day; - [card setNWithFamily: [attributes objectForKey: @"sn"] - given: [attributes objectForKey: @"givenname"] + [card setNWithFamily: [attributes objectForKey: @"c_sn"] + given: [attributes objectForKey: @"c_givenname"] additional: nil prefixes: nil suffixes: nil]; [card setNickname: [attributes objectForKey: @"nickname"]]; - [card setFn: [attributes objectForKey: @"fn"]]; + [card setFn: [attributes objectForKey: @"c_cn"]]; [card setTitle: [attributes objectForKey: @"title"]]; unsigned int seconds = [[NSString stringWithFormat: @"%@", [attributes objectForKey: @"birthday"]] intValue]; @@ -416,7 +416,7 @@ static Class SOGoContactGCSEntryK = Nil; { units = nil; } - [card setOrg: [attributes objectForKey: @"org"] + [card setOrg: [attributes objectForKey: @"c_org"] units: units]; elements = [card childrenWithTag: @"tel"]; @@ -509,11 +509,11 @@ static Class SOGoContactGCSEntryK = Nil; * * @apiParam {String} id Card ID * @apiParam {String} pid Address book ID (card's container) - * @apiParam {String} tag Either vcard or vlist - * @apiParam {String} givenname Firstname + * @apiParam {String} c_component Either vcard or vlist + * @apiParam {String} c_givenname Firstname * @apiParam {String} nickname Nickname - * @apiParam {String} sn Lastname - * @apiParam {String} fn Fullname + * @apiParam {String} c_sn Lastname + * @apiParam {String} c_cn Fullname * @apiParam {String} tz Timezone * @apiParam {String} note Note * @apiParam {String[]} allCategories All available categories diff --git a/UI/Contacts/UIxContactView.m b/UI/Contacts/UIxContactView.m index 9c608c726..dab618d85 100644 --- a/UI/Contacts/UIxContactView.m +++ b/UI/Contacts/UIxContactView.m @@ -747,11 +747,11 @@ * * @apiSuccess (Success 200) {String} id Card ID * @apiSuccess (Success 200) {String} pid Address book ID (card's container) - * @apiSuccess (Success 200) {String} tag Either vcard or vlist - * @apiSuccess (Success 200) {String} [givenname] Firstname + * @apiSuccess (Success 200) {String} c_component Either vcard or vlist + * @apiSuccess (Success 200) {String} [c_givenname] Firstname * @apiSuccess (Success 200) {String} [nickname] Nickname - * @apiSuccess (Success 200) {String} [sn] Lastname - * @apiSuccess (Success 200) {String} [fn] Fullname + * @apiSuccess (Success 200) {String} [c_sn] Lastname + * @apiSuccess (Success 200) {String} [c_fn] Fullname * @apiSuccess (Success 200) {String} [tz] Timezone * @apiSuccess (Success 200) {String} [note] Note * @apiSuccess (Success 200) {String[]} allCategories All available categories @@ -799,19 +799,19 @@ data = [NSMutableDictionary dictionaryWithObjectsAndKeys: [[contact container] nameInContainer], @"pid", [contact nameInContainer], @"id", - [[card tag] lowercaseString], @"tag", + [[card tag] lowercaseString], @"c_component", nil]; o = [card fn]; - if (o) [data setObject: o forKey: @"fn"]; + if (o) [data setObject: o forKey: @"c_cn"]; o = [card n]; if (o) { NSString *lastName = [o flattenedValueAtIndex: 0 forKey: @""]; NSString *firstName = [o flattenedValueAtIndex: 1 forKey: @""]; if ([lastName length] > 0) - [data setObject: lastName forKey: @"sn"]; + [data setObject: lastName forKey: @"c_sn"]; if ([firstName length] > 0) - [data setObject: firstName forKey: @"givenname"]; + [data setObject: firstName forKey: @"c_givenname"]; } o = [card nickname]; if (o) [data setObject: o forKey: @"nickname"]; @@ -833,7 +833,7 @@ o = [card workCompany]; if ([o length] > 0) { - [data setObject: o forKey: @"org"]; + [data setObject: o forKey: @"c_org"]; } o = [card birthday]; diff --git a/UI/Contacts/UIxContactsListActions.m b/UI/Contacts/UIxContactsListActions.m index e59741634..af9eee5f9 100644 --- a/UI/Contacts/UIxContactsListActions.m +++ b/UI/Contacts/UIxContactsListActions.m @@ -162,12 +162,9 @@ * @apiSuccess (Success 200) {Object[]} [cards] Matching cards * @apiSuccess (Success 200) {String} cards.id Card ID * @apiSuccess (Success 200) {String} cards.c_name Card ID - * @apiSuccess (Success 200) {String} cards.tag Either vcard or vlist * @apiSuccess (Success 200) {String} cards.c_component Either vcard or vlist * @apiSuccess (Success 200) {String} cards.c_cn Fullname - * @apiSuccess (Success 200) {String} cards.givenname Fullname * @apiSuccess (Success 200) {String} cards.c_givenname Firstname - * @apiSuccess (Success 200) {String} cards.sn Firstname * @apiSuccess (Success 200) {String} cards.c_sn Lastname * @apiSuccess (Success 200) {String} cards.c_screenname Screenname * @apiSuccess (Success 200) {String} cards.c_o Organization name diff --git a/UI/Contacts/UIxListEditor.m b/UI/Contacts/UIxListEditor.m index 99d594c44..10ea2736e 100644 --- a/UI/Contacts/UIxListEditor.m +++ b/UI/Contacts/UIxListEditor.m @@ -208,7 +208,7 @@ if ([[references objectAtIndex: i] isKindOfClass: [NSDictionary class]]) { currentReference = [references objectAtIndex: i]; - uid = [currentReference objectForKey: @"reference"]; + uid = [currentReference objectForKey: @"id"]; if (![self cardReferences: [list cardReferences] contain: uid]) { @@ -231,7 +231,7 @@ SOGoContactGCSEntry *newContact; workMail = [currentReference objectForKey: @"email"]; - fn = [currentReference objectForKey: @"fn"]; + fn = [currentReference objectForKey: @"c_cn"]; // Create a new vCard newUID = [NSString stringWithFormat: @"%@.vcf", [co globallyUniqueObjectId]]; @@ -290,7 +290,7 @@ - (void) setAttributes: (NSDictionary *) attributes { [list setNickname: [attributes objectForKey: @"nickname"]]; - [list setFn: [attributes objectForKey: @"fn"]]; + [list setFn: [attributes objectForKey: @"c_cn"]]; [list setDescription: [attributes objectForKey: @"description"]]; } diff --git a/UI/Contacts/UIxListView.m b/UI/Contacts/UIxListView.m index 64cc3ceb4..dcea4d3bc 100644 --- a/UI/Contacts/UIxListView.m +++ b/UI/Contacts/UIxListView.m @@ -166,7 +166,7 @@ card = [[list cardReferences] objectAtIndex: i]; [cards addObject: [NSDictionary dictionaryWithObjectsAndKeys: [card reference], @"reference", - [card fn], @"fn", + [card fn], @"c_cn", [card email], @"email", nil]]; } @@ -174,8 +174,8 @@ data = [NSMutableDictionary dictionaryWithObjectsAndKeys: [[co container] nameInContainer], @"pid", [co nameInContainer], @"id", - [[list tag] lowercaseString], @"tag", - [list fn], @"fn", + [[list tag] lowercaseString], @"c_component", + [list fn], @"c_cn", [list nickname], @"nickname", [list description], @"description", cards, @"refs", diff --git a/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox b/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox index 0b676c242..ff35ff34c 100644 --- a/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox +++ b/UI/Templates/ContactsUI/UIxContactEditorTemplate.wox @@ -16,7 +16,7 @@ - +