From da9c83387cb5659c239d1b76540f168a9a4ca418 Mon Sep 17 00:00:00 2001 From: helge Date: Sun, 15 Aug 2004 20:33:38 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/trunk@237 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/UI/Scheduler/ChangeLog | 6 +++++ SOGo/UI/Scheduler/UIxAppointmentEditor.m | 9 +++---- SOGo/UI/Scheduler/UIxAppointmentEditor.wox | 4 +-- SOGo/UI/Scheduler/UIxAppointmentView.m | 30 ++++++++++++++++++++++ SOGo/UI/Scheduler/Version | 2 +- SOGo/UI/Scheduler/product.plist | 5 ++++ 6 files changed, 48 insertions(+), 8 deletions(-) diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index c26bcb01..cf042357 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,5 +1,11 @@ 2004-08-15 Helge Hess + * v0.9.48 + + * UIxAppointmentEditor.m: minor cleanups + + * UIxAppointmentView.m: added -delete action + * UIxAppointmentEditor.m: more decoupling from iCal. Added some error handling UI code (errorText), date selector is broken (v0.9.47) diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index 9d04485a..24f89d73 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -409,9 +409,8 @@ - (id)saveAction { SOGoAppointment *apt; - NSString *uri; - NSException *ex; - NSString *content; + NSException *ex; + NSString *content; if (![self isWriteableClientObject]) { /* return 400 == Bad Request */ @@ -435,14 +434,14 @@ return self; } +#warning TODO: implement proper "multi-saves" ex = [[self clientObject] saveContentString:content]; if (ex != nil) { [self setErrorText:[ex reason]]; return self; } - uri = [self _completeURIForMethod:@".."]; - return [self redirectToLocation:uri]; + return [self redirectToLocation:[self _completeURIForMethod:@".."]]; } @end /* UIxAppointmentEditor */ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox index a0a9b405..7167b1e0 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox @@ -26,9 +26,9 @@ - +
- +

diff --git a/SOGo/UI/Scheduler/UIxAppointmentView.m b/SOGo/UI/Scheduler/UIxAppointmentView.m index e04dd866..dc3819a2 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentView.m +++ b/SOGo/UI/Scheduler/UIxAppointmentView.m @@ -3,6 +3,7 @@ #include "UIxAppointmentView.h" #include #include +#include #include #include "common.h" @@ -130,4 +131,33 @@ return self; } +- (BOOL)isDeletableClientObject { + return [[self clientObject] respondsToSelector:@selector(delete)]; +} + +- (id)deleteAction { + NSException *ex; + + if ([self appointment] == nil) { + return [NSException exceptionWithHTTPStatus:404 /* Not Found */ + reason:@"could not locate appointment"]; + } + + if (![self isDeletableClientObject]) { + /* return 400 == Bad Request */ + return [NSException exceptionWithHTTPStatus:400 + reason:@"method cannot be invoked on " + @"the specified object"]; + } + + if ((ex = [[self clientObject] delete]) != nil) { + // TODO: improve error handling + [self debugWithFormat:@"failed to delete: %@", ex]; + return ex; + } + +#warning TODO: fix redirect + return [[[self clientObject] container] baseURLInContext:[self context]]; +} + @end /* UIxAppointmentView */ diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 8846f04e..65f75406 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,6 +1,6 @@ # $Id$ -SUBMINOR_VERSION:=47 +SUBMINOR_VERSION:=48 # v0.9.41 requires libNGObjWeb v4.2.431 # v0.9.31 requires libWEExtensions v4.2.52 diff --git a/SOGo/UI/Scheduler/product.plist b/SOGo/UI/Scheduler/product.plist index aeff30c5..58d326c2 100644 --- a/SOGo/UI/Scheduler/product.plist +++ b/SOGo/UI/Scheduler/product.plist @@ -98,6 +98,11 @@ protectedBy = "View"; pageName = "UIxAppointmentView"; }; + delete = { + protectedBy = "View"; + pageName = "UIxAppointmentView"; + actionName = "delete"; + }; edit = { protectedBy = "View"; pageName = "UIxAppointmentEditor"; -- 2.39.5