]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@191 d1b88da0-ebda-0310-925b-ed51d...
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 12 Aug 2004 16:28:32 +0000 (16:28 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 12 Aug 2004 16:28:32 +0000 (16:28 +0000)
23 files changed:
SOGo/SoObjects/Appointments/ChangeLog
SOGo/SoObjects/Appointments/SOGoAppointmentFolder.h
SOGo/SoObjects/Appointments/SOGoAppointmentFolder.m
SOGo/SoObjects/Appointments/SOGoGroupAppointmentFolder.m
SOGo/SoObjects/Appointments/Version
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/GNUmakefile
SOGo/UI/Scheduler/NOTES
SOGo/UI/Scheduler/NSCalendarDate+UIx.h [new file with mode: 0644]
SOGo/UI/Scheduler/NSCalendarDate+UIx.m [new file with mode: 0644]
SOGo/UI/Scheduler/UIxAppointmentEditor.m
SOGo/UI/Scheduler/UIxAppointmentView.m
SOGo/UI/Scheduler/UIxCalMonthView.m
SOGo/UI/Scheduler/UIxCalSelectTab.wox
SOGo/UI/Scheduler/UIxCalView.h
SOGo/UI/Scheduler/UIxCalView.m
SOGo/UI/Scheduler/UIxCalWeekChartview.m
SOGo/UI/Scheduler/UIxCalWeekColumnsview.m
SOGo/UI/Scheduler/UIxCalWeekPrintview.m
SOGo/UI/Scheduler/UIxCalWeekView.h
SOGo/UI/Scheduler/UIxCalWeekView.m
SOGo/UI/Scheduler/UIxCalYearOverview.m
SOGo/UI/Scheduler/Version

index 7141aa20c92b181ce65fd28ceec81608604bcfd2..414d8eb424a0df12487b9f6f3442012eda351f35 100644 (file)
@@ -1,3 +1,11 @@
+2004-08-12    <helge@agenor.opengroupware.org>
+
+       * v0.9.4
+
+       * SOGoAppointmentFolder.m: added -baseURLForAptWithUID:inContext: for
+         determining the resource URL of an appointment, used by calendar
+         views to locate the viewer page
+
 2004-08-11  Helge Hess  <helge.hess@skyrix.com>
 
        * SOGoGroupAppointmentFolder: can merge input folders, tracks conflicts
index 0ae8fb6dd13e5d1a884289240f274c0eb5557a96..819a7b7927b568db4d3ebca0615dc474a9a66f2d 100644 (file)
   from:(NSCalendarDate *)_startDate
   to:(NSCalendarDate *)_endDate;
 
+/* URL generation */
+
+- (NSString *)baseURLForAptWithUID:(NSString *)_uid inContext:(id)_ctx;
+
 @end
 
 #endif /* __Appointments_SOGoAppointmentFolder_H__ */
index be8734b4ee20df02fe9334e7b5fde2390c5d1504..3bde4e998ac2c52626a3f308b964a522e7041bf9 100644 (file)
@@ -216,6 +216,20 @@ static NSTimeZone *MET = nil;
   return [self fetchCoreInfosFromFolder:folder from:_startDate to:_endDate];
 }
 
+/* URL generation */
+
+- (NSString *)baseURLForAptWithUID:(NSString *)_uid inContext:(id)_ctx {
+  NSString *url;
+  
+  if ([_uid length] == 0)
+    return nil;
+  
+  url = [self baseURLInContext:_ctx];
+  if (![url hasSuffix:@"/"])
+    url = [url stringByAppendingString:@"/"];
+  return [url stringByAppendingString:_uid];
+}
+
 /* GET */
 
 - (id)GETAction:(WOContext *)_ctx {
index a3eaa57a62ea12cc08f738152813711f4ef1a991..3089b558c65f8e6fc267ad6f805d6929ac79d87c 100644 (file)
               memberFolders:folders];
 }
 
+/* URL generation */
+
+- (NSString *)baseURLForAptWithUID:(NSString *)_uid inContext:(id)_ctx {
+  //NSString *url;
+  
+  if ([_uid length] == 0)
+    return nil;
+  
+#warning TODO: fix URL generation for aggregate
+  [self logWithFormat:@"FIXME: URL generation for viewer"];
+  
+  // need to locate the folder containing the apt, then call it
+  return [super baseURLForAptWithUID:_uid inContext:_ctx];
+}
+
 @end /* SOGoGroupAppointmentFolder */
index 58d50ae77d3f66c8fbad9645666f8f90ab95d8e3..8ca0a8d0fc2c47575a11d9d97d2fb7252c0febd0 100644 (file)
@@ -1,3 +1,3 @@
 # $Id: Version,v 1.9 2004/05/19 14:30:45 helge Exp $
 
