]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@237 d1b88da0-ebda-0310-925b-ed51d...
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 15 Aug 2004 20:33:38 +0000 (20:33 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 15 Aug 2004 20:33:38 +0000 (20:33 +0000)
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/UIxAppointmentEditor.m
SOGo/UI/Scheduler/UIxAppointmentEditor.wox
SOGo/UI/Scheduler/UIxAppointmentView.m
SOGo/UI/Scheduler/Version
SOGo/UI/Scheduler/product.plist

index c26bcb015523ca82bfc4a0cbbc7d4f08d3137065..cf042357a4fe4a0476cfd200a2ef0503103cd052 100644 (file)
@@ -1,5 +1,11 @@
 2004-08-15  Helge Hess  <helge.hess@skyrix.com>
 
+       * 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)
 
index 9d04485a99382835cb65045db2c5b39b0d19eb38..24f89d739bd74160c3df02af7831e57b9120d0a1 100644 (file)
 
 - (id)saveAction {
   SOGoAppointment *apt;
-  NSString        *uri;
-  NSException *ex;
-  NSString    *content;
+  NSException     *ex;
+  NSString        *content;
   
   if (![self isWriteableClientObject]) {
     /* return 400 == Bad Request */
     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 */
index a0a9b40588d31a543aadf93c720b23ee2f660294..7167b1e02be8ee60a39945e29e9a39539b1643b3 100644 (file)
@@ -26,9 +26,9 @@
       <tr>
         <td>
           <var:if condition="hasErrorText">
-           <span style="background-color: #AA0000;">
+           <div style="background-color: #AA0000;">
              <var:string value="errorText" />
-            </span>
+            </div>
             <hr />
           </var:if>
 
index e04dd8668e387cceb59b7a92163fd9edc8d73dca..dc3819a28736d3609aa394c0eda0d081843ccba6 100644 (file)
@@ -3,6 +3,7 @@
 #include "UIxAppointmentView.h"
 #include <NGiCal/NGiCal.h>
 #include <SOGoLogic/SOGoAppointment.h>
+#include <Appointments/SOGoAppointmentObject.h>
 #include <SOGoUI/SOGoDateFormatter.h>
 #include "common.h"
 
   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 */
index 8846f04e9f9654efedc839dd9279e12e7629f5f2..65f7540635184ff9996ccf6032e2fb64585c52d9 100644 (file)
@@ -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
index aeff30c5a3b872f5dd20e24ab0d4c01e5c7430d2..58d326c2505f97859a0301c03a6cf520098973b1 100644 (file)
           protectedBy = "View";
           pageName    = "UIxAppointmentView"; 
         };
+        delete = { 
+          protectedBy = "View";
+          pageName    = "UIxAppointmentView"; 
+          actionName  = "delete";
+        };
         edit = { 
           protectedBy = "View";
           pageName    = "UIxAppointmentEditor";