]> err.no Git - scalable-opengroupware.org/blobdiff - SoObjects/Appointments/SOGoFreeBusyObject.m
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1217 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / SoObjects / Appointments / SOGoFreeBusyObject.m
index b892914c345a3a05e9e4bf156229dc03d9f984c3..ef40274dcc4d888d49d86ba37ba8d7b59455d05b 100644 (file)
   02111-1307, USA.
 */
 
+#import <Foundation/NSCalendarDate.h>
+#import <Foundation/NSDictionary.h>
+#import <Foundation/NSEnumerator.h>
+#import <Foundation/NSValue.h>
+
+#import <NGObjWeb/WOContext+SoObjects.h>
+#import <NGObjWeb/WOResponse.h>
+#import <NGExtensions/NSCalendarDate+misc.h>
 #import <NGCards/iCalCalendar.h>
 #import <NGCards/iCalFreeBusy.h>
 #import <NGCards/iCalPerson.h>
 
-#import "common.h"
-
 #import <SOGo/LDAPUserManager.h>
+#import <SOGo/SOGoUser.h>
 #import <SOGo/SOGoPermissions.h>
 
+#import "SOGoAppointmentFolder.h"
+
 #import "SOGoFreeBusyObject.h"
 
 @interface SOGoFreeBusyObject (PrivateAPI)
 - (NSArray *) fetchFreeBusyInfosFrom: (NSCalendarDate *) _startDate
                                   to: (NSCalendarDate *) _endDate
 {
-  id calFolder;
+  SOGoAppointmentFolder *calFolder;
 //   SoSecurityManager *sm;
   NSArray *infos;
 
-  calFolder = [container lookupName: @"Calendar" inContext: nil acquire: NO];
+  calFolder = [[container lookupName: @"Calendar" inContext: nil acquire: NO]
+               lookupName: @"personal" inContext: nil acquire: NO];
 //   sm = [SoSecurityManager sharedSecurityManager];
 //   if (![sm validatePermission: SOGoPerm_FreeBusyLookup
 //            onObject: calFolder
 //            inContext: context])
-    infos = [calFolder fetchFreeBusyInfosFrom: _startDate
-                       to: _endDate];
+  infos = [calFolder fetchFreeBusyInfosFrom: _startDate
+                    to: _endDate];
 //   else
 //     {
 //       infos = [NSArray new];
   info = [events nextObject];
   while (info)
     {
-      if ([[info objectForKey: @"isopaque"] boolValue])
+      if ([[info objectForKey: @"c_isopaque"] boolValue])
         {
-          type = [self _fbTypeForEventStatus: [info objectForKey: @"status"]];
+          type = [self _fbTypeForEventStatus: [info objectForKey: @"c_status"]];
           [freebusy addFreeBusyFrom: [info objectForKey: @"startDate"]
                     to: [info objectForKey: @"endDate"]
                     type: type];