From 91f4814b93ea675f4224a2e9e8c0f23d9ea888eb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 5 Mar 2007 22:32:47 +0000 Subject: [PATCH] Monotone-Parent: 873696f0482e8408c8fda6ce2156c1afc61c2e60 Monotone-Revision: 3328f2ce69441267c3e26760ff9d47e40742ed94 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-03-05T22:32:47 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++ OGoContentStore/OCSiCalFieldExtractor.m | 46 ++++++++++++------- OGoContentStore/appointment.ocs | 2 +- OGoContentStore/sql/appointment-create.psql | 2 +- .../sql/generate-folderinfo-sql-for-users.sh | 4 +- 5 files changed, 42 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index f96850412..236cd0ff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-03-05 Wolfgang Sourdeau + + * OGoContentStore/OCSiCalFieldExtractor.m ([OCSiCalFieldExtractor + -extractQuickFieldsFromTodo:_task]): the field "ispublic" was + renamed to "classification" and can any integer as value. + ([OCSiCalFieldExtractor -extractQuickFieldsFromEvent:_event]): + idem. + 2007-02-26 Wolfgang Sourdeau * UI/MailPartViewers/UIxMailPartHTMLViewer.m diff --git a/OGoContentStore/OCSiCalFieldExtractor.m b/OGoContentStore/OCSiCalFieldExtractor.m index 09cbe20ef..2a57e340b 100644 --- a/OGoContentStore/OCSiCalFieldExtractor.m +++ b/OGoContentStore/OCSiCalFieldExtractor.m @@ -71,7 +71,7 @@ static NSNumber *distantFutureNumber = nil; id organizer; id participants, partmails; NSMutableString *partstates; - unsigned i, count; + unsigned i, count, accessClassOrder; if (_event == nil) return nil; @@ -117,9 +117,9 @@ static NSNumber *distantFutureNumber = nil; if ([location isNotNull]) [row setObject: location forKey:@"location"]; if ([sequence isNotNull]) [row setObject: sequence forKey:@"sequence"]; - if ([startDate isNotNull]) + if ([startDate isNotNull]) [row setObject: [self numberForDate: startDate] forKey:@"startdate"]; - if ([endDate isNotNull]) + if ([endDate isNotNull]) [row setObject: [self numberForDate: endDate] forKey:@"enddate"]; if ([_event isRecurrent]) { NSCalendarDate *date; @@ -153,12 +153,19 @@ static NSNumber *distantFutureNumber = nil; [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"]; - } + if ([accessClass isNotNull]) + { + if ([accessClass isEqualToString: @"PRIVATE"]) + accessClassOrder = 1; + else if ([accessClass isEqualToString: @"CONFIDENTIAL"]) + accessClassOrder = 2; + else + accessClassOrder = 0; + } + else + accessClassOrder = 0; + [row setObject: [NSNumber numberWithUnsignedInt: accessClassOrder] + forKey: @"classification"]; organizer = [_event organizer]; if (organizer) { @@ -197,7 +204,7 @@ static NSNumber *distantFutureNumber = nil; id organizer, date; id participants, partmails; NSMutableString *partstates; - unsigned i, count, code; + unsigned i, count, code, accessClassOrder; if (_task == nil) return nil; @@ -271,12 +278,19 @@ static NSNumber *distantFutureNumber = nil; [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"]; - } + if ([accessClass isNotNull]) + { + if ([accessClass isEqualToString: @"PRIVATE"]) + accessClassOrder = 1; + else if ([accessClass isEqualToString: @"CONFIDENTIAL"]) + accessClassOrder = 2; + else + accessClassOrder = 0; + } + else + accessClassOrder = 0; + [row setObject: [NSNumber numberWithUnsignedInt: accessClassOrder] + forKey: @"classification"]; organizer = [_task organizer]; if (organizer) { diff --git a/OGoContentStore/appointment.ocs b/OGoContentStore/appointment.ocs index 8e014e4a7..966680e4f 100644 --- a/OGoContentStore/appointment.ocs +++ b/OGoContentStore/appointment.ocs @@ -55,7 +55,7 @@ allowsNull = YES; }, { - columnName = ispublic; + columnName = classification; sqlType = "INT"; allowsNull = NO; }, diff --git a/OGoContentStore/sql/appointment-create.psql b/OGoContentStore/sql/appointment-create.psql index 94c370c61..8ec451606 100644 --- a/OGoContentStore/sql/appointment-create.psql +++ b/OGoContentStore/sql/appointment-create.psql @@ -11,7 +11,7 @@ CREATE TABLE %s_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, + classification INT NOT NULL, status INT NOT NULL, isopaque INT NOT NULL, location VARCHAR(256) NULL, diff --git a/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh b/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh index 2cff4355b..e8ba9c594 100755 --- a/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh +++ b/OGoContentStore/sql/generate-folderinfo-sql-for-users.sh @@ -5,7 +5,7 @@ DB_USER="sogo" DB_PASS="sogo" -DB_HOST="127.0.0.1" +DB_HOST="192.168.0.4" DB_PORT="5432" DB_NAME="sogo" TIMEZONE="Canada/Eastern" @@ -82,7 +82,7 @@ CREATE TABLE SOGo_${USER_TABLE}_privcal_quick ( participants VARCHAR(100000) NULL, -- the CNs of the participants isallday INT NULL, iscycle INT NULL, -- client needs to fetch to resolve - ispublic INT NOT NULL, + classification INT NOT NULL, status INT NOT NULL, priority INT NOT NULL, -- for marking high prio apts isopaque INT NULL,