From c29719f49ddc8a9286c48b795f45296e7b91ad37 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 22 Jan 2015 06:50:31 -0500 Subject: [PATCH] Remove newAction from UIx{Appointment,Task}Editor We now rely on [UIxFolderActions newguidAction] --- UI/Common/UIxFolderActions.m | 15 ++++++++++++- UI/Scheduler/UIxAppointmentEditor.m | 30 ------------------------- UI/Scheduler/UIxTaskEditor.m | 34 ----------------------------- UI/Scheduler/product.plist | 10 --------- 4 files changed, 14 insertions(+), 75 deletions(-) diff --git a/UI/Common/UIxFolderActions.m b/UI/Common/UIxFolderActions.m index 779fa82ac..b048962a6 100644 --- a/UI/Common/UIxFolderActions.m +++ b/UI/Common/UIxFolderActions.m @@ -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 #import #import + +#import #import +#import + #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]]; diff --git a/UI/Scheduler/UIxAppointmentEditor.m b/UI/Scheduler/UIxAppointmentEditor.m index 653226628..c5ec08cf2 100644 --- a/UI/Scheduler/UIxAppointmentEditor.m +++ b/UI/Scheduler/UIxAppointmentEditor.m @@ -331,36 +331,6 @@ return self; } -- (id ) newAction -{ - NSString *objectId, *method, *uri; - id 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; diff --git a/UI/Scheduler/UIxTaskEditor.m b/UI/Scheduler/UIxTaskEditor.m index c6cc7a18a..8538ebab8 100644 --- a/UI/Scheduler/UIxTaskEditor.m +++ b/UI/Scheduler/UIxTaskEditor.m @@ -356,40 +356,6 @@ return self; } -- (id ) newAction -{ - NSString *objectId, *method, *uri; - id 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 ) saveAction { diff --git a/UI/Scheduler/product.plist b/UI/Scheduler/product.plist index da074912e..1ab6737b5 100644 --- a/UI/Scheduler/product.plist +++ b/UI/Scheduler/product.plist @@ -174,16 +174,6 @@ pageName = "UIxCalUserRightsEditor"; actionName = "saveUserRights"; }; - newevent = { - protectedBy = ""; - pageName = "UIxAppointmentEditor"; - actionName = "new"; - }; - newtask = { - protectedBy = ""; - pageName = "UIxTaskEditor"; - actionName = "new"; - }; }; };