-SUBMINOR_VERSION:=3
+SUBMINOR_VERSION:=4
index 54ef707423ed0f39d284b53ef212b949eb20bd77..9c93c4e230d63dbea0dcc6e6184cb5961bde7321 100644 (file)
@@ -1,7 +1,18 @@
 2004-08-12  Helge Hess  <helge.hess@skyrix.com>
 
-       * added (still empty) proposal component (v0.9.21)
+       * v0.9.22
 
+       * UIxAppointmentView.m: properly catch invalid appointment references
+         and return a 404 (because SOGoAppointmentObject's are created even
+         for invalid IDs for performance reasons)
+       
+       * UIxCalView.m: generate appointment URLs using clientObject (the
+         appointment folder)
+       
+       * more cleanups
+       
+       * added (still empty) proposal component (v0.9.21)
+       
        * some code reorganizations, fixed some compile warnings (v0.9.20)
 
 2004-08-11  Marcus Mueller  <znek@mulle-kybernetik.com>
index d5d35baee0d0d0c8a361382ec1653488391476e4..4828361d8b2404c53564c3b42cc34addb12e719c 100644 (file)
@@ -14,6 +14,8 @@ SchedulerUI_OBJC_FILES =              \
        SchedulerUIProduct.m            \
        UIxAppointmentFormatter.m       \
        iCalPerson+UIx.m                \
+       NSCalendarDate+UIx.m            \
+       \
        UIxCalView.m                    \
        UIxCalDayView.m                 \
        UIxCalWeekView.m                \
index 35c83b1bfbb130280d7230803df0bd30e530e900..17658cd638e78664754f70c5c5cef5534578dc8b 100644 (file)
@@ -16,18 +16,19 @@ Class Hierarchy
           UIxCalMonthOverview
         UIxCalWeekView
           UIxCalWeekOverview
+            UIxCalWeekPrintview
+          UIxCalWeekColumnsview
+          UIxCalWeekListview
+          UIxCalWeekChartview
+        UIxCalDayView
+          UIxCalDayOverview
+          UIxCalDayChartview
     UIxAptTableView
   SchedulerUIProduct
 
 TBD:
-  UIxCalDayView
-    UIxCalDayOverview
-    UIxCalDayChart
-    UIxCalDayHChart
-  [UIxCalWeekView]
-    UIxCalWeekColumnView
-    UIxCalWeekChart
-    UIxCalWeekHChart
+  UIxCalDayHChart?
+  UIxCalWeekHChart?
   OGoYearOverview - should use aggressive caching in the long run
 
   - editor page (which comes up in a new window)
