diff --git a/ChangeLog b/ChangeLog index 818bea60a..a6bf22cab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,11 @@ We now use URL: in cards w/o a home/work preferred value as a home URL. + * UI/Contacts/UIxContactEditor.m + We now fallback to TEL;VOICE: when neither HOME + or WORK are defined. We set that value as the + WORK telephone number in this particular case. + 2010-04-02 Francis Lachapelle * SoObjects/Appointments/SOGoCalendarComponent.m diff --git a/UI/Contacts/UIxContactEditor.m b/UI/Contacts/UIxContactEditor.m index f272ba7c8..16ea53716 100644 --- a/UI/Contacts/UIxContactEditor.m +++ b/UI/Contacts/UIxContactEditor.m @@ -395,6 +395,28 @@ [self _setSnapshotValue: @"pager" to: [self _simpleValueForType: @"pager" inArray: elements]]; + // If we don't have a "home" and "work" phone number but + // we have a "voice" one defined, we set it to the "work" value + // This can happen when we have : + // VERSION:2.1 + // N:name;surname;;;; + // TEL;VOICE;HOME: + // TEL;VOICE;WORK: + // TEL;PAGER: + // TEL;FAX;WORK: + // TEL;CELL:514 123 1234 + // TEL;VOICE:450 456 6789 + // ADR;HOME:;;;;;; + // ADR;WORK:;;;;;; + // ADR:;;;;;; + if ([[snapshot objectForKey: @"telephoneNumber"] length] == 0 && + [[snapshot objectForKey: @"homeTelephoneNumber"] length] == 0 && + [elements count] > 0) + { + [self _setSnapshotValue: @"telephoneNumber" + to: [self _simpleValueForType: @"voice" inArray: elements]]; + } + [self _setupEmailFields]; [self _setSnapshotValue: @"screenName"