merge of '36df3bcfd6c56f483f2676ceb6b6757a6506dbb7'

and 'f12c75a72aac13edc9728fe5a656c622487836dd'

Monotone-Parent: 36df3bcfd6c56f483f2676ceb6b6757a6506dbb7
Monotone-Parent: f12c75a72aac13edc9728fe5a656c622487836dd
Monotone-Revision: 0c622c14bea584c75539ec4bf9d8ca29899745ef

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-14T22:05:54
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-09-14 22:05:54 +00:00
80 changed files with 1299 additions and 1111 deletions
@@ -110,8 +110,11 @@
/* Button Titles */
"Add..." = "Add...";
"Remove" = "Remove";
"New Calendar..." = "New Calendar...";
"Subscribe to a Calendar..." = "Subscribe to a Calendar...";
"Remove the selected Calendar" = "Remove the selected Calendar";
"Name of the Calendar" = "Name of the Calendar";
"new" = "New";
"printview" = "Print View";
@@ -111,8 +111,11 @@
/* Button Titles */
"Add..." = "Ajouter...";
"Remove" = "Enlever";
"New Calendar..." = "Nouvel agenda...";
"Subscribe to a Calendar..." = "S'inscrire à un agenda...";
"Remove the selected Calendar" = "Enlever l'agenda sélectionné";
"Name of the Calendar" = "Nom de l'agenda";
"new" = "Nouveau";
"printview" = "Version imprimable";
+1 -1
View File
@@ -48,7 +48,7 @@ SchedulerUI_RESOURCE_FILES += \
product.plist
SchedulerUI_RESOURCE_FILES += \
Toolbars/SOGoAppointmentFolder.toolbar \
Toolbars/SOGoAppointmentFolders.toolbar \
Toolbars/SOGoAppointmentObject.toolbar \
Toolbars/SOGoAppointmentObjectAccept.toolbar \
Toolbars/SOGoAppointmentObjectDecline.toolbar \
@@ -100,8 +100,11 @@
/* Button Titles */
"Add..." = "Hinzufügen...";
"Remove" = "Löschen";
"New Calendar..." = "New Calendar...";
"Subscribe to a Calendar..." = "Subscribe to a Calendar...";
"Remove the selected Calendar" = "Remove the selected Calendar";
"Name of the Calendar" = "Name of the Calendar";
"new" = "Neu";
"printview" = "Version imprimable";
+5 -5
View File
@@ -286,14 +286,14 @@
{
NSString *objectId, *method, *uri;
id <WOActionResults> result;
Class clientKlazz;
SOGoAppointmentFolder *co;
clientKlazz = [[self clientObject] class];
objectId = [clientKlazz globallyUniqueObjectId];
co = [self clientObject];
objectId = [co globallyUniqueObjectId];
if ([objectId length] > 0)
{
method = [NSString stringWithFormat:@"%@/Calendar/%@/editAsAppointment",
[self userFolderPath], objectId];
method = [NSString stringWithFormat:@"%@/%@/editAsAppointment",
[co soURL], objectId];
uri = [self completeHrefForMethod: method];
result = [self redirectToLocation: uri];
}
+31 -51
View File
@@ -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
+10
View File
@@ -23,6 +23,7 @@
#import <Foundation/NSArray.h>
#import <Foundation/NSCalendarDate.h>
#import <Foundation/NSString.h>
#import <Foundation/NSTimeZone.h>
#import <Foundation/NSUserDefaults.h>
#import <Foundation/NSValue.h>
@@ -41,6 +42,15 @@ static NSMutableArray *yearMenuItems = nil;
@implementation UIxCalMainView
- (NSString *) userUTCOffset
{
NSTimeZone *userTZ;
userTZ = [[context activeUser] timeZone];
return [NSString stringWithFormat: @"%d", [userTZ secondsFromGMT]];
}
- (NSArray *) monthMenuItems
{
unsigned int count;
+7 -13
View File
@@ -23,29 +23,23 @@
#ifndef UIXCALENDARSELECTOR_H
#define UIXCALENDARSELECTOR_H
#import <UI/SOGoUI/UIxComponent.h>
@class NSArray;
@class NSMutableArray;
@class NSDictionary;
@class NSMutableDictionary;
@class NSString;
@class iCalPerson;
@interface UIxCalendarSelector : UIxComponent
{
NSMutableDictionary *colors;
NSDictionary *currentCalendarFolder;
NSString *currentCalendarLogin;
NSMutableArray *calendars;
NSDictionary *currentCalendar;
}
- (NSArray *) calendarFolders;
- (NSArray *) calendars;
- (void) setCurrentCalendarFolder: (NSDictionary *) newCurrentCalendarFolder;
- (NSDictionary *) currentCalendarFolder;
- (NSString *) currentCalendarSpanBG;
- (NSString *) currentCalendarLogin;
- (NSString *) currentCalendarStyle;
- (void) setCurrentCalendar: (NSDictionary *) newCalendar;
- (NSDictionary *) currentCalendar;
@end
+54 -79
View File
@@ -22,34 +22,30 @@
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSString.h>
#import <Foundation/NSUserDefaults.h>
#import <Foundation/NSValue.h>
#import <NGExtensions/NGExtensions.h>
#import <NGCards/iCalPerson.h>
#import <SOGo/SOGoUser.h>
#import <SOGoUI/UIxComponent.h>
#import <SOGo/NSDictionary+Utilities.h>
#import <Appointments/SOGoAppointmentFolder.h>
#import <Appointments/SOGoAppointmentFolders.h>
#import "UIxCalendarSelector.h"
static inline char
darkenedColor (const char value)
{
char newValue;
// static inline char
// darkenedColor (const char value)
// {
// char newValue;
if (value >= '0' && value <= '9')
newValue = ((value - '0') / 2) + '0';
else if (value >= 'a' && value <= 'f')
newValue = ((value + 10 - 'a') / 2) + '0';
else if (value >= 'A' && value <= 'F')
newValue = ((value + 10 - 'A') / 2) + '0';
else
newValue = value;
// if (value >= '0' && value <= '9')
// newValue = ((value - '0') / 2) + '0';
// else if (value >= 'a' && value <= 'f')
// newValue = ((value + 10 - 'a') / 2) + '0';
// else if (value >= 'A' && value <= 'F')
// newValue = ((value + 10 - 'A') / 2) + '0';
// else
// newValue = value;
return newValue;
}
// return newValue;
// }
static inline NSString *
colorForNumber (unsigned int number)
@@ -90,8 +86,8 @@ colorForNumber (unsigned int number)
{
if ((self = [super init]))
{
colors = nil;
currentCalendarFolder = nil;
calendars = nil;
currentCalendar = nil;
}
return self;
@@ -99,82 +95,61 @@ colorForNumber (unsigned int number)
- (void) dealloc
{
[currentCalendarFolder release];
[colors release];
[calendars release];
[currentCalendar release];
[super dealloc];
}
- (NSArray *) calendarFolders
- (NSArray *) calendars
{
NSArray *calendarFolders;
NSEnumerator *newFolders;
NSDictionary *currentFolder;
unsigned int count;
NSArray *folders;
SOGoAppointmentFolder *folder;
NSMutableDictionary *calendar;
unsigned int count, max;
NSString *folderId, *folderName;
NSNumber *isActive;
calendarFolders = [[self clientObject] calendarFolders];
if (!colors)
if (!calendars)
{
colors = [NSMutableDictionary new];
count = 0;
newFolders = [calendarFolders objectEnumerator];
currentFolder = [newFolders nextObject];
while (currentFolder)
folders = [[self clientObject] subFolders];
max = [folders count];
calendars = [[NSMutableArray alloc] initWithCapacity: max];
for (count = 0; count < max; count++)
{
[colors setObject: colorForNumber (count)
forKey: [currentFolder objectForKey: @"folder"]];
count++;
currentFolder = [newFolders nextObject];
folder = [folders objectAtIndex: count];
calendar = [NSMutableDictionary dictionary];
folderName = [folder nameInContainer];
[calendar setObject:
[NSString stringWithFormat: @"/%@", folderName]
forKey: @"id"];
[calendar setObject: [folder displayName]
forKey: @"displayName"];
[calendar setObject: folderName forKey: @"folder"];
[calendar setObject: colorForNumber (count)
forKey: @"color"];
isActive = [NSNumber numberWithBool: [folder isActive]];
[calendar setObject: isActive forKey: @"active"];
[calendars addObject: calendar];
}
}
return calendarFolders;
return calendars;
}
- (void) setCurrentCalendarFolder: (NSDictionary *) newCurrentCalendarFolder
- (void) setCurrentCalendar: (NSDictionary *) newCalendar
{
ASSIGN (currentCalendarFolder, newCurrentCalendarFolder);
ASSIGN (currentCalendar, newCalendar);
}
- (NSDictionary *) currentCalendarFolder
- (NSDictionary *) currentCalendar
{
return currentCalendarFolder;
}
- (NSString *) currentCalendarSpanBG
{
NSString *colorKey;
colorKey = [currentCalendarFolder objectForKey: @"folder"];
return [colors objectForKey: colorKey];
}
- (NSString *) currentCalendarLogin
{
NSArray *parts;
NSMutableString *login;
login = [NSMutableString string];
parts = [[currentCalendarFolder objectForKey: @"folder"]
componentsSeparatedByString: @":"];
[login appendString: (([parts count] > 1)
? [parts objectAtIndex: 0]
: [[context activeUser] login])];
[login replaceString: @"." withString: @"_"];
[login replaceString: @"#" withString: @"_"];
[login replaceString: @"@" withString: @"_"];
return login;
return currentCalendar;
}
- (NSString *) currentCalendarStyle
{
NSString *color;
color = [self currentCalendarSpanBG];
return [NSString stringWithFormat: @"color: %@; background-color: %@;",
color, color];
return [currentCalendar
keysWithFormat: @"color: %{color}; background-color: %{color};"];
}
@end /* UIxCalendarSelector */
+7 -5
View File
@@ -42,6 +42,7 @@
#import <NGExtensions/NSString+misc.h>
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
#import <SoObjects/Appointments/SOGoAppointmentFolders.h>
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
#import <SoObjects/Appointments/SOGoTaskObject.h>
#import <SoObjects/SOGo/NSString+Utilities.h>
@@ -331,19 +332,20 @@
- (NSArray *) calendarList
{
SOGoAppointmentFolder *folder;
SOGoAppointmentFolder *calendar, *currentCalendar;
SOGoAppointmentFolders *calendarParent;
NSEnumerator *allCalendars;
NSDictionary *currentCalendar;
if (!calendarList)
{
calendarList = [NSMutableArray new];
folder = [[self clientObject] container];
allCalendars = [[folder calendarFolders] objectEnumerator];
calendar = [[self clientObject] container];
calendarParent = [calendar container];
allCalendars = [[calendarParent subFolders] objectEnumerator];
currentCalendar = [allCalendars nextObject];
while (currentCalendar)
{
if ([[currentCalendar objectForKey: @"active"] boolValue])
if ([currentCalendar isActive])
[calendarList addObject: currentCalendar];
currentCalendar = [allCalendars nextObject];
}
+5 -5
View File
@@ -324,14 +324,14 @@
{
NSString *objectId, *method, *uri;
id <WOActionResults> result;
Class clientKlazz;
SOGoAppointmentFolder *co;
clientKlazz = [[self clientObject] class];
objectId = [clientKlazz globallyUniqueObjectId];
co = [self clientObject];
objectId = [co globallyUniqueObjectId];
if ([objectId length] > 0)
{
method = [NSString stringWithFormat:@"%@/Calendar/%@/editAsTask",
[self userFolderPath], objectId];
method = [NSString stringWithFormat:@"%@/%@/editAsTask",
[co soURL], objectId];
uri = [self completeHrefForMethod: method];
result = [self redirectToLocation: uri];
}
+39 -14
View File
@@ -28,11 +28,11 @@
};
categories = {
SOGoAppointmentFolder = {
SOGoAppointmentFolders = {
slots = {
toolbar = {
protectedBy = "View";
value = "SOGoAppointmentFolder.toolbar";
value = "SOGoAppointmentFolders.toolbar";
};
};
methods = {
@@ -70,16 +70,6 @@
protectedBy = "View";
pageName = "UIxCalMonthView";
};
newevent = {
protectedBy = "Add Documents, Images, and Files";
pageName = "UIxAppointmentEditor";
actionName = "new";
};
newtask = {
protectedBy = "Add Documents, Images, and Files";
pageName = "UIxTaskEditor";
actionName = "new";
};
show = {
protectedBy = "View";
pageName = "UIxCalView";
@@ -94,15 +84,45 @@
pageName = "UIxAppointmentProposal";
actionName = "proposalSearch";
};
userRights = {
protectedBy = "ReadAcls";
pageName = "UIxCalUserRightsEditor";
};
saveUserRights = {
protectedBy = "SaveAcls";
pageName = "UIxCalUserRightsEditor";
actionName = "saveUserRights";
};
};
};
SOGoAppointmentFolder = {
methods = {
newevent = {
protectedBy = "Add Documents, Images, and Files";
pageName = "UIxAppointmentEditor";
actionName = "new";
};
newtask = {
protectedBy = "Add Documents, Images, and Files";
pageName = "UIxTaskEditor";
actionName = "new";
};
batchDelete = {
protectedBy = "Delete Objects";
pageName = "UIxCalMainView";
actionName = "batchDelete";
};
updateCalendars = {
show = {
protectedBy = "View";
pageName = "UIxCalView";
actionName = "redirectForUIDs";
};
batchDelete = {
protectedBy = "Delete Objects";
pageName = "UIxCalMainView";
actionName = "updateCalendars";
actionName = "batchDelete";
};
editAttendees = {
protectedBy = "View";
@@ -119,6 +139,7 @@
};
};
};
SOGoCalendarComponent = {
};
@@ -158,6 +179,10 @@
pageName = "UIxAppointmentEditor";
actionName = "decline";
};
editAttendees = {
protectedBy = "View";
pageName = "UIxAttendeesEditor";
};
};
};