diff --git a/ChangeLog b/ChangeLog index e4d2d5260..0b19d82d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2006-10-13 Wolfgang Sourdeau + * UI/Scheduler/UIxCalCalendarsListView.m: new component class that + wrap a selector the the "Calendars" tab. + * UI/Contacts/UIxContactsCalendarsSelection.m: buttons for the new user calendar selector. diff --git a/UI/Scheduler/UIxCalCalendarsListView.h b/UI/Scheduler/UIxCalCalendarsListView.h new file mode 100644 index 000000000..cb545f269 --- /dev/null +++ b/UI/Scheduler/UIxCalCalendarsListView.h @@ -0,0 +1,36 @@ +/* UIxCalCalendarsListView.h - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef UIXCALCALENDARSLISTVIEW_H +#define UIXCALCALENDARSLISTVIEW_H + +#import + +@interface UIxCalCalendarsListView : UIxComponent +{ + NSMutableArray *checkedContacts; + NSMutableArray *contacts; +} + +@end + +#endif /* UIXCALCALENDARSLISTVIEW_H */ diff --git a/UI/Scheduler/UIxCalCalendarsListView.m b/UI/Scheduler/UIxCalCalendarsListView.m new file mode 100644 index 000000000..3614e215e --- /dev/null +++ b/UI/Scheduler/UIxCalCalendarsListView.m @@ -0,0 +1,96 @@ +/* UIxCalCalendarsListView.m - this file is part of SOGo + * + * Copyright (C) 2006 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import +#import +#import + +#import +#import + +#import "UIxCalCalendarsListView.h" + +@implementation UIxCalCalendarsListView + +- (id) init +{ + if ((self = [super init])) + { + contacts = nil; + checkedContacts = nil; + } + + return self; +} + +- (void) _setupContacts +{ + AgenorUserManager *um; + SOGoUser *user; + NSString *list, *currentId; + NSEnumerator *rawContacts; + iCalPerson *currentContact; + + contacts = [NSMutableArray array]; + checkedContacts = [NSMutableArray array]; + + um = [AgenorUserManager sharedUserManager]; + user = [context activeUser]; + list = [[user userDefaults] stringForKey: @"calendaruids"]; + if ([list length] == 0) + list = [self shortUserNameForDisplay]; + + rawContacts + = [[list componentsSeparatedByString: @","] objectEnumerator]; + currentId = [rawContacts nextObject]; + while (currentId) + { + if ([currentId hasPrefix: @"-"]) + currentContact + = [um iCalPersonWithUid: [currentId substringFromIndex: 1]]; + else + { + currentContact = [um iCalPersonWithUid: currentId]; + [checkedContacts addObject: currentContact]; + } + [contacts addObject: currentContact]; + currentId = [rawContacts nextObject]; + } +} + +- (NSArray *) contacts +{ + if (!contacts) + [self _setupContacts]; + + return contacts; +} + +- (NSArray *) checkedContacts +{ + if (!checkedContacts) + [self _setupContacts]; + + return checkedContacts; +} + +@end diff --git a/UI/Templates/SchedulerUI/UIxCalCalendarsListView.wox b/UI/Templates/SchedulerUI/UIxCalCalendarsListView.wox new file mode 100644 index 000000000..b9120779b --- /dev/null +++ b/UI/Templates/SchedulerUI/UIxCalCalendarsListView.wox @@ -0,0 +1,33 @@ + + + + +