From: znek Date: Thu, 9 Dec 2004 18:26:13 +0000 (+0000) Subject: extensions to appointment.ocs X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=602e340c1eb0d9e56e1c4880a186ea75303cfe2d;p=scalable-opengroupware.org extensions to appointment.ocs git-svn-id: http://svn.opengroupware.org/SOGo/trunk@467 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/OGoContentStore/ChangeLog b/OGoContentStore/ChangeLog index 0d53641f..25d37c9a 100644 --- a/OGoContentStore/ChangeLog +++ b/OGoContentStore/ChangeLog @@ -1,3 +1,14 @@ +2004-12-09 Marcus Mueller + + * v0.9.14 + + * appointment.ocs: added "ispublic", "isopaque", "status" and + "orgmail". + + * OCSiCalFieldExtractor.m: updated to extract new fields (see above) + + * sql: updated generate-folderinfo-sql-for-users.sh + 2004-10-19 Helge Hess * OCSFolder.m: added new method -fetchContentsOfAllFiles method which diff --git a/OGoContentStore/OCSiCalFieldExtractor.m b/OGoContentStore/OCSiCalFieldExtractor.m index 8225353c..81f76f17 100644 --- a/OGoContentStore/OCSiCalFieldExtractor.m +++ b/OGoContentStore/OCSiCalFieldExtractor.m @@ -66,22 +66,25 @@ static OCSiCalFieldExtractor *extractor = nil; - (NSMutableDictionary *)extractQuickFieldsFromEvent:(iCalEvent *)_event { NSMutableDictionary *row; NSCalendarDate *startDate, *endDate; - NSString *uid, *title, *location; + NSString *uid, *title, *location, *status, *accessClass; NSNumber *sequence; - id participants, partmails; + id organizer; + id participants, partmails; if (_event == nil) return nil; /* extract values */ - startDate = [_event startDate]; - endDate = [_event endDate]; - uid = [_event uid]; - title = [_event summary]; - location = [_event location]; - sequence = [_event sequence]; - + startDate = [_event startDate]; + endDate = [_event endDate]; + uid = [_event uid]; + title = [_event summary]; + location = [_event location]; + sequence = [_event sequence]; + accessClass = [[_event accessClass] uppercaseString]; + status = [[_event status] uppercaseString]; + participants = [_event attendees]; partmails = [participants valueForKey:@"email"]; partmails = [partmails componentsJoinedByString:@", "]; @@ -112,7 +115,39 @@ static OCSiCalFieldExtractor *extractor = nil; [row setObject:participants forKey:@"participants"]; if ([partmails length] > 0) [row setObject:partmails forKey:@"partmails"]; - + + if ([status isNotNull]) { + int code = 1; + + if ([status isEqualToString:@"TENTATIVE"]) + code = 0; + else if ([status isEqualToString:@"CANCELLED"]) + code = 2; + [row setObject:[NSNumber numberWithInt:code] forKey:@"status"]; + } + else { + /* confirmed by default */ + [row setObject:[NSNumber numberWithInt:1] forKey:@"status"]; + } + + if([accessClass isNotNull] && ![accessClass isEqualToString:@"PUBLIC"]) { + [row setObject:[NSNumber numberWithBool:NO] forKey:@"ispublic"]; + } + else { + [row setObject:[NSNumber numberWithBool:YES] forKey:@"ispublic"]; + } + + // TODO: fix transparency when it's supported in iCalEvent + [row setObject:[NSNumber numberWithBool:NO] forKey:@"isopaque"]; + + organizer = [_event organizer]; + if (organizer) { + NSString *email; + + email = [organizer valueForKey:@"email"]; + if (email) + [row setObject:email forKey:@"orgmail"]; + } return row; } diff --git a/OGoContentStore/Version b/OGoContentStore/Version index 2194d3be..d6061d93 100644 --- a/OGoContentStore/Version +++ b/OGoContentStore/Version @@ -2,7 +2,7 @@ MAJOR_VERSION=0 MINOR_VERSION=9 -SUBMINOR_VERSION:=13 +SUBMINOR_VERSION:=14 # v0.9.11 requires libFoundation v1.0.63 # v0.9.11 requires libNGExtensions v4.3.125 diff --git a/OGoContentStore/appointment.ocs b/OGoContentStore/appointment.ocs index 3ad0386f..6435f954 100644 --- a/OGoContentStore/appointment.ocs +++ b/OGoContentStore/appointment.ocs @@ -39,11 +39,31 @@ sqlType = "INT"; allowsNull = YES; }, + { + columnName = ispublic; + sqlType = "INT"; + allowsNull = NO; + }, + { + columnName = isopaque; + sqlType = "INT"; + allowsNull = YES; + }, + { + columnName = status; + sqlType = "INT"; + allowsNull = NO; + }, { columnName = location; sqlType = "VARCHAR(256)"; allowsNull = YES; }, + { + columnName = orgmail; + sqlType = "VARCHAR(256)"; + allowsNull = YES; + }, { columnName = partmails; sqlType = "VARCHAR(100000)"; diff --git a/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh b/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh index f2033e79..6eac182c 100755 --- a/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh +++ b/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh @@ -76,7 +76,11 @@ CREATE TABLE SOGo_${USER_TABLE}_privcal_quick ( participants VARCHAR(100000) NOT NULL, -- the CNs of the participants isallday INT NULL, iscycle INT NULL, -- client needs to fetch to resolve + ispublic INT NOT NULL, + istentative INT NULL, + isopaque INT NULL, location VARCHAR(256) NULL, + orgmail VARCHAR(256) NULL, partmails VARCHAR(100000) NOT NULL, -- the emails of the participants sequence INT NULL -- the iCal sequence );