diff --git a/SOGo/UI/Scheduler/NSCalendarDate+UIx.h b/SOGo/UI/Scheduler/NSCalendarDate+UIx.h
new file mode 100644 (file)
index 0000000..83e228e
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  Copyright (C) 2004 SKYRIX Software AG
+
+  This file is part of OpenGroupware.org.
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
+
+#ifndef __NSCalendarDate_UIx_H__
+#define __NSCalendarDate_UIx_H__
+
+#import <Foundation/NSCalendarDate.h>
+
+@interface NSCalendarDate(UIx)
+
+- (NSCalendarDate *)dayOfWeeK:(unsigned)_day offsetFromSunday:(unsigned)_off;
+- (NSCalendarDate *)sundayOfWeek;
+
+@end
+
+#endif /* __NSCalendarDate_UIx_H__ */
diff --git a/SOGo/UI/Scheduler/NSCalendarDate+UIx.m b/SOGo/UI/Scheduler/NSCalendarDate+UIx.m
new file mode 100644 (file)
index 0000000..53c4647
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+  Copyright (C) 2004 SKYRIX Software AG
+
+  This file is part of OpenGroupware.org.
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id: UIxAppointmentEditor.m 181 2004-08-11 15:13:25Z helge $
+
+#include "NSCalendarDate+UIx.h"
+#include "common.h"
+
+@implementation NSCalendarDate(UIx)
+
+- (NSCalendarDate *)dayOfWeeK:(unsigned)_day 
+  offsetFromSunday:(unsigned)_offset
+{
+    unsigned dayOfWeek, distance;
+    
+    /* perform "locale" correction */
+    dayOfWeek = (7 + [self dayOfWeek] - _offset) % 7;
+
+    _day = (_day % 7);
+    if(_day == dayOfWeek)
+        return self;
+
+    distance = _day - dayOfWeek;
+    return [self dateByAddingYears:0 months:0 days:distance];
+}
+
+/* this implies that monday is the start of week! */
+
+- (NSCalendarDate *)sundayOfWeek {
+  return [self dayOfWeeK:6 offsetFromSunday:1];
+}
+
+@end /* NSCalendarDate(UIx) */
index c62b88319ceed1802ade2c9699afbe38db23de82..c7954755ed8559ad685857bf128fd0d54b95f38c 100644 (file)
 
 
 - (SOGoAppointment *)appointment {
-  if(self->appointment == nil) {
+  if (self->appointment == nil) {
     self->appointment = [[SOGoAppointment alloc]
                          initWithICalString:[self iCalString]];
   }
 /* helper */
 
 - (NSString *)uriAsFormat {
+  // TODO: replace that with "-uriToCallMethodNamed:" or sth like this
   NSString *uri, *qp;
-  NSRange r;
-
+  NSRange  r;
+  
   uri = [[[self context] request] uri];
 
   /* first: identify query parameters */
 
   /* next: append format token */
   uri = [uri stringByAppendingString:@"%@"];
-  if(qp != nil)
+  if (qp != nil)
     uri = [uri stringByAppendingString:qp];
   return uri;
 }
 
 /* new */
 
-
 - (id)newAction {
   /*
     This method creates a unique ID and redirects to the "edit" method on the
     
     Note: 'clientObject' is the SOGoAppointmentFolder!
   */
-  WORequest *req;
-  WOResponse *r;
   NSString *uri, *uriFormat, *objectId, *nextMethod;
   
   objectId = [NSClassFromString(@"SOGoAppointmentFolder")
   
   nextMethod = [NSString stringWithFormat:@"%@/edit", objectId];
   uriFormat  = [self uriAsFormat];
-  uri = [[NSString alloc] initWithFormat:uriFormat, nextMethod];
-  req = [[self context] request];
-  r = [WOResponse responseWithRequest:req];
-  [r setStatus:302 /* moved */];
-  [r setHeader:uri forKey:@"location"];
-  [uri release]; uri = nil;
-  return r;
+  uri = [NSString stringWithFormat:uriFormat, nextMethod];
+  
+  return [self redirectToLocation:uri];
 }
 
-
 /* save */
 
 /* returned dates are in GMT */
 - (NSCalendarDate *)_dateFromString:(NSString *)_str {
-    NSCalendarDate *date;
-
-    date = [NSCalendarDate dateWithString:_str 
-                           calendarFormat:@"%Y-%m-%d %H:%M %Z"];
-    [date setTimeZone:[self backendTimeZone]];
-    return date;
+  NSCalendarDate *date;
+  
+  date = [NSCalendarDate dateWithString:_str 
+                        calendarFormat:@"%Y-%m-%d %H:%M %Z"];
+  [date setTimeZone:[self backendTimeZone]];
+  return date;
 }
 
 - (id)saveAction {
   NSCalendarDate *sd, *ed;
   NSArray        *ps;
   unsigned       i, count;
-  WOResponse     *r;
   WORequest      *req;
-
+  
   req = [[self context] request];
 
   /* get iCalString from hidden input */
   iCalString = [apt iCalString];
   [apt release]; apt = nil;
     
-#if 0
-  NSLog(@"%s new iCalString:\n%@", __PRETTY_FUNCTION__, iCalString);
-#else
   {
     NSException *ex;
     
     if (ex) return ex;
     // TODO: add some error handling in form! (eg like in Zope)
   }
-#endif
   
   uriFormat = [self uriAsFormat];
   uri = [NSString stringWithFormat:uriFormat, @"view"];
-
-  r = [WOResponse responseWithRequest:req];
-  [r setStatus:302 /* moved */];
-  [r setHeader:uri forKey:@"location"];
-  return r;
+  return [self redirectToLocation:uri];
 }
 
 @end /* UIxAppointmentEditor */
index 241fef8a7253dd85ada30ff65a43eaffcd5d81fc..46d653d750c17db33bf2618dd383a1d6fe265b0e 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "UIxAppointmentView.h"
 #include "common.h"
+#include <NGiCal/NGiCal.h>
 #include <SOGoLogic/SOGoAppointment.h>
 
 @implementation UIxAppointmentView
   
   if (self->appointment)
     return self->appointment;
-    
+  
   iCalString = [[self clientObject] valueForKey:@"iCalString"];
-  if ([iCalString length] == 0) {
-    [self logWithFormat:@"ERROR(%s): missing iCal string!", 
+  if (![iCalString isNotNull] || [iCalString length] == 0) {
+    [self debugWithFormat:@"ERROR(%s): missing iCal string!", 
          __PRETTY_FUNCTION__];
     return nil;
   }
 }
 
 - (NSString *)debugTabLink {
-    return [self completeHrefForMethod:[self ownMethodName]
-                 withParameter:@"debug"
-                 forKey:@"tab"];
+  return [self completeHrefForMethod:[self ownMethodName]
+              withParameter:@"debug"
+              forKey:@"tab"];
 }
 
 - (NSString *)completeHrefForMethod:(NSString *)_method
   withParameter:(NSString *)_param
   forKey:(NSString *)_key
 {
-    NSString *href;
+  NSString *href;
 
-    [self setQueryParameter:_param forKey:_key];
-    href = [self completeHrefForMethod:[self ownMethodName]];
-    [self setQueryParameter:nil forKey:_key];
-    return href;
+  [self setQueryParameter:_param forKey:_key];
+  href = [self completeHrefForMethod:[self ownMethodName]];
+  [self setQueryParameter:nil forKey:_key];
+  return href;
+}
+
+/* action */
+
+- (id)defaultAction {
+  if ([self appointment] == nil) {
+    return [NSException exceptionWithHTTPStatus:404 /* Not Found */
+                       reason:@"could not locate appointment"];
+  }
+  
+  return self;
 }
 
 @end /* UIxAppointmentView */
index 056498625fe96571e9fd99177e2ad77ea120ca33..ef2ea81cfcaea1d0847d56747b8ae9aeb056c26b 100644 (file)
@@ -1,43 +1,13 @@
 // $Id$
 
 #include "UIxCalMonthView.h"
-#include <NGExtensions/NGExtensions.h>
+#include "NSCalendarDate+UIx.h"
 #include "common.h"
 
-
-@interface NSCalendarDate (UIxCalMonthViewExtensions)
-- (NSCalendarDate *)dayOfWeeK:(unsigned)_day
-             offsetFromSunday:(unsigned)_offset;
-- (NSCalendarDate *)sundayOfWeek;
-@end
-
-@implementation NSCalendarDate (UIxCalMonthViewExtensions)
-- (NSCalendarDate *)dayOfWeeK:(unsigned)_day
-                    offsetFromSunday:(unsigned)_offset
-{
-    unsigned dayOfWeek, distance;
-    
-    /* perform "locale" correction */
-    dayOfWeek = (7 + [self dayOfWeek] - _offset) % 7;
-
-    _day = (_day % 7);
-    if(_day == dayOfWeek)
-        return self;
-
-    distance = _day - dayOfWeek;
-    return [self dateByAddingYears:0 months:0 days:distance];
-}
-
-/* this implies that monday is the start of week! */
-- (NSCalendarDate *)sundayOfWeek {
-    return [self dayOfWeeK:6 offsetFromSunday:1];
-}
-@end
-
 @implementation UIxCalMonthView
 
 - (NSCalendarDate *)startOfMonth {
-    return [[[super startDate] firstDayOfMonth] beginOfDay];
+  return [[[super startDate] firstDayOfMonth] beginOfDay];
 }
 
 - (NSCalendarDate *)startDate {
 }
 
 - (NSCalendarDate *)endDate {
-  NSCalendarDate *date = [self startOfMonth];
-  date = [date dateByAddingYears:0
-               months:0
-               days:[date numberOfDaysInMonth]
-               hours:0
-               minutes:0
-               seconds:0];
+  NSCalendarDate *date;
+  
+  date = [self startOfMonth];
+  date = [date dateByAddingYears:0 months:0 days:[date numberOfDaysInMonth]
+               hours:0 minutes:0 seconds:0];
   date = [[date sundayOfWeek] endOfDay];
   return date;
 }
 
 /* URLs */
 
-
 - (NSDictionary *)prevMonthQueryParameters {
-    NSCalendarDate *date;
+  NSCalendarDate *date;
 
-    date = [[self startOfMonth] dateByAddingYears:0
-                                months:-1
-                                days:0
-                                hours:0
-                                minutes:0
-                                seconds:0];
-    return [self queryParametersBySettingSelectedDate:date];
+  date = [[self startOfMonth] dateByAddingYears:0 months:-1 days:0
+                             hours:0 minutes:0 seconds:0];
+  return [self queryParametersBySettingSelectedDate:date];
 }
 
 - (NSDictionary *)nextMonthQueryParameters {
-    NSCalendarDate *date;
+  NSCalendarDate *date;
     
-    date = [[self startOfMonth] dateByAddingYears:0
-                                months:1
-                                days:0
-                                hours:0
-                                minutes:0
-                                seconds:0];
-    return [self queryParametersBySettingSelectedDate:date];
+  date = [[self startOfMonth] dateByAddingYears:0 months:1 days:0
+                             hours:0 minutes:0 seconds:0];
+  return [self queryParametersBySettingSelectedDate:date];
 }
 
 @end /* UIxCalMonthView */
index 98ae502cc0c5f46f7c1f0438986563887f5e9efb..d253e366f9a8b54bc0be805fae45866b8eb771db 100644 (file)
              const:selectedTabStyle="tab_selected"
              const:bodyStyle="tabview_body"
 >
-     <uix:tab const:key="day" var:label="dayLabel" var:href="daytabLink">
+  <uix:tab const:key="day" var:label="dayLabel" var:href="daytabLink">
      <var:component-content />
-     </uix:tab>
-     <uix:tab const:key="week" var:label="weekLabel" var:href="weektabLink">
+  </uix:tab>
+  <uix:tab const:key="week" var:label="weekLabel" var:href="weektabLink">
      <var:component-content />
-     </uix:tab>
-     <uix:tab const:key="month" var:label="monthLabel" var:href="monthtabLink">
+  </uix:tab>
+  <uix:tab const:key="month" var:label="monthLabel" var:href="monthtabLink">
      <var:component-content />
-     </uix:tab>
-     <uix:tab const:key="year" var:label="yearLabel" var:href="yeartabLink">
+  </uix:tab>
+  <uix:tab const:key="year" var:label="yearLabel" var:href="yeartabLink">
      <var:component-content />
-     </uix:tab>
+  </uix:tab>
 </uix:tabview>
index e53a422908cd481eb8c71af60744cd3d6583cca7..d5bbff95e69f976f70f700146c34e90d7a9ae3b8 100644 (file)
@@ -5,13 +5,20 @@
 
 #include <SOGoUI/UIxComponent.h>
 
-@class NSArray, NSCalendarDate;
+/*
+  UIxCalView
+  
+  Superclass for most components which render a set of appointments coming from
+  a SOPE clientObject (which usually is an SOGoAppointmentFolder).
+*/
+
+@class NSString, NSArray, NSDictionary, NSCalendarDate;
 
 @interface UIxCalView : UIxComponent
 {
-  NSArray *appointments;
-  NSArray *allDayApts;
-  id      appointment;
+  NSArray        *appointments;
+  NSArray        *allDayApts;
+  id             appointment;
   NSCalendarDate *currentDay;
 }
 
 - (NSArray *)fetchCoreInfos;
 
 /* date selection */
+
 - (NSDictionary *)todayQueryParameters;
 - (NSDictionary *)currentDayQueryParameters;
 - (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date;
 - (void)setSelectedDateQueryParameter:(NSCalendarDate *)_newDate
-        inDictionary:(NSMutableDictionary *)_qp;
+  inDictionary:(NSMutableDictionary *)_qp;
 
 @end
 
index f153fc3612dee720d1099ba8a0899b2e8ec9d750..3da61309fb135995ed2eeb93eb68a3fe7b5269ca 100644 (file)
 
 /* defaults */
 
-
 - (BOOL)showFullNames {
-    return YES;
+  return YES;
 }
 
 - (BOOL)showAMPMDates {
-    return NO;
+  return NO;
 }
 
 - (unsigned)dayStartHour {
-    return 8;
+  return 8;
 }
 
 - (unsigned)dayEndHour {
-    return 18;
+  return 18;
 }
 
 - (BOOL)shouldDisplayWeekend {
-    return NO;
+  return NO;
 }
 
 
 - (NSString *)appointmentViewURL {
   id pkey;
   
-  if ((pkey = [[self appointment] valueForKey:@"uid"]) == nil)
+  if (![(pkey = [[self appointment] valueForKey:@"uid"]) isNotNull])
     return nil;
   
-  return [NSString stringWithFormat:@"%@/view", pkey];
+  return [[[self clientObject] baseURLForAptWithUID:[pkey stringValue]
+                              inContext:[self context]]
+                              stringByAppendingString:@"/view"];
 }
 
 
 /* resource URLs (TODO?) */
 
 - (NSString *)resourcePath {
+  // TODO: broken
   return @"/sogod.woa/WebServerResources/";
 }
 
 /* Actions */
 
 - (NSString *)_userFolderURI {
-    WOContext *ctx;
-    id obj;
-    NSURL *url;
+  WOContext *ctx;
+  id        obj;
+  NSURL     *url;
 
-    ctx = [self context];
-    obj = [[ctx objectTraversalStack] objectAtIndex:1];
-    url = [NSURL URLWithString:[obj baseURLInContext:ctx]];
-    return [url path];
+  ctx = [self context];
+  obj = [[ctx objectTraversalStack] objectAtIndex:1];
+  url = [NSURL URLWithString:[obj baseURLInContext:ctx]];
+  return [url path];
 }
 
 - (id)redirectForUIDsAction {
-    NSMutableString *uri;
-    NSString *uidsString, *loc, *prevMethod;
-    WOResponse *r;
-    WORequest *req;
-
-    req = [[self context] request];
-
-    uidsString = [req formValueForKey:@"anaisUIDString"];
-    uidsString = [uidsString stringByTrimmingWhiteSpaces];
-    if([uidsString length] == 0) {
-        // TODO: improve user experience ... (eg error panel like Zope)
-        return [NSException exceptionWithHTTPStatus:400 /* bad request */
-                            reason:@"missing uids from request"];
-    }
-    prevMethod = [req formValueForKey:@"previousMethod"];
-    if(prevMethod == nil)
-        prevMethod = @"";
-
-    uri = [[NSMutableString alloc] initWithString:[self _userFolderURI]];
-    [uri appendString:@"/Groups/_custom_"];
-    [uri appendString:uidsString];
-    [uri appendString:@"/Calendar/"];
-    [uri appendString:prevMethod];
-
-    loc = [self completeHrefForMethod:uri]; /* this might return uri! */
-    r = [WOResponse responseWithRequest:req];
-    [r setStatus:302 /* moved */];
-    [r setHeader:loc forKey:@"location"];
-    [uri release];
-    return r;
+  NSMutableString *uri;
+  NSString   *uidsString, *loc, *prevMethod;
+  WORequest  *req;
+
+  req = [[self context] request];
+
+  uidsString = [req formValueForKey:@"anaisUIDString"];
+  uidsString = [uidsString stringByTrimmingWhiteSpaces];
+  if ([uidsString length] == 0) {
+    // TODO: improve user experience ... (eg error panel like Zope)
+    return [NSException exceptionWithHTTPStatus:400 /* bad request */
+                       reason:@"missing uids from request"];
+  }
+  
+  prevMethod = [req formValueForKey:@"previousMethod"];
+  if (prevMethod == nil)
+    prevMethod = @"";
+
+  uri = [[NSMutableString alloc] initWithString:[self _userFolderURI]];
+  [uri appendString:@"/Groups/_custom_"];
+  [uri appendString:uidsString];
+  [uri appendString:@"/Calendar/"];
+  [uri appendString:prevMethod];
+  
+  loc = [self completeHrefForMethod:uri]; /* this might return uri! */
+  
+  return [self redirectToLocation:loc];
 }
 
 @end /* UIxCalView */
index 449c0de1718afcb0475a022b1214ccfcdc710bed..cd63bcab0e9014900ba4ee39c3478f52c74e9d37 100644 (file)
 
 
 #include "UIxCalWeekView.h"
-#include "common.h"
 
 @interface UIxCalWeekChartview : UIxCalWeekView
 {
-
 }
 
 @end
 
+#include "common.h"
 
 @implementation UIxCalWeekChartview
+@end /* UIxCalWeekChartview */
 
-@end
index d9c121be4b3c6b0f4453efc131c4708674b0e58c..975291a91090333e441cc043f05e17dbf0ab7c8d 100644 (file)
 
 
 #include "UIxCalWeekView.h"
-#include "common.h"
 
 @interface UIxCalWeekColumnsview : UIxCalWeekView
 {
-    int dayIndex;
+  int dayIndex;
 }
 
 @end
 
+#include "common.h"
 
 @implementation UIxCalWeekColumnsview
 
 - (NSArray *)appointments {
-    return [self fetchCoreInfos];
+  return [self fetchCoreInfos];
 }
 
 - (void)setDayIndex:(char)_idx {
-    NSCalendarDate *d;
+  NSCalendarDate *d;
     
-    if ((self->dayIndex == _idx) && (self->currentDay != nil))
-        return;
+  if ((self->dayIndex == _idx) && (self->currentDay != nil))
+    return;
     
-    self->dayIndex = _idx;
+  self->dayIndex = _idx;
     
-    if (_idx > 0) {
-        d = [[self startDate]
-               dateByAddingYears:0 months:0 days:_idx
-                           hours:0 minutes:0 seconds:0];
-    }
-    else
-        d = [self startDate];
+  if (_idx > 0) {
+    d = [[self startDate] dateByAddingYears:0 months:0 days:_idx
+                         hours:0 minutes:0 seconds:0];
+  }
+  else
+    d = [self startDate];
     
-    [self setCurrentDay:d];
+  [self setCurrentDay:d];
 }
 
 - (int)dayIndex {
-    return self->dayIndex;
+  return self->dayIndex;
 }
 
 
 /* style sheet */
 
 - (NSString *)titleStyle {
-    if([self->currentDay isToday])
-        return @"weekcolumnsview_title_hilite";
-    return @"weekcolumnsview_title";
+  return [self->currentDay isToday]
+    ? @"weekcolumnsview_title_hilite"
+    : @"weekcolumnsview_title";
 }
-
 - (NSString *)contentStyle {
-    if([self->currentDay isToday])
-        return @"weekcolumnsview_content_hilite";
-    return @"weekcolumnsview_content";
+  return [self->currentDay isToday]
+    ? @"weekcolumnsview_content_hilite"
+    : @"weekcolumnsview_content";
 }
 
-@end
+@end /* UIxCalWeekColumnsview */
index 76ab3d69580e664a2e02dda5566422c9d8019566..ddf9056f50a3123bf05aefd24373d48cf0dadbc5 100644 (file)
 */
 // $Id$
 
-
 #include "UIxCalWeekOverview.h"
 
-
 @interface UIxCalWeekPrintview : UIxCalWeekOverview
 {
 }
index e867846c20b3870ab63d8eef4733f9a3d8454ff3..df8a196d9a257955f0c2901f47bb0e28b9a86347 100644 (file)
@@ -5,6 +5,8 @@
 
 #include "UIxCalView.h"
 
+@class NSDictionary;
+
 @interface UIxCalWeekView : UIxCalView
 {
 }
index 43303b090c4e8a04a4e5d02e563a51c17fa33f9e..92d2bf1e7c7a41bd8417a48d1034a8d80f5e4e5b 100644 (file)
@@ -1,7 +1,6 @@
 // $Id$
 
 #include "UIxCalWeekView.h"
-#include <NGExtensions/NGExtensions.h>
 #include "common.h"
 
 @implementation UIxCalWeekView
 
 - (NSCalendarDate *)endDate {
   return [[[self startDate] dateByAddingYears:0 months:0 days:7
-                                        hours:0 minutes:0 seconds:0]
+                           hours:0 minutes:0 seconds:0]
                             endOfDay];
 }
 
 /* URLs */
 
 - (NSDictionary *)prevWeekQueryParameters {
-    NSCalendarDate *date;
+  NSCalendarDate *date;
 
-    date = [[self startDate] dateByAddingYears:0 months:0 days:-7 
-                             hours:0 minutes:0 seconds:0];
-    return [self queryParametersBySettingSelectedDate:date];
+  date = [[self startDate] dateByAddingYears:0 months:0 days:-7 
+                          hours:0 minutes:0 seconds:0];
+  return [self queryParametersBySettingSelectedDate:date];
 }
 
 - (NSDictionary *)nextWeekQueryParameters {
-    NSCalendarDate *date;
+  NSCalendarDate *date;
     
-    date = [[self startDate] dateByAddingYears:0 months:0 days:7 
-                             hours:0 minutes:0 seconds:0];
-    return [self queryParametersBySettingSelectedDate:date];
+  date = [[self startDate] dateByAddingYears:0 months:0 days:7 
+                          hours:0 minutes:0 seconds:0];
+  return [self queryParametersBySettingSelectedDate:date];
 }
 
 @end /* UIxCalWeekView */
index 16a8e71d85a97dfd6abce1943fb241aadb34a51a..207a151e7cbc6936bce9aad0e18c99c94288d594 100644 (file)
 */
 // $Id$
 
-
 #include <SOGoUI/UIxComponent.h>
-#include <Foundation/Foundation.h>
-#include <NGExtensions/NGExtensions.h>
-
 
 @interface UIxCalYearOverview : UIxComponent
 {
-    NSArray *row;
-    NSCalendarDate *month;
+  NSArray        *row;
+  NSCalendarDate *month;
 }
 
 - (NSCalendarDate *)startDate;
+
 - (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date;
+
 - (void)setSelectedDateQueryParameter:(NSCalendarDate *)_newDate
-                         inDictionary:(NSMutableDictionary *)_qp;
+  inDictionary:(NSMutableDictionary *)_qp;
 
 @end
 
+#include "common.h"
 
 @implementation UIxCalYearOverview
 
-/* init & dealloc */
-
 - (void)dealloc {
     [self->row release];
     [self->month release];
     [super dealloc];
 }
 
-
 /* accessors */
 
 - (void)setRow:(NSArray *)_row {
-    ASSIGN(self->row, _row);
+  ASSIGN(self->row, _row);
 }
-
 - (NSArray *)row {
-    return self->row;
+  return self->row;
 }
 
 - (void)setMonth:(NSCalendarDate *)_date {
-    ASSIGN(self->month, _date);
+  ASSIGN(self->month, _date);
 }
-
 - (NSCalendarDate *)month {
-    return self->month;
+  return self->month;
 }
 
 - (int)year {
-    return [[self selectedDate] yearOfCommonEra];
+  return [[self selectedDate] yearOfCommonEra];
 }
 
 - (NSArray *)arrayOfDateArrays {
-    NSCalendarDate *startDate;
-    NSMutableArray *result, *tmp;
-    unsigned rowIdx, columnIdx;
-    int monthOffset = 0;
-
-    startDate = [self startDate];
-    result = [[NSMutableArray alloc] initWithCapacity:3];
-    for(rowIdx = 0; rowIdx < 3; rowIdx++) {
-        tmp = [[NSMutableArray alloc] initWithCapacity:4];
-        for(columnIdx = 0; columnIdx < 4; columnIdx++) {
-            NSCalendarDate *date;
-            
-            date = [startDate dateByAddingYears:0
-                                         months:monthOffset
-                                           days:0];
-            [tmp addObject:date];
-            monthOffset++;
-        }
-        [result addObject:tmp];
-        [tmp release];
+  NSCalendarDate *startDate;
+  NSMutableArray *result, *tmp;
+  unsigned       rowIdx, columnIdx;
+  int            monthOffset = 0;
+  
+  startDate = [self startDate];
+  result    = [NSMutableArray arrayWithCapacity:3];
+  
+  for (rowIdx = 0; rowIdx < 3; rowIdx++) {
+    tmp = [[NSMutableArray alloc] initWithCapacity:4];
+    
+    for (columnIdx = 0; columnIdx < 4; columnIdx++) {
+      NSCalendarDate *date;
+      
+      date = [startDate dateByAddingYears:0 months:monthOffset days:0];
+      [tmp addObject:date];
+      monthOffset++;
     }
-    return [result autorelease];
+    [result addObject:tmp];
+    [tmp release];
+  }
+  return result;
 }
 
 
 /* date ranges */
 
 - (NSCalendarDate *)startDate {
-    return [[[NSCalendarDate alloc] initWithYear:[self year] month:1 day:1
-                                    hour:0 minute:0 second:0
-                                    timeZone:[self viewTimeZone]] autorelease];
+  return [[[NSCalendarDate alloc] initWithYear:[self year] month:1 day:1
+                                  hour:0 minute:0 second:0
+                                  timeZone:[self viewTimeZone]] autorelease];
 }
-
 - (NSCalendarDate *)endDate {
-    return nil;
+  return nil;
 }
 
-
 /* URLs */
 
 - (NSDictionary *)todayQueryParameters {
-    NSCalendarDate *date;
+  NSCalendarDate *date;
     
-    date = [NSCalendarDate date]; /* today */
-    return [self queryParametersBySettingSelectedDate:date];
+  date = [NSCalendarDate date]; /* today */
+  return [self queryParametersBySettingSelectedDate:date];
 }
 
-- (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date {
-    NSMutableDictionary *qp;
+- (NSDictionary *)queryParametersBySettingSelectedDate:(NSCalendarDate *)_date{
+  NSMutableDictionary *qp;
     
-    qp = [[self queryParameters] mutableCopy];
-    [self setSelectedDateQueryParameter:_date inDictionary:qp];
-    return [qp autorelease];
+  qp = [[self queryParameters] mutableCopy];
+  [self setSelectedDateQueryParameter:_date inDictionary:qp];
+  return [qp autorelease];
 }
 
 - (void)setSelectedDateQueryParameter:(NSCalendarDate *)_newDate
-                         inDictionary:(NSMutableDictionary *)_qp;
+  inDictionary:(NSMutableDictionary *)_qp;
 {
-    if(_newDate != nil)
-        [_qp setObject:[self dateStringForDate:_newDate] forKey:@"day"];
-    else
-        [_qp removeObjectForKey:@"day"];
+  if (_newDate != nil)
+    [_qp setObject:[self dateStringForDate:_newDate] forKey:@"day"];
+  else
+    [_qp removeObjectForKey:@"day"];
 }
 
 - (NSDictionary *)prevYearQueryParameters {
-    NSCalendarDate *date;
+  NSCalendarDate *date;
     
-    date = [[self startDate] dateByAddingYears:-1
-                                        months:0
-                                          days:0
-                                         hours:0
-                                       minutes:0
-                                       seconds:0];
-    return [self queryParametersBySettingSelectedDate:date];
+  date = [[self startDate] dateByAddingYears:-1 months:0 days:0
+                          hours:0 minutes:0 seconds:0];
+  return [self queryParametersBySettingSelectedDate:date];
 }
 
 - (NSDictionary *)nextYearQueryParameters {
-    NSCalendarDate *date;
-    
-    date = [[self startDate] dateByAddingYears:1
-                                        months:0
-                                          days:0
-                                         hours:0
-                                       minutes:0
-                                       seconds:0];
-    return [self queryParametersBySettingSelectedDate:date];
+  NSCalendarDate *date;
+   
+  date = [[self startDate] dateByAddingYears:1 months:0 days:0
+                          hours:0 minutes:0 seconds:0];
+  return [self queryParametersBySettingSelectedDate:date];
 }
 
-@end
+@end /* UIxCalYearOverview */
index 49f242e531df55a4ec8619c8424bdc414d69e19a..78237daff645932d2dc39c82a83a2f6fffffed9c 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=21
+SUBMINOR_VERSION:=22