diff --git a/ChangeLog b/ChangeLog index 9d229a5ce..60282fbd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-07-15 Wolfgang Sourdeau + + * UI/Scheduler/UIxComponentEditor.m (-categoryList): insert the + category of the current component in the list, don't convert it + to upper case and sort the resulting list alphabetically. + 2009-07-14 Francis Lachapelle * UI/SOGoUI/UIxComponent.m ([UIxComponent -buildDate]): moved diff --git a/UI/Scheduler/UIxComponentEditor.h b/UI/Scheduler/UIxComponentEditor.h index 910d4a466..2fdb1b28d 100644 --- a/UI/Scheduler/UIxComponentEditor.h +++ b/UI/Scheduler/UIxComponentEditor.h @@ -110,7 +110,6 @@ - (NSArray *) categoryList; - (void) setCategories: (NSArray *) _categories; - (NSArray *) categories; -- (NSString *) itemCategoryText; - (NSArray *) priorities; - (void) setPriority: (NSString *) _priority; diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index 089a67ebc..4353e5c35 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -53,6 +53,7 @@ #import #import #import +#import #import #import #import @@ -285,7 +286,7 @@ iRANGE(2); { simpleCategory = [[compCategories componentsSeparatedByString: @","] objectAtIndex: 0]; - ASSIGN (category, [simpleCategory uppercaseString]); + ASSIGN (category, simpleCategory); } } @@ -538,8 +539,8 @@ iRANGE(2); ASSIGN (privacy, [component accessClass]); ASSIGN (priority, [component priority]); ASSIGN (status, [component status]); - ASSIGN (categories, - [[component categories] componentsWithSafeSeparator: ',']); + ASSIGN (categories, + [[component categories] componentsWithSafeSeparator: ',']); ASSIGN (organizer, [component organizer]); [self _loadCategories]; [self _loadAttendees]; @@ -791,6 +792,9 @@ iRANGE(2); - (NSArray *) categoryList { static NSArray *categoryItems = nil; + NSMutableArray *categoryList; + unsigned int count, max; + NSString *categoryItem, *newCategoryItem; if (!categoryItems) { @@ -819,7 +823,22 @@ iRANGE(2); [categoryItems retain]; } - return categoryItems; + max = [categoryItems count]; + categoryList = [NSMutableArray arrayWithCapacity: max + 1]; + + for (count = 0; count < max; count++) + { + categoryItem = [categoryItems objectAtIndex: count]; + newCategoryItem + = [self labelForKey: [NSString stringWithFormat: @"category_%@", + categoryItem]]; + [categoryList addObject: newCategoryItem]; + } + if ([categories count]) + [categoryList addObjectsFromArray: categories]; + + return [[categoryList uniqueObjects] + sortedArrayUsingSelector: @selector (localizedCaseInsensitiveCompare:)]; } - (void) setCategories: (NSArray *) _categories @@ -832,7 +851,7 @@ iRANGE(2); return categories; } -- (void) setCategory: (NSArray *) newCategory +- (void) setCategory: (NSString *) newCategory { ASSIGN (category, newCategory); } @@ -842,12 +861,6 @@ iRANGE(2); return category; } -- (NSString *) itemCategoryText -{ - return [self labelForKey: - [NSString stringWithFormat: @"category_%@", item]]; -} - - (NSArray *) repeatList { static NSArray *repeatItems = nil; @@ -1713,7 +1726,7 @@ RANGE(2); [component setComment: comment]; [component setAttach: attachUrl]; [component setAccessClass: privacy]; - [component setCategories: [category capitalizedString]]; + [component setCategories: category]; [self _handleAttendeesEdition]; [self _handleOrganizer]; clientObject = [self clientObject]; diff --git a/UI/Templates/SchedulerUI/UIxComponentEditor.wox b/UI/Templates/SchedulerUI/UIxComponentEditor.wox index 246c59e0e..d8a027634 100644 --- a/UI/Templates/SchedulerUI/UIxComponentEditor.wox +++ b/UI/Templates/SchedulerUI/UIxComponentEditor.wox @@ -43,7 +43,7 @@