diff --git a/ChangeLog b/ChangeLog index 819ff5fab..fc7a69987 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-06-30 Ludovic Marcotte + + * When displaying cards, we now make sure that + the "service" is non-empty prior creating the + proper field value. + 2010-06-30 Francis Lachapelle * UI/WebServerResources/MailerUI.js (onDocumentKeydown): improved diff --git a/UI/Contacts/UIxContactEditor.m b/UI/Contacts/UIxContactEditor.m index e4a1d4755..23815638c 100644 --- a/UI/Contacts/UIxContactEditor.m +++ b/UI/Contacts/UIxContactEditor.m @@ -1,14 +1,15 @@ /* Copyright (C) 2004-2005 SKYRIX Software AG + Copyright (C) 2005-2010 Inverse inc. - This file is part of OpenGroupware.org. + This file is part of SOGo - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. @@ -324,7 +325,8 @@ - (void) _setupOrgFields { - NSArray *org, *orgServices; + NSMutableArray *orgServices; + NSArray *org; NSRange aRange; unsigned int max; @@ -336,7 +338,11 @@ if (max > 1) { aRange = NSMakeRange (1, max - 1); - orgServices = [org subarrayWithRange: aRange]; + orgServices = [NSMutableArray arrayWithArray: [org subarrayWithRange: aRange]]; + + while ([orgServices containsObject: @""]) + [orgServices removeObject: @""]; + [self _setSnapshotValue: @"workService" to: [orgServices componentsJoinedByString: @", "]]; } diff --git a/UI/Contacts/UIxContactView.m b/UI/Contacts/UIxContactView.m index b2e073310..8a079aba7 100644 --- a/UI/Contacts/UIxContactView.m +++ b/UI/Contacts/UIxContactView.m @@ -1,14 +1,15 @@ /* Copyright (C) 2004 SKYRIX Software AG + Copyright (C) 2005-2010 Inverse inc. + + This file is part of SOGo. - This file is part of OpenGroupware.org. - - OGo is free software; you can redistribute it and/or modify it under + SOGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - OGo is distributed in the hope that it will be useful, but WITHOUT ANY + SOGo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. @@ -357,15 +358,20 @@ - (NSString *) workService { - NSArray *org, *orgServices; + NSMutableArray *orgServices; + NSArray *org; NSRange aRange; NSString *services; org = [card org]; if (org && [org count] > 1) { - aRange = NSMakeRange (1, [org count] - 1); - orgServices = [org subarrayWithRange: aRange]; + aRange = NSMakeRange(1, [org count]-1); + orgServices = [NSMutableArray arrayWithArray: [org subarrayWithRange: aRange]]; + + while ([orgServices containsObject: @""]) + [orgServices removeObject: @""]; + services = [orgServices componentsJoinedByString: @", "]; } else