+2007-04-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * UI/Contacts/UIxContactView.m ([UIxContactView -workUrl]): we
+ want the "work" url instead of the "home".
+
+ * UI/Contacts/UIxContactEditor.m ([UIxContactEditor
+ -_saveSnapshot]): save url values from snapshot.
+ ([UIxContactEditor -initSnapshot]): load url values from snapshot.
+
+ * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor
+ -calendarList]): new method replacing "availableCalendars".
+
+ * UI/Scheduler/UIxCalendarSelector.m ([UIxCalendarSelector
+ -calendarFolders]): we now take the list of subscribed calendar
+ from the container.
+
+ * SoObjects/Appointments/SOGoAppointmentFolder.m
+ ([SOGoAppointmentFolder -calendarFoldersInContext:context]): new
+ method derived from and replacing [UIxCalView calendarFolders].
+
2007-03-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount
nil, nil
};
-- (NSMutableDictionary *) extractQuickFieldsFromVCard: (NGVCard *) _vCard
+- (NSMutableDictionary *) extractQuickFieldsFromVCard: (NGVCard *) vCard
{
NSMutableDictionary *fields;
NSArray *values;
NSString *value;
unsigned int max;
- if (_vCard == nil)
+ if (vCard == nil)
return nil;
fields = [NSMutableDictionary dictionaryWithCapacity:16];
- value = [_vCard fn];
+ value = [vCard fn];
if (value)
[fields setObject: value forKey: @"cn"];
- values = [_vCard n];
+ values = [vCard n];
if (values)
{
max = [values count];
forKey: @"givenName"];
}
}
- value = [_vCard preferredTel];
+ value = [vCard preferredTel];
if (value)
[fields setObject: value forKey: @"telephoneNumber"];
- value = [_vCard preferredEMail];
+ value = [vCard preferredEMail];
if (value)
[fields setObject: value forKey: @"mail"];
- values = [_vCard org];
- if (values)
+ values = [vCard org];
+ max = [values count];
+ if (max > 0)
{
- max = [values count];
- if (max > 0)
- {
- [fields setObject: [values objectAtIndex: 0] forKey: @"o"];
- if (max > 1)
- [fields setObject: [values objectAtIndex: 1] forKey: @"ou"];
- }
+ [fields setObject: [values objectAtIndex: 0] forKey: @"o"];
+ if (max > 1)
+ [fields setObject: [values objectAtIndex: 1] forKey: @"ou"];
}
- adr = [_vCard preferredAdr];
+ adr = [vCard preferredAdr];
if (adr)
[fields setObject: [adr value: 3] forKey: @"l"];
+ value = [[vCard uniqueChildWithTag: @"X-AIM"] value: 0];
+ [fields setObject: value forKey: @"screenname"];
return fields;
}
sqlType = "VARCHAR(256)";
allowsNull = YES;
},
+ {
+ columnName = screenname;
+ sqlType = "VARCHAR(256)";
+ allowsNull = YES;
+ },
{
columnName = l;
sqlType = "VARCHAR(256)";
givenname VARCHAR(256),
cn VARCHAR(256),
sn VARCHAR(256),
+ screenname VARCHAR(256),
l VARCHAR(256),
mail VARCHAR(256),
o VARCHAR(256),
- (NSArray *) fetchAllSOGoAppointments;
+- (NSArray *) calendarFoldersInContext: (WOContext *) context;
+
@end
#endif /* __Appointments_SOGoAppointmentFolder_H__ */
NSStringFromClass([self superclass]), [super version]);
lm = [NGLoggerManager defaultLoggerManager];
- logger = [lm loggerForDefaultKey:@"SOGoAppointmentFolderDebugEnabled"];
+ logger = [lm loggerForDefaultKey: @"SOGoAppointmentFolderDebugEnabled"];
// securityInfo = [self soClassSecurityInfo];
// [securityInfo declareRole: SOGoRole_Delegate
filters = [NSMutableArray new];
- children = [[parentNode getElementsByTagName: @"comp-filter"] objectEnumerator];
+ children = [[parentNode getElementsByTagName: @"comp-filter"]
+ objectEnumerator];
node = [children nextObject];
while (node)
{
}
if (nameFields == nil)
- nameFields = [[NSArray alloc] initWithObjects:@"c_name", nil];
+ nameFields = [[NSArray alloc] initWithObjects: @"c_name", nil];
qualifier = [EOQualifier qualifierWithQualifierFormat:@"uid = %@", _u];
records = [_f fetchFields: nameFields matchingQualifier: qualifier];
return events;
}
+#warning We only support ONE calendar per user at this time
+- (BOOL) _appendSubscribedFolders: (NSDictionary *) subscribedFolders
+ toFolderList: (NSMutableArray *) calendarFolders
+{
+ NSEnumerator *keys;
+ NSString *currentKey;
+ NSMutableDictionary *currentCalendar;
+ BOOL firstShouldBeActive;
+ unsigned int count;
+
+ firstShouldBeActive = YES;
+
+ keys = [[subscribedFolders allKeys] objectEnumerator];
+ currentKey = [keys nextObject];
+ count = 1;
+ while (currentKey)
+ {
+ currentCalendar = [NSMutableDictionary new];
+ [currentCalendar autorelease];
+ [currentCalendar
+ setDictionary: [subscribedFolders objectForKey: currentKey]];
+ [currentCalendar setObject: currentKey forKey: @"folder"];
+ [calendarFolders addObject: currentCalendar];
+ if ([[currentCalendar objectForKey: @"active"] boolValue])
+ firstShouldBeActive = NO;
+ count++;
+ currentKey = [keys nextObject];
+ }
+
+ return firstShouldBeActive;
+}
+
+- (NSArray *) calendarFoldersInContext: (WOContext *) context
+{
+ NSMutableDictionary *userCalendar, *calendarDict;
+ NSMutableArray *calendarFolders;
+ SOGoUser *activeUser;
+ BOOL firstActive;
+
+ calendarFolders = [NSMutableArray new];
+ [calendarFolders autorelease];
+
+ activeUser = [context activeUser];
+
+ userCalendar = [NSMutableDictionary new];
+ [userCalendar autorelease];
+ [userCalendar setObject: @"/" forKey: @"folder"];
+ [userCalendar setObject: @"Calendar" forKey: @"displayName"];
+ [calendarFolders addObject: userCalendar];
+
+ calendarDict = [[activeUser userSettings] objectForKey: @"Calendar"];
+ firstActive = [[calendarDict objectForKey: @"activateUserFolder"] boolValue];
+ firstActive = ([self _appendSubscribedFolders:
+ [calendarDict objectForKey: @"SubscribedFolders"]
+ toFolderList: calendarFolders]
+ || firstActive);
+ [userCalendar setObject: [NSNumber numberWithBool: firstActive]
+ forKey: @"active"];
+
+ return calendarFolders;
+}
+
/* folder type */
- (NSString *) folderType
#import "SOGoContactGCSFolder.h"
#define folderListingFields [NSArray arrayWithObjects: @"c_name", @"cn", \
- @"sn", @"givenname", @"l", \
- @"mail", @"telephonenumber", \
+ @"givenname", @"screenname", \
+ @"o", @"mail", @"telephonenumber", \
nil]
@implementation SOGoContactGCSFolder
fields = folderListingFields;
qualifier = [self _qualifierForFilter: filter];
records = [[self ocsFolder] fetchFields: fields
- matchingQualifier: qualifier];
+ matchingQualifier: qualifier];
if (records)
{
ordering
#define folderListingFields [NSArray arrayWithObjects: @"c_name", @"cn", \
@"displayName", \
@"streetAddress", \
+ @"o", \
@"sn", @"givenname", @"l", \
@"mail", @"telephonenumber", \
@"mailNickname", \
"Common" = "Common";
"Contact editor" = "Contact editor";
"Contact viewer" = "Contact viewer";
-"Copy from Anais" = "Copy from Anais";
-"EMail" = "EMail";
+"Email" = "Email";
+"Screen Name" = "Screen Name";
"Extended" = "Extended";
"Fax" = "Fax";
"Firstname" = "Firstname";
"MobilePhone" = "MobilePhone";
"Name" = "Name";
"OfficePhone" = "OfficePhone";
-"Organisation" = "Organisation";
+"Organization" = "Organization";
+"Work Phone" = "Work Phone";
"Phone" = "Phone";
"Phones" = "Phones";
"Postal" = "Postal";
"Common" = "Identité";
"Contact editor" = "Éditer le contact";
"Contact viewer" = "Visualiser le contact";
-"EMail" = "Courriel";
+"Email" = "Adresse électronique";
+"Screen Name" = "Pseudo";
"Extended" = "Informations complémentaires";
"Fax" = "Fax";
"Firstname" = "Prénom";
"Location" = "Lieux";
"MobilePhone" = "Mobile";
"OfficePhone" = "Bureau";
-"Organisation" = "Société";
+"Organization" = "Société";
+"Work Phone" = "Travail";
"Phone" = "Téléphone";
"Postal" = "Professionnelle";
"Save" = "Sauvegarder";
/* load/store content format */
-- (void)_fixupSnapshot {
+- (void) _fixupSnapshot
+{
// TODO: perform sanity checking, eg build CN on demand
NSString *cn, *gn, *sn;
- cn = [snapshot objectForKey:@"cn"];
- gn = [snapshot objectForKey:@"givenName"];
- sn = [snapshot objectForKey:@"sn"];
+ cn = [snapshot objectForKey: @"cn"];
+ gn = [snapshot objectForKey: @"givenName"];
+ sn = [snapshot objectForKey: @"sn"];
if (![sn isNotNull] || [sn length] == 0)
sn = nil;
// TODO: need a better name parser here
NSRange r;
- r = [cn rangeOfString:@" "];
+ r = [cn rangeOfString: @" "];
sn = (r.length > 0)
? [cn substringFromIndex:(r.location + r.length)]
: cn;
}
- [snapshot setObject:sn forKey:@"sn"];
+ [snapshot setObject:sn forKey: @"sn"];
}
if (sn == nil && gn == nil)
cn = @"[noname]";
else if (gn == nil)
cn = sn;
else
- cn = [[gn stringByAppendingString:@" "] stringByAppendingString:sn];
- [snapshot setObject:cn forKey:@"cn"];
+ cn = [[gn stringByAppendingString: @" "] stringByAppendingString:sn];
+ [snapshot setObject:cn forKey: @"cn"];
}
/* helper */
uri = [[[self context] request] uri];
/* first: identify query parameters */
- r = [uri rangeOfString:@"?" options:NSBackwardsSearch];
+ r = [uri rangeOfString: @"?" options:NSBackwardsSearch];
if (r.length > 0)
uri = [uri substringToIndex:r.location];
/* next: append trailing slash */
- if (![uri hasSuffix:@"/"])
- uri = [uri stringByAppendingString:@"/"];
+ if (![uri hasSuffix: @"/"])
+ uri = [uri stringByAppendingString: @"/"];
/* next: append method */
uri = [uri stringByAppendingString:_method];
[self initSnapshot];
else
return [NSException exceptionWithHTTPStatus:404 /* Not Found */
- reason:@"could not open contact"];
+ reason: @"could not open contact"];
return self;
}
- (void) _saveSnapshot
{
CardElement *element;
+ NSArray *units;
[card setNWithFamily: [snapshot objectForKey: @"sn"]
given: [snapshot objectForKey: @"givenName"]
value: [snapshot objectForKey: @"calFBURL"]];
[card setUniqueChild: element];
+ units = [NSArray arrayWithObject: [snapshot objectForKey: @"workService"]];
+ [card setOrg: [snapshot objectForKey: @"workCompany"]
+ units: units];
+
[self _savePhoneValues];
[self _saveEmails];
+ [[self _elementWithTag: @"url" ofType: @"home"]
+ setValue: 0 to: [snapshot objectForKey: @"homeURL"]];
+ [[self _elementWithTag: @"url" ofType: @"work"]
+ setValue: 0 to: [snapshot objectForKey: @"workURL"]];
+
[[card uniqueChildWithTag: @"x-aim"]
- setValue: 0 to: [snapshot objectForKey: @"screenName"]];
+ setValue: 0
+ to: [snapshot objectForKey: @"screenName"]];
}
- (id <WOActionResults>) saveAction
[self redirectToLocation: [self relativePathToUserFolderSubPath: url]];
}
-- (id)newAction {
+- (id) newAction
+{
// TODO: this is almost a DUP of UIxAppointmentEditor
/*
This method creates a unique ID and redirects to the "edit" method on the
if ([objectId length] == 0)
return [NSException exceptionWithHTTPStatus:500 /* Internal Error */
- reason:@"could not create a unique ID"];
+ reason: @"could not create a unique ID"];
- nextMethod = [NSString stringWithFormat:@"../%@/%@",
- objectId, [self editActionName]];
+ nextMethod = [NSString stringWithFormat: @"../%@/%@",
+ objectId, [self editActionName]];
uri = [self _completeURIForMethod:nextMethod];
return [self redirectToLocation:uri];
}
- (NSString *) workUrl
{
- return [self _urlOfType: @"home"];
+ return [self _urlOfType: @"work"];
}
- (BOOL) hasOtherInfos
a SOPE clientObject (which usually is an SOGoAppointmentFolder).
*/
-@class NSString, NSArray, NSDictionary, NSMutableDictionary, NSCalendarDate, SOGoAptFormatter;
+@class NSArray;
+@class NSCalendarDate;
+@class NSDictionary;
+@class NSMutableDictionary;
+@class NSString;
+
+@class SOGoAptFormatter;
@class SOGoAppointmentFolder;
@interface UIxCalView : UIxComponent
{
- NSArray *appointments;
- NSMutableArray *calendarFolders;
+ NSArray *appointments;
NSMutableDictionary *componentsData;
- NSArray *tasks;
- NSArray *allDayApts;
- id appointment;
- NSCalendarDate *currentDay;
+ NSArray *tasks;
+ NSArray *allDayApts;
+ id appointment;
+ NSCalendarDate *currentDay;
SOGoAptFormatter *aptFormatter;
SOGoAptFormatter *aptTooltipFormatter;
SOGoAptFormatter *privateAptFormatter;
} aptFlags;
}
-
/* config */
-- (void)configureFormatters;
+- (void) configureFormatters;
/* accessors */
- (void) setTasks: (NSArray *) _tasks;
- (NSArray *) tasks;
-- (NSArray *)allDayApts;
-- (id)appointment;
-- (BOOL)isMyApt;
-- (BOOL)canAccessApt; /* protection */
+- (NSArray *) allDayApts;
+- (id) appointment;
+- (BOOL) isMyApt;
+- (BOOL) canAccessApt; /* protection */
-- (BOOL)hasDayInfo;
-- (BOOL)hasHoldidayInfo;
-- (BOOL)hasAllDayApts;
+- (BOOL) hasDayInfo;
+- (BOOL) hasHoldidayInfo;
+- (BOOL) hasAllDayApts;
-- (NSDictionary *)aptTypeDict;
-- (NSString *)aptTypeLabel;
-- (NSString *)aptTypeIcon;
-- (SOGoAptFormatter *)aptFormatter;
+- (NSDictionary *) aptTypeDict;
+- (NSString *) aptTypeLabel;
+- (NSString *) aptTypeIcon;
+- (SOGoAptFormatter *) aptFormatter;
-- (NSString *)shortTextForApt;
-- (NSString *)shortTitleForApt;
-- (NSString *)tooltipForApt;
-- (NSString *)appointmentViewURL;
+- (NSString *) shortTextForApt;
+- (NSString *) shortTitleForApt;
+- (NSString *) tooltipForApt;
+- (NSString *) appointmentViewURL;
-- (id)holidayInfo;
+- (id) holidayInfo;
/* related to current day */
-- (void)setCurrentDay:(NSCalendarDate *)_day;
-- (NSCalendarDate *)currentDay;
-- (NSString *)currentDayName; /* localized */
+- (void) setCurrentDay: (NSCalendarDate *) _day;
+- (NSCalendarDate *) currentDay;
+- (NSString *) currentDayName; /* localized */
/* defaults */
-- (BOOL)showFullNames;
-- (BOOL)showAMPMDates;
-- (unsigned)dayStartHour;
-- (unsigned)dayEndHour;
-- (BOOL)shouldDisplayWeekend;
-- (BOOL)shouldDisplayRejectedAppointments;
-
-- (NSCalendarDate *)referenceDateForFormatter;
+- (BOOL) showFullNames;
+- (BOOL) showAMPMDates;
+- (unsigned) dayStartHour;
+- (unsigned) dayEndHour;
+- (BOOL) shouldDisplayWeekend;
+- (BOOL) shouldDisplayRejectedAppointments;
+
+- (NSCalendarDate *) referenceDateForFormatter;
-- (NSCalendarDate *)thisMonth;
-- (NSCalendarDate *)nextMonth;
+- (NSCalendarDate *) thisMonth;
+- (NSCalendarDate *) nextMonth;
/* fetching */
-- (NSCalendarDate *)startDate;
-- (NSCalendarDate *)endDate;
+- (NSCalendarDate *) startDate;
+- (NSCalendarDate *) endDate;
- (NSArray *) fetchCoreAppointmentsInfos;
- (NSArray *) fetchCoreTasksInfos;
/* date selection */
-- (NSDictionary *)todayQueryParameters;
-- (NSDictionary *)currentDayQueryParameters;
-
-/* calendarUIDs */
-
-- (NSString *)formattedCalendarUIDs;
+- (NSDictionary *) todayQueryParameters;
+- (NSDictionary *) currentDayQueryParameters;
/* CSS related */
-- (NSString *)aptStyle;
+- (NSString *) aptStyle;
/* protected methods */
- (NSDictionary *) _dateQueryParametersWithOffset: (int) daysOffset;
= [[SOGoAptFormatter alloc] initWithDisplayTimeZone: tz];
[self configureFormatters];
componentsData = [NSMutableDictionary new];
- calendarFolders = nil;
}
return self;
- (void) dealloc
{
- [calendarFolders release];
[componentsData release];
- [appointments release];
- [allDayApts release];
- [appointment release];
- [currentDay release];
- [aptFormatter release];
- [aptTooltipFormatter release];
- [privateAptFormatter release];
+ [appointments release];
+ [allDayApts release];
+ [appointment release];
+ [currentDay release];
+ [aptFormatter release];
+ [aptTooltipFormatter release];
+ [privateAptFormatter release];
[privateAptTooltipFormatter release];
[super dealloc];
}
return [[self startDate] tomorrow];
}
-#warning We only support ONE calendar per user at this time
-- (BOOL) _appendSubscribedFolders: (NSDictionary *) subscribedFolders
-{
- NSEnumerator *keys;
- NSString *currentKey;
- NSMutableDictionary *currentCalendar;
- BOOL firstShouldBeActive;
- unsigned int count;
-
- firstShouldBeActive = YES;
-
- keys = [[subscribedFolders allKeys] objectEnumerator];
- currentKey = [keys nextObject];
- count = 1;
- while (currentKey)
- {
- currentCalendar = [NSMutableDictionary new];
- [currentCalendar autorelease];
- [currentCalendar
- setDictionary: [subscribedFolders objectForKey: currentKey]];
- [currentCalendar setObject: currentKey forKey: @"folder"];
- [calendarFolders addObject: currentCalendar];
- if ([[currentCalendar objectForKey: @"active"] boolValue])
- firstShouldBeActive = NO;
- count++;
- currentKey = [keys nextObject];
- }
-
- return firstShouldBeActive;
-}
-
-- (void) _setupCalendarFolders
-{
- NSMutableDictionary *userCalendar, *calendarDict;
- SOGoUser *activeUser;
- BOOL firstActive;
-
- calendarFolders = [NSMutableArray new];
- activeUser = [context activeUser];
-
- userCalendar = [NSMutableDictionary new];
- [userCalendar autorelease];
- [userCalendar setObject: @"/" forKey: @"folder"];
- [userCalendar setObject: [self labelForKey: @"Calendar"]
- forKey: @"displayName"];
- [calendarFolders addObject: userCalendar];
-
- calendarDict = [[activeUser userSettings] objectForKey: @"Calendar"];
- firstActive = [[calendarDict objectForKey: @"activateUserFolder"] boolValue];
- firstActive = ([self _appendSubscribedFolders:
- [calendarDict objectForKey: @"SubscribedFolders"]]
- || firstActive);
- [userCalendar setObject: [NSNumber numberWithBool: firstActive]
- forKey: @"active"];
-}
-
- (SOGoAppointmentFolder *) _aptFolder: (NSString *) folder
withClientObject: (SOGoAppointmentFolder *) clientObject
{
return aptFolder;
}
-- (NSArray *) calendarFolders
-{
- if (!calendarFolders)
- [self _setupCalendarFolders];
-
- return calendarFolders;
-}
-
- (NSArray *) _activeCalendarFolders
{
NSMutableArray *activeFolders;
activeFolders = [NSMutableArray new];
[activeFolders autorelease];
- if (!calendarFolders)
- [self _setupCalendarFolders];
-
clientObject = [self clientObject];
- folders = [calendarFolders objectEnumerator];
+ folders = [[clientObject calendarFoldersInContext: context]
+ objectEnumerator];
currentFolderDict = [folders nextObject];
while (currentFolderDict)
{
return [self queryParametersBySettingSelectedDate: currentDay];
}
-/* calendarUIDs */
-
-- (NSString *) formattedCalendarUIDs
-{
- return [[[self clientObject] calendarUIDs]
- componentsJoinedByString: @", "];
-}
-
/* Actions */
- (NSString *) _userFolderURI
@interface UIxCalendarSelector : UIxComponent
{
- NSMutableArray *calendarFolders;
NSMutableDictionary *colors;
NSDictionary *currentCalendarFolder;
}
- (NSArray *) calendarFolders;
+
- (void) setCurrentCalendarFolder: (NSDictionary *) newCurrentCalendarFolder;
- (NSDictionary *) currentCalendarFolder;
#import <SOGo/AgenorUserManager.h>
#import <SOGo/SOGoUser.h>
#import <SOGoUI/UIxComponent.h>
+#import <Appointments/SOGoAppointmentFolder.h>
#import "UIxCalendarSelector.h"
{
if ((self = [super init]))
{
- colors = [NSMutableDictionary new];
- calendarFolders = nil;
+ colors = nil;
currentCalendarFolder = nil;
}
- (void) dealloc
{
- [calendarFolders release];
[currentCalendarFolder release];
[colors release];
[super dealloc];
}
-- (void) setCalendarFolders: (NSArray *) newCalendarFolders
+- (NSArray *) calendarFolders
{
+ NSArray *calendarFolders;
NSEnumerator *newFolders;
NSDictionary *currentFolder;
unsigned int count;
- ASSIGN (calendarFolders, newCalendarFolders);
-
- newFolders = [calendarFolders objectEnumerator];
- currentFolder = [newFolders nextObject];
- count = 0;
- while (currentFolder)
+ calendarFolders
+ = [[self clientObject] calendarFoldersInContext: context];
+ if (!colors)
{
- [colors setObject: colorForNumber (count)
- forKey: [currentFolder objectForKey: @"folder"]];
- count++;
+ colors = [NSMutableDictionary new];
+ count = 0;
+ newFolders = [calendarFolders objectEnumerator];
currentFolder = [newFolders nextObject];
+ while (currentFolder)
+ {
+ [colors setObject: colorForNumber (count)
+ forKey: [currentFolder objectForKey: @"folder"]];
+ count++;
+ currentFolder = [newFolders nextObject];
+ }
}
-}
-- (NSArray *) calendarFolders
-{
return calendarFolders;
}
id item;
NSString *saveURL;
+ NSMutableArray *calendarList;
/* individual values */
NSCalendarDate *cycleUntilDate;
- (void) setIsCycleEndUntil;
- (void) setIsCycleEndNever;
-- (NSString *) componentOwner;
-- (NSArray *) availableCalendars;
-
/* access */
- (BOOL) isMyComponent;
- (BOOL) canEditComponent;
#import <SOGo/AgenorUserManager.h>
#import <SOGo/SOGoUser.h>
#import <SOGoUI/SOGoDateFormatter.h>
+#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
#import <SoObjects/Appointments/SOGoTaskObject.h>
organizer = nil;
attendeesNames = nil;
attendeesEmails = nil;
+ calendarList = nil;
}
return self;
[url release];
[attendeesNames release];
[attendeesEmails release];
+ [calendarList release];
[super dealloc];
}
- (NSString *) itemCategoryText
{
- return [self labelForKey: [NSString stringWithFormat: @"category_%@", item]];
+ return [self labelForKey:
+ [NSString stringWithFormat: @"category_%@", item]];
+}
+
+- (NSArray *) calendarList
+{
+ SOGoAppointmentFolder *folder;
+ NSEnumerator *allCalendars;
+ NSDictionary *currentCalendar;
+
+ if (!calendarList)
+ {
+ calendarList = [NSMutableArray new];
+ folder = [[self clientObject] container];
+ allCalendars
+ = [[folder calendarFoldersInContext: context] objectEnumerator];
+ currentCalendar = [allCalendars nextObject];
+ while (currentCalendar)
+ {
+ if ([[currentCalendar objectForKey: @"active"] boolValue])
+ [calendarList addObject: currentCalendar];
+ currentCalendar = [allCalendars nextObject];
+ }
+ }
+
+ return calendarList;
+}
+
+- (NSString *) itemCalendarText
+{
+ return item;
+}
+
+- (NSString *) calendarsFoldersList
+{
+ NSArray *calendars;
+
+ calendars = [[self calendarList] valueForKey: @"folder"];
+
+ return [calendars componentsJoinedByString: @","];
+}
+
+- (NSString *) componentCalendar
+{
+ return @"/";
}
/* priorities */
/* contact editor compatibility */
-- (NSArray *) availableCalendars
-{
- NSEnumerator *rawContacts;
- NSString *list, *currentId;
- NSMutableArray *calendars;
- SOGoUser *user;
-
- calendars = [NSMutableArray array];
-
- 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: @"-"])
- [calendars addObject: [currentId substringFromIndex: 1]];
- else
- [calendars addObject: currentId];
- currentId = [rawContacts nextObject];
- }
-
- return calendars;
-}
-
-- (NSString *) componentOwner
-{
- return componentOwner;
-}
-
- (NSString *) urlButtonClasses
{
NSString *classes;
><var:if condition="hasHomeInfos"
><div id="homeInfos"
><h4><var:string label:value="Home" /></h4
- ><var:string value="homePobox" escapeHTML="NO"
+ ><var:string value="homeStreetAddress" escapeHTML="NO"
/><var:string value="homeExtendedAddress" escapeHTML="NO"
- /><var:string value="homeStreetAddress" escapeHTML="NO"
+ /><var:string value="homePobox" escapeHTML="NO"
/><var:string value="homeCityAndProv" escapeHTML="NO"
/><var:string value="homePostalCodeAndCountry" escapeHTML="NO"
/><var:string value="homeUrl" escapeHTML="NO"
<!-- localize -->
<td class="tbtv_headercell">
<var:component className="UIxSortableTableHeader"
- label:label="Lastname"
+ label:label="Name"
const:sortKey="cn"
const:href="view"
var:queryDictionary="context.request.formValues"
</td>
<td class="tbtv_headercell">
<var:component className="UIxSortableTableHeader"
- label:label="EMail"
+ label:label="Email"
const:sortKey="mail"
const:href="view"
var:queryDictionary="context.request.formValues"
/>
</td>
<td class="tbtv_headercell">
- <var:string label:value="Phone" />
+ <var:string label:value="Screen Name" />
</td>
<td class="tbtv_headercell">
- <var:string label:value="Location" />
+ <var:string label:value="Organization" />
+ </td>
+ <td class="tbtv_headercell">
+ <var:string label:value="Work Phone" />
</td>
</tr>
onclick="return onContactRowClick(event, this);"
ondblclick="return onContactRowDblClick(event, this);"
oncontextmenu="return onContactContextMenu(event, this);">
- <td onmousedown="return false;"><img rsrc:src="abcard.gif" /><var:string value="displayName" const:escapeHTML="YES" /></td>
- <td onmousedown="return false;"><var:string value="currentContact.mail" /></td>
- <td onmousedown="return false;"><var:string value="currentContact.telephonenumber" /></td>
- <td onmousedown="return false;"><var:string value="currentContact.l" /></td>
+ <td onmousedown="return false;"><img rsrc:src="abcard.gif"
+ /><var:string value="displayName" const:escapeHTML="YES" /></td>
+ <td onmousedown="return false;"><var:string value="currentContact.mail"/></td>
+ <td onmousedown="return false;"><var:string value="currentContact.screenname"/></td>
+ <td onmousedown="return false;"><var:string value="currentContact.o"/></td>
+ <td onmousedown="return false;"><var:string value="currentContact.telephonenumber"/></td>
</tr>
</var:foreach>
</tbody>
function onSearchFormSubmit() {
var searchValue = $("searchValue");
- openContactsFolder(URLForFolderID(currentContactFolder),
+ openContactsFolder(currentContactFolder,
"search=" + searchValue.value);
return false;
return false;
}
-function onChangeCalendar(list) {
- var form = document.forms.editform;
- log ("before: " + form.getAttribute("action"));
- var urlElems = form.getAttribute("action").split("/");
- urlElems[urlElems.length-4]
- = list.childNodesWithTag("option")[list.value].innerHTML;
- form.setAttribute("action", urlElems.join("/"));
- log ("after: " + form.getAttribute("action"));
-}
-
function validateBrowseURL(input) {
var button = $("browseURLBtn");
right: 1em;
padding-bottom: 0em; }
+SELECT#calendarList
+{ width: 7em; }
+
A#changeUrlButton
{ margin-left: 1em; }
right: 1em;
padding-bottom: 0em; }
+SELECT#calendarList
+{ width: 7em; }
+
A#changeUrlButton
{ margin-left: 1em; }