From 2d6af7647ecb8e22089d8e27b60c1313a822b78c Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 5 Apr 2010 20:17:39 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: bf61903ccf7c6cc0d2ac1b5e7741da7a1e6dd891 Monotone-Revision: 815204fe1b8d9f62f875d9e22c4883aede5c1e8d Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2010-04-05T20:17:39 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ UI/Contacts/UIxContactEditor.m | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) 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"