From f741354d3d7fb2ba39e1c29b2ff18e1bf122e9ec Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 2 Apr 2007 21:13:57 +0000 Subject: [PATCH] Monotone-Parent: 6e9bce1000589aa89ad5a242618e33803b931ca2 Monotone-Revision: 75309c63ac3f2610d9a8f45ed263389466bcc74e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-04-02T21:13:57 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++ UI/Contacts/English.lproj/Localizable.strings | 7 ++-- UI/Contacts/French.lproj/Localizable.strings | 6 ++- UI/Contacts/UIxContactEditor.m | 42 +++++++++++-------- 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70b350e0c..cbe8059a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-04-02 Wolfgang Sourdeau + * UI/Contacts/UIxContactEditor.m ([UIxContactEditor + -_saveSnapshot]): save url values from snapshot. + ([UIxContactEditor -initSnapshot]): load url values from snapshot. + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor -calendarList]): new method replacing "availableCalendars". diff --git a/UI/Contacts/English.lproj/Localizable.strings b/UI/Contacts/English.lproj/Localizable.strings index c6256673b..d94efb274 100644 --- a/UI/Contacts/English.lproj/Localizable.strings +++ b/UI/Contacts/English.lproj/Localizable.strings @@ -6,8 +6,8 @@ "Common" = "Common"; "Contact editor" = "Contact editor"; "Contact viewer" = "Contact viewer"; -"Copy from Anais" = "Copy from Anais"; -"EMail" = "EMail"; +"Email" = "Email"; +"Screen Name" = "Screen Name"; "Extended" = "Extended"; "Fax" = "Fax"; "Firstname" = "Firstname"; @@ -18,7 +18,8 @@ "MobilePhone" = "MobilePhone"; "Name" = "Name"; "OfficePhone" = "OfficePhone"; -"Organisation" = "Organisation"; +"Organization" = "Organization"; +"Work Phone" = "Work Phone"; "Phone" = "Phone"; "Phones" = "Phones"; "Postal" = "Postal"; diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index 660de0242..940de3a53 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -16,7 +16,8 @@ "Common" = "Identité"; "Contact editor" = "Éditer le contact"; "Contact viewer" = "Visualiser le contact"; -"EMail" = "Courriel"; +"Email" = "Adresse électronique"; +"Screen Name" = "Pseudo"; "Extended" = "Informations complémentaires"; "Fax" = "Fax"; "Firstname" = "Prénom"; @@ -25,7 +26,8 @@ "Location" = "Lieux"; "MobilePhone" = "Mobile"; "OfficePhone" = "Bureau"; -"Organisation" = "Société"; +"Organization" = "Société"; +"Work Phone" = "Travail"; "Phone" = "Téléphone"; "Postal" = "Professionnelle"; "Save" = "Sauvegarder"; diff --git a/UI/Contacts/UIxContactEditor.m b/UI/Contacts/UIxContactEditor.m index b65469a1e..0b6dd7b74 100644 --- a/UI/Contacts/UIxContactEditor.m +++ b/UI/Contacts/UIxContactEditor.m @@ -83,13 +83,14 @@ /* load/store content format */ -- (void)_fixupSnapshot { +- (void) _fixupSnapshot +{ // TODO: perform sanity checking, eg build CN on demand NSString *cn, *gn, *sn; - cn = [snapshot objectForKey:@"cn"]; - gn = [snapshot objectForKey:@"givenName"]; - sn = [snapshot objectForKey:@"sn"]; + cn = [snapshot objectForKey: @"cn"]; + gn = [snapshot objectForKey: @"givenName"]; + sn = [snapshot objectForKey: @"sn"]; if (![sn isNotNull] || [sn length] == 0) sn = nil; @@ -103,12 +104,12 @@ // TODO: need a better name parser here NSRange r; - r = [cn rangeOfString:@" "]; + r = [cn rangeOfString: @" "]; sn = (r.length > 0) ? [cn substringFromIndex:(r.location + r.length)] : cn; } - [snapshot setObject:sn forKey:@"sn"]; + [snapshot setObject:sn forKey: @"sn"]; } if (sn == nil && gn == nil) cn = @"[noname]"; @@ -117,8 +118,8 @@ else if (gn == nil) cn = sn; else - cn = [[gn stringByAppendingString:@" "] stringByAppendingString:sn]; - [snapshot setObject:cn forKey:@"cn"]; + cn = [[gn stringByAppendingString: @" "] stringByAppendingString:sn]; + [snapshot setObject:cn forKey: @"cn"]; } /* helper */ @@ -131,13 +132,13 @@ uri = [[[self context] request] uri]; /* first: identify query parameters */ - r = [uri rangeOfString:@"?" options:NSBackwardsSearch]; + r = [uri rangeOfString: @"?" options:NSBackwardsSearch]; if (r.length > 0) uri = [uri substringToIndex:r.location]; /* next: append trailing slash */ - if (![uri hasSuffix:@"/"]) - uri = [uri stringByAppendingString:@"/"]; + if (![uri hasSuffix: @"/"]) + uri = [uri stringByAppendingString: @"/"]; /* next: append method */ uri = [uri stringByAppendingString:_method]; @@ -373,7 +374,7 @@ [self initSnapshot]; else return [NSException exceptionWithHTTPStatus:404 /* Not Found */ - reason:@"could not open contact"]; + reason: @"could not open contact"]; return self; } @@ -492,8 +493,14 @@ [self _savePhoneValues]; [self _saveEmails]; + [[self _elementWithTag: @"url" ofType: @"home"] + setValue: 0 to: [snapshot objectForKey: @"homeURL"]]; + [[self _elementWithTag: @"url" ofType: @"work"] + setValue: 0 to: [snapshot objectForKey: @"workURL"]]; + [[card uniqueChildWithTag: @"x-aim"] - setValue: 0 to: [snapshot objectForKey: @"screenName"]]; + setValue: 0 + to: [snapshot objectForKey: @"screenName"]]; } - (id ) saveAction @@ -547,7 +554,8 @@ [self redirectToLocation: [self relativePathToUserFolderSubPath: url]]; } -- (id)newAction { +- (id) newAction +{ // TODO: this is almost a DUP of UIxAppointmentEditor /* This method creates a unique ID and redirects to the "edit" method on the @@ -568,10 +576,10 @@ if ([objectId length] == 0) return [NSException exceptionWithHTTPStatus:500 /* Internal Error */ - reason:@"could not create a unique ID"]; + reason: @"could not create a unique ID"]; - nextMethod = [NSString stringWithFormat:@"../%@/%@", - objectId, [self editActionName]]; + nextMethod = [NSString stringWithFormat: @"../%@/%@", + objectId, [self editActionName]]; uri = [self _completeURIForMethod:nextMethod]; return [self redirectToLocation:uri]; }