diff --git a/ChangeLog b/ChangeLog index 18b3531ef..13206cb89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-08-21 Wolfgang Sourdeau + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor + -takeValuesFromRequest:_rqinContext:_ctx]): save the category + selected in the dialog. + ([UIxComponentEditor -setComponent:newComponent]): retrieve the + first category, if ever, of the calendar entity. + * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame -composeAction]): restored method since it is needed by the address book. diff --git a/UI/Scheduler/UIxComponentEditor.h b/UI/Scheduler/UIxComponentEditor.h index 71c511a6e..8eec9b4d4 100644 --- a/UI/Scheduler/UIxComponentEditor.h +++ b/UI/Scheduler/UIxComponentEditor.h @@ -51,6 +51,7 @@ NSString *priority; NSString *privacy; NSString *status; + NSString *category; NSArray *categories; NSDictionary *cycle; NSString *cycleEnd; diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index cec6bbd1a..eecd800ff 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -121,6 +121,19 @@ [emails release]; } +- (void) _loadCategories +{ + NSString *compCategories, *simpleCategory; + + compCategories = [component categories]; + if ([compCategories length] > 0) + { + simpleCategory = [[compCategories componentsSeparatedByString: @","] + objectAtIndex: 0]; + ASSIGN (category, [simpleCategory uppercaseString]); + } +} + /* warning: we use this method which will be triggered by the template system when the page is instantiated, but we should find another and cleaner way of doing this... for example, when the clientObject is set */ @@ -145,6 +158,7 @@ ASSIGN (status, [component status]); ASSIGN (categories, [[component categories] commaSeparatedValues]); ASSIGN (organizer, [component organizer]); + [self _loadCategories]; [self _loadAttendees]; } // /* cycles */ @@ -300,6 +314,16 @@ return categories; } +- (void) setCategory: (NSArray *) newCategory +{ + ASSIGN (category, newCategory); +} + +- (NSString *) category +{ + return category; +} + - (NSString *) itemCategoryText { return [self labelForKey: @@ -822,6 +846,7 @@ [component setComment: comment]; [component setUrl: url]; [component setAccessClass: privacy]; + [component setCategories: [category capitalizedString]]; [self _handleAttendeesEdition]; [self _handleOrganizer]; clientObject = [self clientObject];