2 Copyright (C) 2005 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #import <NGObjWeb/SoObject.h>
23 #import <NGObjWeb/WOContext.h>
24 #import <NGObjWeb/WOResponse.h>
25 #import <NGObjWeb/WODirectAction.h>
26 #import <NGExtensions/NSNull+misc.h>
27 #import <NGExtensions/NSString+misc.h>
29 @interface UIxMailPartICalAction : WODirectAction
32 @implementation UIxMailPartICalAction
34 - (id)redirectToViewerWithError:(NSString *)_error {
39 mail = [[self clientObject] valueForKey:@"mailObject"];
40 [self logWithFormat:@"MAIL: %@", mail];
42 viewURL = [mail baseURLInContext:[self context]];
43 [self logWithFormat:@" url: %@", viewURL];
45 viewURL = [viewURL stringByAppendingString:
46 [viewURL hasSuffix:@"/"] ? @"view" : @"/view"];
48 if ([_error isNotNull] && [_error length] > 0) {
49 viewURL = [viewURL stringByAppendingString:@"?error="];
50 viewURL = [viewURL stringByAppendingString:
51 [_error stringByEscapingURL]];
54 r = [[self context] response];
55 [r setStatus:302 /* moved */];
56 [r setHeader:viewURL forKey:@"location"];
60 - (id)changePartStatusAction:(NSString *)_newStatus {
61 [self logWithFormat:@"TODO: should %@: %@", _newStatus, [self clientObject]];
62 return [self redirectToViewerWithError:
63 [_newStatus stringByAppendingString:@" not implemented!"]];
66 - (id)markAcceptedAction {
67 return [self changePartStatusAction:@"ACCEPTED"];
69 - (id)markDeclinedAction {
70 return [self changePartStatusAction:@"DECLINED"];
72 - (id)markTentativeAction {
73 return [self changePartStatusAction:@"TENTATIVE"];
76 @end /* UIxMailPartICalAction */