diff --git a/ChangeLog b/ChangeLog index dee38e597..33e62e961 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2010-06-29 Francis Lachapelle + + * UI/WebServerResources/UIxCalendarProperties.js + (onLoadCalendarProperties): we now make use of tabs in the + properties window. + + * UI/Scheduler/UIxCalendarProperties.m (-isPublicAccessEnabled): + new method, copied from Common/UIxAclEditor.m. + (-_basePublicCalDAVURL): new method that return the public base + URL of the calendar. + (-publicCalDavURL, -publicWebDavICSURL, -publicWebDavXMLURL): new + methods to return the various public URLs associated to the calendar. + + * SoObjects/SOGo/SOGoGCSFolder.m (-publicDavURL): new method to + return the public DAV URL of the folder. + 2010-06-28 Francis Lachapelle * UI/Contacts/UIxContactEditor.m (-initSnapshot, -_saveSnapshot): diff --git a/SoObjects/SOGo/SOGoGCSFolder.h b/SoObjects/SOGo/SOGoGCSFolder.h index ea3185d22..eca340d24 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.h +++ b/SoObjects/SOGo/SOGoGCSFolder.h @@ -113,6 +113,7 @@ - (void) sendFolderAdvisoryTemplate: (NSString *) template; /* DAV */ +- (NSURL *) publicDavURL; - (NSURL *) realDavURL; - (NSDictionary *) davSQLFieldsTable; diff --git a/SoObjects/SOGo/SOGoGCSFolder.m b/SoObjects/SOGo/SOGoGCSFolder.m index 3c9022339..12f512f77 100644 --- a/SoObjects/SOGo/SOGoGCSFolder.m +++ b/SoObjects/SOGo/SOGoGCSFolder.m @@ -1,7 +1,7 @@ /* SOGoGCSFolder.m - this file is part of SOGo * * Copyright (C) 2004-2005 SKYRIX Software AG - * Copyright (C) 2006-2009 Inverse inc. + * Copyright (C) 2006-2010 Inverse inc. * * Author: Wolfgang Sourdeau * @@ -419,6 +419,21 @@ static NSArray *childRecordFields = nil; return error; } +- (NSURL *) publicDavURL +{ + NSMutableArray *newPath; + NSURL *davURL; + + davURL = [self realDavURL]; + newPath = [NSMutableArray arrayWithArray: [[davURL path] componentsSeparatedByString: @"/"]]; + [newPath insertObject: @"public" atIndex: 3]; + davURL = [[NSURL alloc] initWithScheme: [davURL scheme] + host: [davURL host] + path: [newPath componentsJoinedByString: @"/"]]; + + return davURL; +} + - (NSURL *) realDavURL { NSURL *realDavURL, *currentDavURL; diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 8082eacb2..9c30b9b8e 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -530,7 +530,8 @@ vtodo_class2 = "(Confidential task)"; "Show tasks" = "Show tasks"; "Links to this Calendar" = "Links to this Calendar"; -"CalDAV url" = "CalDAV url"; +"Authenticated User Access" = "Authenticated User Access"; +"CalDAV URL" = "CalDAV URL"; "WebDAV ICS URL" = "WebDAV ICS URL"; "WebDAV XML URL" = "WebDAV XML URL"; diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings index f9d26dc8c..e375e10e1 100644 --- a/UI/Scheduler/French.lproj/Localizable.strings +++ b/UI/Scheduler/French.lproj/Localizable.strings @@ -530,7 +530,8 @@ vtodo_class2 = "(Tâche confidentielle)"; "Show tasks" = "Afficher les tâches"; "Links to this Calendar" = "Liens vers cet agenda"; -"CalDAV url" = "Accès en CalDAV"; +"Authenticated User Access" = "Accès aux utilisateurs authentifiés"; +"CalDAV URL" = "Accès en CalDAV"; "WebDAV ICS URL" = "Représentation ICS en WebDAV"; "WebDAV XML URL" = "Représentation XML en WebDAV"; diff --git a/UI/Scheduler/UIxCalendarProperties.h b/UI/Scheduler/UIxCalendarProperties.h index 75781c0d4..ebe5a974f 100644 --- a/UI/Scheduler/UIxCalendarProperties.h +++ b/UI/Scheduler/UIxCalendarProperties.h @@ -29,7 +29,7 @@ @interface UIxCalendarProperties : UIxComponent { SOGoAppointmentFolder *calendar; - NSString *baseCalDAVURL; + NSString *baseCalDAVURL, *basePublicCalDAVURL; BOOL reloadTasks; } diff --git a/UI/Scheduler/UIxCalendarProperties.m b/UI/Scheduler/UIxCalendarProperties.m index 9633f9f4e..3e6784d25 100644 --- a/UI/Scheduler/UIxCalendarProperties.m +++ b/UI/Scheduler/UIxCalendarProperties.m @@ -1,6 +1,6 @@ /* UIxCalendarProperties.m - this file is part of SOGo * - * Copyright (C) 2008-2009 Inverse inc. + * Copyright (C) 2008-2010 Inverse inc. * * Author: Wolfgang Sourdeau * @@ -28,6 +28,7 @@ #import #import +#import #import #import @@ -41,6 +42,7 @@ { calendar = [self clientObject]; baseCalDAVURL = nil; + basePublicCalDAVURL = nil; reloadTasks = NO; } @@ -50,6 +52,7 @@ - (void) dealloc { [baseCalDAVURL release]; + [basePublicCalDAVURL release]; [super dealloc]; } @@ -186,6 +189,13 @@ return ([userLogin isEqualToString: [calendar ownerInContext: context]]); } +- (BOOL) isPublicAccessEnabled +{ + // NOTE: This method is the same found in Common/UIxAclEditor.m + return [[SOGoSystemDefaults sharedSystemDefaults] + enablePublicAccess]; +} + - (BOOL) isWebCalendar { return ([calendar isKindOfClass: [SOGoWebAppointmentFolder class]]); @@ -253,6 +263,23 @@ return baseCalDAVURL; } +- (NSString *) _basePublicCalDAVURL +{ + NSString *davURL; + + if (!basePublicCalDAVURL) + { + davURL = [[calendar publicDavURL] absoluteString]; + if ([davURL hasSuffix: @"/"]) + basePublicCalDAVURL = [davURL substringToIndex: [davURL length] - 1]; + else + basePublicCalDAVURL = davURL; + [basePublicCalDAVURL retain]; + } + + return basePublicCalDAVURL; +} + - (NSString *) calDavURL { return [NSString stringWithFormat: @"%@/", [self _baseCalDAVURL]]; @@ -268,4 +295,19 @@ return [NSString stringWithFormat: @"%@.xml", [self _baseCalDAVURL]]; } +- (NSString *) publicCalDavURL +{ + return [NSString stringWithFormat: @"%@/", [self _basePublicCalDAVURL]]; +} + +- (NSString *) publicWebDavICSURL +{ + return [NSString stringWithFormat: @"%@.ics", [self _basePublicCalDAVURL]]; +} + +- (NSString *) publicWebDavXMLURL +{ + return [NSString stringWithFormat: @"%@.xml", [self _basePublicCalDAVURL]]; +} + @end diff --git a/UI/Templates/SchedulerUI/UIxCalendarProperties.wox b/UI/Templates/SchedulerUI/UIxCalendarProperties.wox index 6a96c1317..2e4646fb8 100644 --- a/UI/Templates/SchedulerUI/UIxCalendarProperties.wox +++ b/UI/Templates/SchedulerUI/UIxCalendarProperties.wox @@ -13,7 +13,17 @@
-
+
+
    +
  • +
  • +
  • +
  • +
+
+
+ +
-
-
- +
+
+
+ +
+
+ + +
+