merge of '031984b557650859a910a3514084f8eb19b77b6d'

and 'cf3bacd77b08f56b9e8a219124225b7f4a5a9d4a'

Monotone-Parent: 031984b557650859a910a3514084f8eb19b77b6d
Monotone-Parent: cf3bacd77b08f56b9e8a219124225b7f4a5a9d4a
Monotone-Revision: 7e77770c07adaadb54d51bda81ce7804c86d2125

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-09-19T15:36:03
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2006-09-19 15:36:03 +00:00
commit 150c19e23f
2 changed files with 20 additions and 10 deletions

View file

@ -1,5 +1,10 @@
2006-09-19 Wolfgang Sourdeau <wsourdeau@inverse.ca> 2006-09-19 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Contacts/UIxContactView.m ([UIxContactView -note]): convert
carriage-returns to "<br />".
([UIxContactView -workCompany]): explicitly initialize company to
nil if org is nil or empty.
* UI/WebServerResources/UIxContactEditor.js: updated validation * UI/WebServerResources/UIxContactEditor.js: updated validation
code after we added and renamed some fields. code after we added and renamed some fields.

View file

@ -312,6 +312,8 @@
org = [card org]; org = [card org];
if (org && [org count] > 0) if (org && [org count] > 0)
company = [org objectAtIndex: 0]; company = [org objectAtIndex: 0];
else
company = nil;
return [self _cardStringWithLabel: nil value: company]; return [self _cardStringWithLabel: nil value: company];
} }
@ -416,6 +418,7 @@
[self setQueryParameter:_param forKey:_key]; [self setQueryParameter:_param forKey:_key];
href = [self completeHrefForMethod:[self ownMethodName]]; href = [self completeHrefForMethod:[self ownMethodName]];
[self setQueryParameter:nil forKey:_key]; [self setQueryParameter:nil forKey:_key];
return href; return href;
} }
@ -456,14 +459,13 @@
card = [[self clientObject] vCard]; card = [[self clientObject] vCard];
if (card) if (card)
{ {
NSLog (@"displaying card for contact id: %@", [[self clientObject] nameInContainer]);
phones = nil; phones = nil;
homeAdr = nil; homeAdr = nil;
workAdr = nil; workAdr = nil;
} }
else else
return [NSException exceptionWithHTTPStatus:404 /* Not Found */ return [NSException exceptionWithHTTPStatus: 404 /* Not Found */
reason:@"could not locate contact"]; reason: @"could not locate contact"];
return self; return self;
} }
@ -478,20 +480,23 @@
NSException *ex; NSException *ex;
id url; id url;
if (![self isDeletableClientObject]) { if (![self isDeletableClientObject])
/* return 400 == Bad Request */ /* return 400 == Bad Request */
return [NSException exceptionWithHTTPStatus:400 return [NSException exceptionWithHTTPStatus:400
reason:@"method cannot be invoked on " reason:@"method cannot be invoked on "
@"the specified object"]; @"the specified object"];
}
if ((ex = [[self clientObject] delete]) != nil) { ex = [[self clientObject] delete];
if (ex)
{
// TODO: improve error handling // TODO: improve error handling
[self debugWithFormat:@"failed to delete: %@", ex]; [self debugWithFormat:@"failed to delete: %@", ex];
return ex;
} return ex;
}
url = [[[self clientObject] container] baseURLInContext:[self context]]; url = [[[self clientObject] container] baseURLInContext:[self context]];
return [self redirectToLocation:url]; return [self redirectToLocation:url];
} }