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 #include <NGObjWeb/WODirectAction.h>
24 @interface UIxMailPartICalAction : WODirectAction
29 @implementation UIxMailPartICalAction
31 - (id)redirectToViewerWithError:(NSString *)_error {
36 mail = [[self clientObject] valueForKey:@"mailObject"];
37 [self logWithFormat:@"MAIL: %@", mail];
39 viewURL = [mail baseURLInContext:[self context]];
40 [self logWithFormat:@" url: %@", viewURL];
42 viewURL = [viewURL stringByAppendingString:
43 [viewURL hasSuffix:@"/"] ? @"view" : @"/view"];
45 if ([_error isNotNull] && [_error length] > 0) {
46 viewURL = [viewURL stringByAppendingString:@"?error="];
47 viewURL = [viewURL stringByAppendingString:
48 [_error stringByEscapingURL]];
51 r = [[self context] response];
52 [r setStatus:302 /* moved */];
53 [r setHeader:viewURL forKey:@"location"];
57 - (id)changePartStatusAction:(NSString *)_newStatus {
58 [self logWithFormat:@"TODO: should %@: %@", _newStatus, [self clientObject]];
59 return [self redirectToViewerWithError:
60 [_newStatus stringByAppendingString:@" not implemented!"]];
63 - (id)markAcceptedAction {
64 return [self changePartStatusAction:@"ACCEPTED"];
66 - (id)markDeclinedAction {
67 return [self changePartStatusAction:@"DECLINED"];
69 - (id)markTentativeAction {
70 return [self changePartStatusAction:@"TENTATIVE"];
73 @end /* UIxMailPartICalAction */