View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000846 | SOGo | Backend Address Book | public | 2010-09-20 21:12 | 2012-02-04 23:28 |
Reporter | Hans | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Summary | 0000846: Export and import fields for contacts do not match | ||||
Description | Export a contact, import it back, a lots of fields are now empty. | ||||
Tags | No tags attached. | ||||
Provide an example. |
|
Just fill out all fields in a contact Hans. |
|
This was done on the demo site |
|
Example with SOGo 1.3.7a Exported from SOGo via web interface: Import into SOGo via web interface and the following do not get imported: It looks like the mozillaAbPersonObsolete attributes do not get imported. Work address fields are correctly imported. Bill C. |
|
2011-06-09 14:28
|
SOGoContactLDIFEntry.m.diff (5,104 bytes)
# # old_revision [64282771e1fb25846e93ccef41b7198b11c569f6] # # patch "SoObjects/Contacts/SOGoContactLDIFEntry.m" # from [71db282d913c7028250e0000ec1c0138370ebb7f] # to [ab9600cb1abfa069bb08014e6839995b1f121fcc] # ============================================================ --- SoObjects/Contacts/SOGoContactLDIFEntry.m 71db282d913c7028250e0000ec1c0138370ebb7f +++ SoObjects/Contacts/SOGoContactLDIFEntry.m ab9600cb1abfa069bb08014e6839995b1f121fcc @@ -87,6 +87,8 @@ [vCard addTel: info types: [NSArray arrayWithObjects: @"home", @"voice", nil]]; info = [ldifEntry objectForKey: @"fax"]; + if (!info) + info = [ldifEntry objectForKey: @"facsimiletelephonenumber"]; if (info) [vCard addTel: info types: [NSArray arrayWithObjects: @"work", @"fax", nil]]; @@ -109,7 +111,7 @@ - (NGVCard *) vCard { - NSString *info, *surname, *streetAddress, *location, *region, *postalCode, *country, *org, *orgunit; + NSString *info, *surname, *streetAddress2, *streetAddress, *location, *region, *postalCode, *country, *org, *orgunit, *year, *month, *day; CardElement *element; unsigned int count; @@ -156,8 +158,19 @@ if (info) [vcard addEmail: info types: [NSArray arrayWithObjects: @"internet", @"pref", nil]]; + info = [ldifEntry objectForKey: @"mozillasecondemail"]; + if (info) + [vcard addEmail: info + types: [NSArray arrayWithObjects: @"internet", nil]]; + info = [ldifEntry objectForKey: @"nsaimid"]; + if (info) + [vcard addChildWithTag: @"x-aim" + types: nil + singleValue: info]; [self _setPhonesOfVCard: vcard]; + streetAddress2 = [ldifEntry objectForKey: @"mozillaworkstreet2"]; + streetAddress = [ldifEntry objectForKey: @"street"]; if (!streetAddress) streetAddress = [ldifEntry objectForKey: @"streetaddress"]; @@ -182,6 +195,8 @@ attributes: nil values: nil]; [element setValue: 0 ofAttribute: @"type" to: @"work"]; + if (streetAddress2) + [element setValue: 1 to: streetAddress2]; if (streetAddress) [element setValue: 2 to: streetAddress]; if (location) @@ -193,9 +208,59 @@ if (country) [element setValue: 6 to: country]; - if (streetAddress || location || region || postalCode || country) + if (streetAddress2 || streetAddress || location || region || postalCode || country) [vcard addChild: element]; + info = [ldifEntry objectForKey: @"mozillaworkurl"]; + if (!info) + info = [ldifEntry objectForKey: @"workurl"]; + if (info) + [vcard addChildWithTag: @"url" + types: [NSArray arrayWithObjects: @"work", nil] + singleValue: info]; + + streetAddress2 = [ldifEntry objectForKey: @"mozillahomestreet2"]; + + streetAddress = [ldifEntry objectForKey: @"mozillahomestreet"]; + if (!streetAddress) + streetAddress = [ldifEntry objectForKey: @"homestreet"]; + + location = [ldifEntry objectForKey: @"mozillahomelocalityname"]; + + region = [ldifEntry objectForKey: @"mozillahomestate"]; + + postalCode = [ldifEntry objectForKey: @"mozillahomepostalcode"]; + + country = [ldifEntry objectForKey: @"mozillahomecountryname"]; + + element = [CardElement elementWithTag: @"adr" + attributes: nil values: nil]; + [element setValue: 0 ofAttribute: @"type" to: @"home"]; + + if (streetAddress2) + [element setValue: 1 to: streetAddress2]; + if (streetAddress) + [element setValue: 2 to: streetAddress]; + if (location) + [element setValue: 3 to: location]; + if (region) + [element setValue: 4 to: region]; + if (postalCode) + [element setValue: 5 to: postalCode]; + if (country) + [element setValue: 6 to: country]; + + if (streetAddress2 || streetAddress || location || region || postalCode || country) + [vcard addChild: element]; + + info = [ldifEntry objectForKey: @"mozillahomeurl"]; + if (!info) + info = [ldifEntry objectForKey: @"homeurl"]; + if (info) + [vcard addChildWithTag: @"url" + types: [NSArray arrayWithObjects: @"home", nil] + singleValue: info]; + // We handle the org/orgunit stuff element = [CardElement elementWithTag: @"org" attributes: nil values: nil]; @@ -212,6 +277,14 @@ if (org || orgunit) [vcard addChild: element]; + year = [ldifEntry objectForKey: @"birthyear"]; + month = [ldifEntry objectForKey: @"birthmonth"]; + day = [ldifEntry objectForKey: @"birthday"]; + if (year && month && day) + [vcard setBday: [NSString stringWithFormat: @"%04d-%02d-%02d", + [year intValue], [month intValue], + [day intValue]]]; + info = [ldifEntry objectForKey: @"calFBURL"]; if (info) [vcard addChildWithTag: @"FBURL" |
I've attached a patch for "SoObjects/Contacts/SOGoContactLDIFEntry.m", which adds support for the following attributes from https://wiki.mozilla.org/MailNews:Mozilla_LDAP_Address_Book_Schema facsimileTelephoneNumber (as an alternative to fax), Additionally, the birth date is set if the following attributes, which are exported by recent Thunderbird versions, are set: birthYear |
|
2011-06-09 17:13
|
NGVCard+SOGo.m.diff (2,079 bytes)
# # old_revision [d11c3e99fe05eb716e0732c7b5c44019dcd75934] # # patch "SoObjects/Contacts/NGVCard+SOGo.m" # from [e95f21b95e18be40b86be4a0ca997cd5daf29098] # to [b936897a63698300ba8634bb610e31ca31b65dff] # ============================================================ --- SoObjects/Contacts/NGVCard+SOGo.m e95f21b95e18be40b86be4a0ca997cd5daf29098 +++ SoObjects/Contacts/NGVCard+SOGo.m b936897a63698300ba8634bb610e31ca31b65dff @@ -72,6 +72,14 @@ if (buffer && [buffer length] > 0) [entry setObject: buffer forKey: @"mozillaNickname"]; + buffer = [self title]; + if (buffer && [buffer length] > 0) + [entry setObject: buffer forKey: @"title"]; + + buffer = [[self uniqueChildWithTag: @"x-aim"] value: 0]; + if (buffer && [buffer length] > 0) + [entry setObject: buffer forKey: @"nsAIMid"]; + marray = [NSMutableArray arrayWithArray: [self childrenWithTag: @"email"]]; [marray removeObjectsInArray: [self childrenWithTag: @"email" andAttribute: @"type" @@ -111,7 +119,13 @@ array = [self org]; if (array && [array count]) - [entry setObject: [array objectAtIndex: 0] forKey: @"o"]; + { + [entry setObject: [array objectAtIndex: 0] forKey: @"o"]; + if ([array count] > 1) + { + [entry setObject: [array objectAtIndex: 1] forKey: @"ou"]; + } + } array = [self childrenWithTag: @"adr" andAttribute: @"type" havingValue: @"work"]; if ([array count]) @@ -144,6 +158,18 @@ if (tmp && [tmp length]) [entry setObject: tmp forKey: @"description"]; + buffer = [self bday]; + if (buffer && [buffer length] > 0) + { + array = [buffer componentsSeparatedByString: @"-"]; + if ([array count] == 3) + { + [entry setObject: [array objectAtIndex: 0] forKey: @"birthyear"]; + [entry setObject: [array objectAtIndex: 1] forKey: @"birthmonth"]; + [entry setObject: [array objectAtIndex: 2] forKey: @"birthday"]; + } + } + rc = [NSMutableString stringWithString: [entry userRecordAsLDIFEntry]]; [rc appendFormat: @"\n"]; |
I've attached another patch that adds the following attributes to exported LDIF entries: title, BTW, shouldn't the attributes homeStreet, homeurl and workurl be renamed to mozillaHomeStreet, mozillaHomeUrl and mozillaWorkUrl? |
|
When will this be fixed? |
|
Theorically, this should be fixed in SOGo 2.0. Can anybody please give it a try? |
|
Still no birthday in the LDIFF-Export in Sogo 2.0.0.20120204 (Ubuntu Maverick nightly build) |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2010-09-20 21:12 | Hans | New Issue | |
2010-09-20 22:53 | ludovic | Note Added: 0001494 | |
2010-09-21 00:46 | Hans | Note Added: 0001495 | |
2010-09-21 00:47 | Hans | Note Added: 0001496 | |
2011-06-01 20:56 | cameronb | Note Added: 0002515 | |
2011-06-09 14:28 | avoegele | File Added: SOGoContactLDIFEntry.m.diff | |
2011-06-09 14:45 | avoegele | Note Added: 0002556 | |
2011-06-09 14:46 | avoegele | Note Edited: 0002556 | |
2011-06-09 14:47 | avoegele | Note Edited: 0002556 | |
2011-06-09 17:13 | avoegele | File Added: NGVCard+SOGo.m.diff | |
2011-06-09 17:21 | avoegele | Note Added: 0002559 | |
2012-01-16 16:54 | Christian Mack | Note Added: 0003275 | |
2012-01-16 16:55 |
|
Note Added: 0003276 | |
2012-02-04 23:28 | ccb23 | Note Added: 0003364 |