See ChangeLog.

Monotone-Parent: 66db9463cbafa20e7fce07829dca8d5d59f33165
Monotone-Revision: aa47b57f3bbc833ffcc7199f21b79f0453a1cd87

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2010-06-29T20:21:48
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2010-06-29 20:21:48 +00:00
parent f291320413
commit 0ff309bb15
11 changed files with 133 additions and 31 deletions
+43 -1
View File
@@ -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 <wsourdeau@inverse.ca>
*
@@ -28,6 +28,7 @@
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserSettings.h>
#import <SOGo/SOGoSystemDefaults.h>
#import <Appointments/SOGoAppointmentFolder.h>
#import <Appointments/SOGoWebAppointmentFolder.h>
@@ -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