diff --git a/ChangeLog b/ChangeLog index 447e83566..9b349c427 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2010-01-20 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAppointmentInboxFolder.m + (-davCalendarFreeBusySet): only advertise the collections owner by + the inbox's owner. + (-davScheduleDefaultCalendarURL): new caldav accessor. + + * SoObjects/Appointments/SOGoAppointmentFolders.m + (-toManyRelationShipKeys): unconditionnally display the inbox + collection. + (-lookupName:inContext:acquire:): accepts "inbox" even when the + active user is not the owner. + + * SoObjects/Appointments/SOGoAppointmentFolder.m + (-davResourceType): unconditionnally advertise "personal" as + schedule-outbox. + * UI/WebServerResources/scriptaculous.js: modified to use ResourcesURL as base loading URL. diff --git a/SOPE/sope-patchset-r1664.diff b/SOPE/sope-patchset-r1664.diff index 7794ee950..ffc1329c0 100644 --- a/SOPE/sope-patchset-r1664.diff +++ b/SOPE/sope-patchset-r1664.diff @@ -6613,15 +6613,16 @@ Index: sope-appserver/NGObjWeb/DAVPropMap.plist =================================================================== --- sope-appserver/NGObjWeb/DAVPropMap.plist (revision 1664) +++ sope-appserver/NGObjWeb/DAVPropMap.plist (working copy) -@@ -157,6 +157,7 @@ +@@ -157,6 +157,8 @@ "{urn:ietf:params:xml:ns:caldav}supported-calendar-data" = davSupportedCalendarDataTypes; "{urn:ietf:params:xml:ns:caldav}calendar-description" = davDescription; + "{urn:ietf:params:xml:ns:caldav}calendar-timezone" = davCalendarTimeZone; ++ "{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL" = davScheduleDefaultCalendarURL; /* CardDAV */ "{urn:ietf:params:xml:ns:carddav}addressbook-home-set" = davAddressbookHomeSet; -@@ -168,6 +169,8 @@ +@@ -168,6 +170,8 @@ "{http://calendarserver.org/ns/}dropbox-home-URL" = davDropboxHomeURL; "{http://calendarserver.org/ns/}notifications-URL" = davNotificationsURL; "{http://calendarserver.org/ns/}getctag" = davCollectionTag; @@ -7338,6 +7339,15 @@ Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m hasConnectionHeader = YES; } +@@ -789,7 +798,7 @@ + NSLog(@" END: %@", fieldName); + #endif + } +- ++ + #if HEAVY_DEBUG + NSLog(@" HEADER:\n%@", header); + NSLog(@" OUT: %@", out); Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m =================================================================== --- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpAdaptor.m (revision 1664) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 87b8c64f0..0fd78abe6 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -2308,7 +2308,6 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir { NSMutableArray *colType; NSArray *gdRT, *gdVEventCol, *gdVTodoCol; - NSString *login; WORequest *request; colType = [NSMutableArray arrayWithCapacity: 10]; @@ -2329,16 +2328,8 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir XMLNS_GROUPDAV, nil]; [colType addObject: gdVTodoCol]; if ([nameInContainer isEqualToString: @"personal"]) - { - login = [[context activeUser] login]; - if ([login isEqualToString: [self ownerInContext: self]]) - { - // [colType addObject: [NSArray arrayWithObjects: @"schedule-inbox", - // XMLNS_CALDAV, nil]]; - [colType addObject: [NSArray arrayWithObjects: @"schedule-outbox", - XMLNS_CALDAV, nil]]; - } - } + [colType addObject: [NSArray arrayWithObjects: @"schedule-outbox", + XMLNS_CALDAV, nil]]; } return colType; diff --git a/SoObjects/Appointments/SOGoAppointmentFolders.m b/SoObjects/Appointments/SOGoAppointmentFolders.m index 6559de065..e67bd2a20 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolders.m +++ b/SoObjects/Appointments/SOGoAppointmentFolders.m @@ -88,9 +88,9 @@ currentUser = [context activeUser]; login = [currentUser login]; keys = [NSMutableArray array]; + [keys addObject: @"inbox"]; if ([owner isEqualToString: login]) { - [keys addObject: @"inbox"]; sortedSubFolders = [[self subFolders] objectEnumerator]; while ((currentFolder = [sortedSubFolders nextObject])) { @@ -120,17 +120,10 @@ acquire: (BOOL) acquire { id obj; - NSString *login; if ([name isEqualToString: @"inbox"]) - { - login = [[context activeUser] login]; - if ([owner isEqualToString: login]) - obj = [SOGoAppointmentInboxFolder objectWithName: name - inContainer: self]; - else - obj = nil; - } + obj = [SOGoAppointmentInboxFolder objectWithName: name + inContainer: self]; else obj = [super lookupName: name inContext: lookupContext acquire: NO]; diff --git a/SoObjects/Appointments/SOGoAppointmentInboxFolder.m b/SoObjects/Appointments/SOGoAppointmentInboxFolder.m index 01931a07f..2904fe779 100644 --- a/SoObjects/Appointments/SOGoAppointmentInboxFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentInboxFolder.m @@ -27,6 +27,7 @@ #import #import +#import #import #import @@ -43,17 +44,9 @@ - (NSArray *) davResourceType { - NSMutableArray *colType; - NSString *login; - - colType = [NSMutableArray arrayWithCapacity: 10]; - [colType addObject: @"collection"]; - login = [[context activeUser] login]; - if ([login isEqualToString: [self ownerInContext: self]]) - [colType addObject: [NSArray arrayWithObjects: @"schedule-inbox", - XMLNS_CALDAV, nil]]; - - return colType; + return [NSArray arrayWithObjects: @"collection", + [NSArray arrayWithObjects: @"schedule-inbox", XMLNS_CALDAV, nil], + nil]; } - (SOGoWebDAVValue *) davCalendarFreeBusySet @@ -66,9 +59,10 @@ response = [NSMutableArray array]; subFolders = [[container subFolders] objectEnumerator]; while ((currentFolder = [subFolders nextObject])) - [response - addObject: davElementWithContent (@"href", XMLNS_WEBDAV, - [currentFolder davURLAsString])]; + if ([owner isEqualToString: [currentFolder ownerInContext: context]]) + [response + addObject: davElementWithContent (@"href", XMLNS_WEBDAV, + [currentFolder davURLAsString])]; responseValue = [davElementWithContent (@"calendar-free-busy-set", XMLNS_CALDAV, response) asWebDAVValue]; @@ -81,4 +75,37 @@ return nil; } +- (NSArray *) davScheduleDefaultCalendarURL +{ + NSArray *response; + NSString *personalURL; + + personalURL = [NSString stringWithFormat: @"%@personal/", + [container davURLAsString]]; + response = [NSArray arrayWithObjects: @"href", XMLNS_WEBDAV, @"D", + personalURL, nil]; + + return response; +} + +- (NSArray *) aclsForUser: (NSString *) userID +{ + NSString *login; + NSArray *acls; + + acls = nil; + + login = [[context activeUser] login]; + if (![login isEqualToString: owner]) + { + if ([container hasProxyCalendarsWithWriteAccess: YES + forUserWithLogin: login] + || [container hasProxyCalendarsWithWriteAccess: NO + forUserWithLogin: login]) + acls = [NSArray arrayWithObject: SOGoRole_AuthorizedSubscriber]; + } + + return acls; +} + @end diff --git a/SoObjects/Appointments/SOGoUserFolder+Appointments.m b/SoObjects/Appointments/SOGoUserFolder+Appointments.m index 0c58b8c63..040d462bc 100644 --- a/SoObjects/Appointments/SOGoUserFolder+Appointments.m +++ b/SoObjects/Appointments/SOGoUserFolder+Appointments.m @@ -68,7 +68,7 @@ emails = [[ownerUser allEmails] objectEnumerator]; while ((currentEmail = [emails nextObject])) { - tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D", + tag = [NSArray arrayWithObjects: @"href", XMLNS_WEBDAV, @"D", [NSString stringWithFormat: @"mailto:%@", currentEmail], nil]; [addresses addObject: tag]; @@ -94,7 +94,7 @@ SOGoAppointmentFolders *parent; parent = [self privateCalendars: @"Calendar" inContext: context]; - tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D", + tag = [NSArray arrayWithObjects: @"href", XMLNS_WEBDAV, @"D", [parent davURLAsString], nil]; return [NSArray arrayWithObject: tag]; @@ -104,24 +104,14 @@ { SOGoAppointmentFolders *parent; NSArray *tag, *response; - NSString *parentURL, *login; + NSString *parentURL; - login = [[context activeUser] login]; - if ([login isEqualToString: owner]) - { - parent = [self privateCalendars: @"Calendar" inContext: context]; - parentURL = [parent davURLAsString]; - - if ([parentURL hasSuffix: @"/"]) - parentURL = [parentURL substringToIndex: [parentURL length]-1]; - - tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D", - [NSString stringWithFormat: @"%@/%@/", parentURL, name], - nil]; - response = [NSArray arrayWithObject: tag]; - } - else - response = nil; + parent = [self privateCalendars: @"Calendar" inContext: context]; + parentURL = [parent davURLAsString]; + tag = [NSArray arrayWithObjects: @"href", XMLNS_WEBDAV, @"D", + [NSString stringWithFormat: @"%@%@/", parentURL, name], + nil]; + response = [NSArray arrayWithObject: tag]; return response; } @@ -193,7 +183,7 @@ for (count = 0; count < max; count++) { proxiedUser = [proxiedUsers objectAtIndex: count]; - tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D", + tag = [NSArray arrayWithObjects: @"href", XMLNS_WEBDAV, @"D", [NSString stringWithFormat: @"/%@/dav/%@/%@/", appName, proxiedUser, groupId], nil]; @@ -233,7 +223,7 @@ for (count = 0; count < max; count++) { proxiedUser = [proxiedUsers objectAtIndex: count]; - tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D", + tag = [NSArray arrayWithObjects: @"href", XMLNS_WEBDAV, @"D", [NSString stringWithFormat: @"/%@/dav/%@/", appName, proxiedUser], nil]; diff --git a/SoObjects/Appointments/product.plist b/SoObjects/Appointments/product.plist index af11c1799..d67007c45 100644 --- a/SoObjects/Appointments/product.plist +++ b/SoObjects/Appointments/product.plist @@ -51,10 +51,10 @@ }; SOGoAppointmentInboxFolder = { superclass = "SOGoAppointmentFolder"; + defaultRoles = { + "Access Contents Information" = ( "Owner", "AuthorizedSubscriber" ); + }; }; -// SOGoGroupAppointmentFolder = { -// superclass = "SOGoAppointmentFolder"; -// }; SOGoCalendarComponent = { superclass = "SOGoContentObject"; defaultRoles = {