Remove newAction from UIx{Appointment,Task}Editor

We now rely on [UIxFolderActions newguidAction]
pull/91/head
Francis Lachapelle 2015-01-22 06:50:31 -05:00
parent a5a2028da7
commit c29719f49d
4 changed files with 14 additions and 75 deletions

View File

@ -1,6 +1,6 @@
/* UIxFolderActions.m - this file is part of SOGo
*
* Copyright (C) 2007-2014 Inverse inc.
* Copyright (C) 2007-2015 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -42,8 +42,12 @@
#import <SOGo/SOGoPermissions.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserSettings.h>
#import <Contacts/SOGoContactGCSFolder.h>
#import <Contacts/SOGoContactSourceFolder.h>
#import <Appointments/SOGoAppointmentFolder.h>
#import "WODirectAction+SOGo.h"
#import "UIxFolderActions.h"
@ -240,6 +244,15 @@
{
folderId = @"personal";
}
// Append meaningful extension to objects of calendars and addressbooks
if ([co isKindOfClass: [SOGoContactGCSFolder class]])
{
objectId = [NSString stringWithFormat: @"%@.vcf", objectId];
}
else if ([co isKindOfClass: [SOGoAppointmentFolder class]])
{
objectId = [NSString stringWithFormat: @"%@.ics", objectId];
}
data = [NSDictionary dictionaryWithObjectsAndKeys: objectId, @"id", folderId, @"pid", nil];
response = [self responseWithStatus: 200
andString: [data jsonRepresentation]];

View File

@ -331,36 +331,6 @@
return self;
}
- (id <WOActionResults>) newAction
{
NSString *objectId, *method, *uri;
id <WOActionResults> result;
SOGoAppointmentFolder *co;
SoSecurityManager *sm;
co = [self clientObject];
objectId = [co globallyUniqueObjectId];
if ([objectId length])
{
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/%@.ics/editAsAppointment",
[self userFolderPath], objectId];
uri = [self completeHrefForMethod: method];
result = [self redirectToLocation: uri];
}
else
result = [NSException exceptionWithHTTPStatus: 500 /* Internal Error */
reason: @"could not create a unique ID"];
return result;
}
- (void) _adjustRecurrentRules
{
iCalRecurrenceRule *rule;

View File

@ -356,40 +356,6 @@
return self;
}
- (id <WOActionResults>) newAction
{
NSString *objectId, *method, *uri;
id <WOActionResults> result;
SOGoAppointmentFolder *co;
SoSecurityManager *sm;
co = [self clientObject];
objectId = [co globallyUniqueObjectId];
if ([objectId length] > 0)
{
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];
}
else
result = [NSException exceptionWithHTTPStatus: 500 /* Internal Error */
reason: @"could not create a unique ID"];
return result;
}
#warning this method could be replaced with a method common with UIxAppointmentEditor...
- (id <WOActionResults>) saveAction
{

View File

@ -174,16 +174,6 @@
pageName = "UIxCalUserRightsEditor";
actionName = "saveUserRights";
};
newevent = {
protectedBy = "<public>";
pageName = "UIxAppointmentEditor";
actionName = "new";
};
newtask = {
protectedBy = "<public>";
pageName = "UIxTaskEditor";
actionName = "new";
};
};
};