Monotone-Parent: 38a512204cb4c49fbc144379e8587aaea3394a3a

Monotone-Revision: 62820f08c88e6bd9bf5b0d9c61b83fb3d1a337e8

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-08-25T19:13:18
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-08-25 19:13:18 +00:00
parent 0b492ef0ad
commit acdce07ee0
7 changed files with 36 additions and 25 deletions
+16 -5
View File
@@ -227,13 +227,25 @@
NSString *objectId, *method, *uri;
id <WOActionResults> result;
SOGoAppointmentFolder *co;
SoSecurityManager *sm;
co = [self clientObject];
objectId = [co globallyUniqueObjectId];
if ([objectId length])
{
method = [NSString stringWithFormat:@"%@/%@.ics/editAsAppointment",
[co soURL], objectId];
sm = [SoSecurityManager sharedSecurityManager];
if (![sm validatePermission: SoPerm_AddDocumentsImagesAndFiles
onObject: co
inContext: context])
{
method = [NSString stringWithFormat:@"%@/%@.ics/editAsAppointment",
[co soURL], objectId];
}
else
{
method = [NSString stringWithFormat: @"%@/Calendar/personal/%@.vcf/editAsAppointment",
[self userFolderPath], objectId];
}
uri = [self completeHrefForMethod: method];
result = [self redirectToLocation: uri];
}
@@ -246,8 +258,7 @@
- (id <WOActionResults>) saveAction
{
SOGoAppointmentFolder *thisFolder, *newFolder;
SOGoAppointmentFolders *parentFolder;
SOGoAppointmentFolder *thisFolder;
SOGoAppointmentObject *co;
SoSecurityManager *sm;
NSException *ex;
@@ -268,7 +279,7 @@
if (![sm validatePermission: SoPerm_AddDocumentsImagesAndFiles
onObject: componentCalendar
inContext: context])
ex = [co moveToFolder: componentCalendar];
ex = [co moveToFolder: componentCalendar]; // TODO: handle exception
}
}
+1 -6
View File
@@ -87,26 +87,23 @@ _intValueFromHex (NSString *hexString)
- (NSArray *) calendars
{
NSArray *folders, *roles;
NSArray *folders;
SOGoAppointmentFolders *co;
SOGoAppointmentFolder *folder;
NSMutableDictionary *calendar;
unsigned int count, max;
NSString *folderName, *fDisplayName;
NSNumber *isActive;
SOGoUser *user;
if (!calendars)
{
co = [self clientObject];
user = [[self context] activeUser];
folders = [co subFolders];
max = [folders count];
calendars = [[NSMutableArray alloc] initWithCapacity: max];
for (count = 0; count < max; count++)
{
folder = [folders objectAtIndex: count];
roles = [user rolesForObject: folder inContext: [self context]];
calendar = [NSMutableDictionary dictionary];
folderName = [folder nameInContainer];
fDisplayName = [folder displayName];
@@ -121,8 +118,6 @@ _intValueFromHex (NSString *hexString)
[calendar setObject: isActive forKey: @"active"];
[calendar setObject: [folder ownerInContext: context]
forKey: @"owner"];
[calendar setObject: [roles componentsJoinedByString: @","]
forKey: @"roles"];
[calendars addObject: calendar];
}
}
+14 -2
View File
@@ -299,13 +299,25 @@
NSString *objectId, *method, *uri;
id <WOActionResults> result;
SOGoAppointmentFolder *co;
SoSecurityManager *sm;
co = [self clientObject];
objectId = [co globallyUniqueObjectId];
if ([objectId length] > 0)
{
method = [NSString stringWithFormat:@"%@/%@.ics/editAsTask",
[co soURL], objectId];
sm = [SoSecurityManager sharedSecurityManager];
if (![sm validatePermission: SoPerm_AddDocumentsImagesAndFiles
onObject: co
inContext: context])
{
method = [NSString stringWithFormat:@"%@/%@.ics/editAsTask",
[co soURL], objectId];
}
else
{
method = [NSString stringWithFormat: @"%@/Calendar/personal/%@.vcf/editAsTask",
[self userFolderPath], objectId];
}
uri = [self completeHrefForMethod: method];
result = [self redirectToLocation: uri];
}
+2 -2
View File
@@ -149,12 +149,12 @@
actionName = "saveUserRights";
};
newevent = {
protectedBy = "Add Documents, Images, and Files";
protectedBy = "<public>";
pageName = "UIxAppointmentEditor";
actionName = "new";
};
newtask = {
protectedBy = "Add Documents, Images, and Files";
protectedBy = "<public>";
pageName = "UIxTaskEditor";
actionName = "new";
};