mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-13 15:57:12 +00:00
UI/Scheduler/Toolbars/SOGoAppointmentFolders.toolbar
Monotone-Parent: c4c95e670daa9c22e838239469a51f3d23b84ab0 Monotone-Revision: 92e93f3527a76deed69fa61275517490d57f9a4f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-09-14T22:01:02 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
beac7e7aea
commit
e2340b4c9f
67 files changed
+1130
-992
No files matched your search
@@ -25,6 +25,7 @@
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSNull.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
@@ -38,6 +39,7 @@
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSObject+Utilities.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolders.h>
|
||||
|
||||
#import <UI/Common/WODirectAction+SOGo.h>
|
||||
|
||||
@@ -214,36 +216,6 @@
|
||||
return aptFolder;
|
||||
}
|
||||
|
||||
- (NSArray *) _activeCalendarFolders
|
||||
{
|
||||
NSMutableArray *activeFolders;
|
||||
NSEnumerator *folders;
|
||||
NSDictionary *currentFolderDict;
|
||||
SOGoAppointmentFolder *currentFolder, *clientObject;
|
||||
|
||||
activeFolders = [NSMutableArray new];
|
||||
[activeFolders autorelease];
|
||||
|
||||
clientObject = [self clientObject];
|
||||
|
||||
folders = [[clientObject calendarFolders] objectEnumerator];
|
||||
currentFolderDict = [folders nextObject];
|
||||
while (currentFolderDict)
|
||||
{
|
||||
if ([[currentFolderDict objectForKey: @"active"] boolValue])
|
||||
{
|
||||
currentFolder
|
||||
= [self _aptFolder: [currentFolderDict objectForKey: @"folder"]
|
||||
withClientObject: clientObject];
|
||||
[activeFolders addObject: currentFolder];
|
||||
}
|
||||
|
||||
currentFolderDict = [folders nextObject];
|
||||
}
|
||||
|
||||
return activeFolders;
|
||||
}
|
||||
|
||||
- (NSArray *) _fetchFields: (NSArray *) fields
|
||||
forComponentOfType: (NSString *) component
|
||||
{
|
||||
@@ -252,34 +224,42 @@
|
||||
NSMutableDictionary *infos, *currentInfo, *newInfo;
|
||||
NSString *owner, *uid;
|
||||
NSNull *marker;
|
||||
SOGoAppointmentFolders *clientObject;
|
||||
|
||||
marker = [NSNull null];
|
||||
|
||||
infos = [NSMutableDictionary dictionary];
|
||||
folders = [[self _activeCalendarFolders] objectEnumerator];
|
||||
clientObject = [self clientObject];
|
||||
|
||||
folders = [[clientObject subFolders] objectEnumerator];
|
||||
currentFolder = [folders nextObject];
|
||||
while (currentFolder)
|
||||
{
|
||||
owner = [currentFolder ownerInContext: context];
|
||||
currentInfos = [[currentFolder fetchCoreInfosFrom: startDate
|
||||
to: endDate
|
||||
component: component] objectEnumerator];
|
||||
newInfo = [currentInfos nextObject];
|
||||
while (newInfo)
|
||||
if ([currentFolder isActive])
|
||||
{
|
||||
uid = [newInfo objectForKey: @"c_uid"];
|
||||
currentInfo = [infos objectForKey: uid];
|
||||
if (!currentInfo
|
||||
|| [owner isEqualToString: userLogin])
|
||||
{
|
||||
[self _updatePrivacyInComponent: newInfo
|
||||
fromFolder: currentFolder];
|
||||
[newInfo setObject: owner forKey: @"c_owner"];
|
||||
[infos setObject: [newInfo objectsForKeys: fields
|
||||
notFoundMarker: marker]
|
||||
forKey: uid];
|
||||
}
|
||||
owner = [currentFolder ownerInContext: context];
|
||||
currentInfos = [[currentFolder fetchCoreInfosFrom: startDate
|
||||
to: endDate
|
||||
component: component] objectEnumerator];
|
||||
newInfo = [currentInfos nextObject];
|
||||
while (newInfo)
|
||||
{
|
||||
uid = [newInfo objectForKey: @"c_uid"];
|
||||
currentInfo = [infos objectForKey: uid];
|
||||
if (!currentInfo
|
||||
|| [owner isEqualToString: userLogin])
|
||||
{
|
||||
[self _updatePrivacyInComponent: newInfo
|
||||
fromFolder: currentFolder];
|
||||
[newInfo setObject: [currentFolder nameInContainer]
|
||||
forKey: @"c_folder"];
|
||||
// [newInfo setObject: owner forKey: @"c_owner"];
|
||||
[infos setObject: [newInfo objectsForKeys: fields
|
||||
notFoundMarker: marker]
|
||||
forKey: uid];
|
||||
}
|
||||
newInfo = [currentInfos nextObject];
|
||||
}
|
||||
}
|
||||
currentFolder = [folders nextObject];
|
||||
}
|
||||
@@ -326,7 +306,7 @@
|
||||
[self _setupContext];
|
||||
|
||||
newEvents = [NSMutableArray array];
|
||||
fields = [NSArray arrayWithObjects: @"c_name", @"c_owner", @"c_status",
|
||||
fields = [NSArray arrayWithObjects: @"c_name", @"c_folder", @"c_status",
|
||||
@"c_title", @"c_startdate", @"c_enddate", @"c_location",
|
||||
@"c_isallday", nil];
|
||||
events = [[self _fetchFields: fields
|
||||
@@ -397,7 +377,7 @@
|
||||
|
||||
[self _setupContext];
|
||||
|
||||
fields = [NSArray arrayWithObjects: @"c_name", @"c_owner", @"c_status",
|
||||
fields = [NSArray arrayWithObjects: @"c_name", @"c_folder", @"c_status",
|
||||
@"c_title", @"c_enddate", nil];
|
||||
|
||||
tasks = [[self _fetchFields: fields
|
||||
|
||||
Reference in new issue
Block a user