mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-28 17:57:38 +00:00
Monotone-Parent: 2fdf0ead0781ef2362dd389811d5db44ca4cc84a
Monotone-Revision: c91eef7edcfd08d414664c25a590b6268a7e58e2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-29T04:19:32 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -43,17 +43,18 @@
|
||||
#import <NGCards/iCalTimeZone.h>
|
||||
#import <NGCards/iCalDateTime.h>
|
||||
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/SOGoDateFormatter.h>
|
||||
#import <SoObjects/SOGo/SOGoContentObject.h>
|
||||
#import <SoObjects/SOGo/SOGoPermissions.h>
|
||||
#import <SoObjects/Appointments/iCalPerson+SOGo.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentOccurence.h>
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <SOGo/SOGoContentObject.h>
|
||||
#import <SOGo/SOGoDateFormatter.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <Appointments/iCalPerson+SOGo.h>
|
||||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
#import <Appointments/SOGoAppointmentObject.h>
|
||||
#import <Appointments/SOGoAppointmentOccurence.h>
|
||||
|
||||
#import <SoObjects/Appointments/SOGoComponentOccurence.h>
|
||||
#import <Appointments/SOGoComponentOccurence.h>
|
||||
|
||||
#import "UIxComponentEditor.h"
|
||||
#import "UIxAppointmentEditor.h"
|
||||
@@ -207,22 +208,22 @@
|
||||
{
|
||||
NSCalendarDate *newStartDate, *now;
|
||||
NSTimeZone *timeZone;
|
||||
SOGoUser *user;
|
||||
SOGoUserDefaults *ud;
|
||||
int hour;
|
||||
unsigned int uStart, uEnd;
|
||||
|
||||
newStartDate = [self selectedDate];
|
||||
if (![[self queryParameterForKey: @"hm"] length])
|
||||
{
|
||||
ud = [[context activeUser] userDefaults];
|
||||
timeZone = [ud timeZone];
|
||||
now = [NSCalendarDate calendarDate];
|
||||
timeZone = [[context activeUser] timeZone];
|
||||
[now setTimeZone: timeZone];
|
||||
|
||||
user = [context activeUser];
|
||||
uStart = [user dayStartHour];
|
||||
uStart = [ud dayStartHour];
|
||||
if ([now isDateOnSameDay: newStartDate])
|
||||
{
|
||||
uEnd = [user dayEndHour];
|
||||
uEnd = [ud dayEndHour];
|
||||
hour = [now hourOfDay];
|
||||
if (hour < uStart)
|
||||
newStartDate = [now hour: uStart minute: 0];
|
||||
@@ -245,10 +246,13 @@
|
||||
NSTimeZone *timeZone;
|
||||
unsigned int minutes;
|
||||
SOGoObject <SOGoComponentOccurence> *co;
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
[self event];
|
||||
co = [self clientObject];
|
||||
timeZone = [[context activeUser] timeZone];
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
timeZone = [ud timeZone];
|
||||
|
||||
if ([co isNew]
|
||||
&& [co isKindOfClass: [SOGoCalendarComponent class]])
|
||||
@@ -343,8 +347,13 @@
|
||||
iCalRecurrenceRule *rule;
|
||||
NSEnumerator *rules;
|
||||
NSCalendarDate *untilDate;
|
||||
SOGoUserDefaults *ud;
|
||||
NSTimeZone *timeZone;
|
||||
|
||||
rules = [[event recurrenceRules] objectEnumerator];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
timeZone = [ud timeZone];
|
||||
|
||||
while ((rule = [rules nextObject]))
|
||||
{
|
||||
untilDate = [rule untilDate];
|
||||
@@ -354,7 +363,7 @@
|
||||
NSCalendarDate *date;
|
||||
|
||||
date = [[event startDate] copy];
|
||||
[date setTimeZone: [[context activeUser] timeZone]];
|
||||
[date setTimeZone: timeZone];
|
||||
untilDate = [untilDate dateByAddingYears:0
|
||||
months:0
|
||||
days:0
|
||||
@@ -431,7 +440,7 @@
|
||||
NSDictionary *data;
|
||||
NSCalendarDate *firstDate, *eventDate;
|
||||
NSTimeZone *timeZone;
|
||||
SOGoUser *user;
|
||||
SOGoUserDefaults *ud;
|
||||
SOGoCalendarComponent *co;
|
||||
iCalEvent *master;
|
||||
BOOL resetAlarm;
|
||||
@@ -440,8 +449,8 @@
|
||||
[self event];
|
||||
|
||||
result = [self responseWithStatus: 200];
|
||||
user = [context activeUser];
|
||||
timeZone = [user timeZone];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
timeZone = [ud timeZone];
|
||||
eventDate = [event startDate];
|
||||
[eventDate setTimeZone: timeZone];
|
||||
co = [self clientObject];
|
||||
@@ -504,6 +513,7 @@
|
||||
inContext: (WOContext *) _ctx
|
||||
{
|
||||
int nbrDays;
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
[self event];
|
||||
|
||||
@@ -526,8 +536,10 @@
|
||||
if ([[self clientObject] isNew])
|
||||
{
|
||||
iCalTimeZone *tz;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
tz = [iCalTimeZone timeZoneForName: [[[context activeUser] timeZone] name]];
|
||||
tz = [iCalTimeZone timeZoneForName: [ud timeZoneName]];
|
||||
[[event parent] addTimeZone: tz];
|
||||
[(iCalDateTime *)[event uniqueChildWithTag: @"dtstart"] setTimeZone: tz];
|
||||
[(iCalDateTime *)[event uniqueChildWithTag: @"dtend"] setTimeZone: tz];
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <Common/UIxPageFrame.h>
|
||||
|
||||
#import "UIxAttendeesEditor.h"
|
||||
@@ -79,12 +80,20 @@
|
||||
|
||||
- (unsigned int) dayStartHour
|
||||
{
|
||||
return [[context activeUser] dayStartHour];
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
return [ud dayStartHour];
|
||||
}
|
||||
|
||||
- (unsigned int) dayEndHour
|
||||
{
|
||||
return [[context activeUser] dayEndHour];
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
return [ud dayEndHour];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#import <NGExtensions/NSCalendarDate+misc.h>
|
||||
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/NSCalendarDate+SOGo.h>
|
||||
|
||||
#import "UIxCalDateSelector.h"
|
||||
@@ -95,7 +97,11 @@
|
||||
|
||||
- (unsigned int) firstDayOfWeek
|
||||
{
|
||||
return [[context activeUser] firstDayOfWeek];
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
return [ud firstDayOfWeek];
|
||||
}
|
||||
|
||||
/* labels */
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
NSMutableArray *hoursToDisplay;
|
||||
NSArray *weekDays;
|
||||
SOGoDateFormatter *dateFormatter;
|
||||
NSUserDefaults *ud;
|
||||
NSString *timeFormat;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,14 +25,15 @@
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSUserDefaults.h> /* for locale string constants */
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGExtensions/NSCalendarDate+misc.h>
|
||||
#import <EOControl/EOQualifier.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoDateFormatter.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoDateFormatter.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
|
||||
#import "../../Main/SOGo.h"
|
||||
|
||||
@@ -44,12 +45,17 @@
|
||||
|
||||
- (id) init
|
||||
{
|
||||
NSDictionary *locale;
|
||||
NSString *language;
|
||||
SOGoUser *user;
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
if ((self = [super init]))
|
||||
{
|
||||
NSDictionary *locale;
|
||||
NSString *language;
|
||||
|
||||
language = [[context activeUser] language];
|
||||
user = [context activeUser];
|
||||
ud = [user userDefaults];
|
||||
ASSIGN (timeFormat, [ud timeFormat]);
|
||||
language = [ud language];
|
||||
locale = [[WOApplication application] localeForLanguageNamed: language];
|
||||
|
||||
daysToDisplay = nil;
|
||||
@@ -60,10 +66,10 @@
|
||||
currentTableHour = nil;
|
||||
weekDays = [locale objectForKey: NSShortWeekDayNameArray];
|
||||
[weekDays retain];
|
||||
dateFormatter = [[context activeUser] dateFormatterInContext: context];
|
||||
dateFormatter = [user dateFormatterInContext: context];
|
||||
[dateFormatter retain];
|
||||
}
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -75,6 +81,7 @@
|
||||
[daysToDisplay release];
|
||||
[hoursToDisplay release];
|
||||
[dateFormatter release];
|
||||
[timeFormat release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -120,9 +127,6 @@
|
||||
{
|
||||
unsigned int currentHour, lastHour;
|
||||
|
||||
// For later in method currentTableHour
|
||||
timeFormat = [[context activeUser] timeFormat];
|
||||
|
||||
if (!hoursToDisplay)
|
||||
{
|
||||
hoursToDisplay = [NSMutableArray new];
|
||||
@@ -333,14 +337,13 @@
|
||||
{
|
||||
NSMutableString *cellClass;
|
||||
int hour;
|
||||
SOGoUser *user;
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
cellClass = [NSMutableString string];
|
||||
hour = [currentTableHour intValue];
|
||||
user = [context activeUser];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
[cellClass appendFormat: @"clickableHourCell clickableHourCell%d", hour];
|
||||
if (hour < [user dayStartHour]
|
||||
|| hour > [user dayEndHour] - 1)
|
||||
if (hour < [ud dayStartHour] || hour > [ud dayEndHour] - 1)
|
||||
[cellClass appendString: @" outOfDay"];
|
||||
|
||||
return cellClass;
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
|
||||
@@ -113,13 +112,13 @@ static NSArray *filters = nil;
|
||||
- (NSString *) selectedFilter
|
||||
{
|
||||
NSString *selectedFilter;
|
||||
NSUserDefaults *ud;
|
||||
SOGoUserSettings *us;
|
||||
|
||||
selectedFilter = [self queryParameterForKey: @"filterpopup"];
|
||||
if (![selectedFilter length])
|
||||
{
|
||||
ud = [[context activeUser] userDefaults];
|
||||
selectedFilter = [ud objectForKey: @"CalendarDefaultFilter"];
|
||||
us = [[context activeUser] userSettings];
|
||||
selectedFilter = [us objectForKey: @"CalendarDefaultFilter"];
|
||||
}
|
||||
if (![selectedFilter length])
|
||||
selectedFilter = @"view_today";
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSTimeZone.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
@@ -40,15 +39,17 @@
|
||||
#import <NGExtensions/NSCalendarDate+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoDateFormatter.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/SOGoUserFolder.h>
|
||||
#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSObject+Utilities.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolders.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
#import <SOGo/SOGoDateFormatter.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/SOGoUserFolder.h>
|
||||
#import <SOGo/SOGoUserSettings.h>
|
||||
#import <SOGo/NSCalendarDate+SOGo.h>
|
||||
#import <SOGo/NSArray+Utilities.h>
|
||||
#import <SOGo/NSObject+Utilities.h>
|
||||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
#import <Appointments/SOGoAppointmentFolders.h>
|
||||
#import <Appointments/SOGoAppointmentObject.h>
|
||||
#import <Appointments/SOGoFreeBusyObject.h>
|
||||
|
||||
#import <UI/Common/WODirectAction+SOGo.h>
|
||||
@@ -104,7 +105,7 @@ static NSArray *tasksFields = nil;
|
||||
ASSIGN (request, newRequest);
|
||||
user = [[self context] activeUser];
|
||||
ASSIGN (dateFormatter, [user dateFormatterInContext: context]);
|
||||
ASSIGN (userTimeZone, [user timeZone]);
|
||||
ASSIGN (userTimeZone, [[user userDefaults] timeZone]);
|
||||
dayBasedView = NO;
|
||||
}
|
||||
|
||||
@@ -193,17 +194,15 @@ static NSArray *tasksFields = nil;
|
||||
- (void) _setupContext
|
||||
{
|
||||
SOGoUser *user;
|
||||
NSTimeZone *userTZ;
|
||||
NSString *param;
|
||||
|
||||
user = [context activeUser];
|
||||
userLogin = [user login];
|
||||
userTZ = [user timeZone];
|
||||
|
||||
param = [request formValueForKey: @"filterpopup"];
|
||||
if ([param length])
|
||||
{
|
||||
[self _setupDatesWithPopup: param andUserTZ: userTZ];
|
||||
[self _setupDatesWithPopup: param andUserTZ: userTimeZone];
|
||||
title = [request formValueForKey: @"search"];
|
||||
}
|
||||
else
|
||||
@@ -212,7 +211,7 @@ static NSArray *tasksFields = nil;
|
||||
if ([param length] > 0)
|
||||
startDate = [[NSCalendarDate dateFromShortDateString: param
|
||||
andShortTimeString: nil
|
||||
inTimeZone: userTZ] beginOfDay];
|
||||
inTimeZone: userTimeZone] beginOfDay];
|
||||
else
|
||||
startDate = nil;
|
||||
|
||||
@@ -220,7 +219,7 @@ static NSArray *tasksFields = nil;
|
||||
if ([param length] > 0)
|
||||
endDate = [[NSCalendarDate dateFromShortDateString: param
|
||||
andShortTimeString: nil
|
||||
inTimeZone: userTZ] endOfDay];
|
||||
inTimeZone: userTimeZone] endOfDay];
|
||||
else
|
||||
endDate = nil;
|
||||
|
||||
@@ -462,16 +461,16 @@ static NSArray *tasksFields = nil;
|
||||
- (void) checkFilterValue
|
||||
{
|
||||
NSString *filter;
|
||||
NSUserDefaults *ud;
|
||||
SOGoUserSettings *us;
|
||||
|
||||
filter = [[context request] formValueForKey: @"filterpopup"];
|
||||
if ([filter length]
|
||||
if ([filter length]
|
||||
&& ![filter isEqualToString: @"view_all"]
|
||||
&& ![filter isEqualToString: @"view_future"])
|
||||
{
|
||||
ud = [[context activeUser] userDefaults];
|
||||
[ud setObject: filter forKey: @"CalendarDefaultFilter"];
|
||||
[ud synchronize];
|
||||
us = [[context activeUser] userSettings];
|
||||
[us setObject: filter forKey: @"CalendarDefaultFilter"];
|
||||
[us synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -986,10 +985,10 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
|
||||
- (WOResponse *) tasksListAction
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
SOGoUserSettings *us;
|
||||
NSEnumerator *tasks;
|
||||
NSMutableArray *filteredTasks, *filteredTask;
|
||||
BOOL showCompleted, setUserDefault;
|
||||
BOOL showCompleted;
|
||||
NSArray *task;
|
||||
int statusCode;
|
||||
unsigned int endDateStamp;
|
||||
@@ -999,19 +998,17 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
|
||||
[self _setupContext];
|
||||
|
||||
#warning see TODO in SchedulerUI.js about "setud"
|
||||
showCompleted = [[request formValueForKey: @"show-completed"] intValue];
|
||||
if ([request formValueForKey: @"setud"])
|
||||
{
|
||||
us = [[context activeUser] userSettings];
|
||||
[us setBool: showCompleted forKey: @"ShowCompletedTasks"];
|
||||
[us synchronize];
|
||||
}
|
||||
|
||||
tasks = [[self _fetchFields: tasksFields
|
||||
forComponentOfType: @"vtodo"] objectEnumerator];
|
||||
showCompleted = [[request formValueForKey: @"show-completed"] intValue];
|
||||
setUserDefault = [[request formValueForKey: @"setud"] intValue];
|
||||
if (setUserDefault)
|
||||
{
|
||||
ud = [[context activeUser] userDefaults];
|
||||
[ud setBool: showCompleted
|
||||
forKey: @"ShowCompletedTasks"];
|
||||
[ud synchronize];
|
||||
}
|
||||
|
||||
|
||||
while ((task = [tasks nextObject]))
|
||||
{
|
||||
statusCode = [[task objectAtIndex: 2] intValue];
|
||||
@@ -1256,7 +1253,7 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
|
||||
- (NSArray *) _loadScheduleLimitsForUsers: (NSArray *) users
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
SOGoUserDefaults *ud;
|
||||
NSCalendarDate *from, *to, *maxFrom, *maxTo;
|
||||
int count;
|
||||
|
||||
@@ -1271,9 +1268,9 @@ _computeBlocksPosition (NSArray *blocks)
|
||||
roles: nil] userDefaults];
|
||||
if (ud)
|
||||
{
|
||||
from = [NSCalendarDate dateWithString: [ud objectForKey: @"DayStartTime"]
|
||||
from = [NSCalendarDate dateWithString: [ud dayStartTime]
|
||||
calendarFormat: @"%H:%M"];
|
||||
to = [NSCalendarDate dateWithString: [ud objectForKey: @"DayEndTime"]
|
||||
to = [NSCalendarDate dateWithString: [ud dayEndTime]
|
||||
calendarFormat: @"%H:%M"];
|
||||
maxFrom = (NSCalendarDate *)[from laterDate: maxFrom];
|
||||
maxTo = (NSCalendarDate *)[to earlierDate: maxTo];
|
||||
|
||||
@@ -27,15 +27,34 @@
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/Appointments/SOGoWebAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolders.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserSettings.h>
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <Appointments/SOGoWebAppointmentFolder.h>
|
||||
#import <Appointments/SOGoAppointmentFolders.h>
|
||||
|
||||
#import "UIxCalMainActions.h"
|
||||
|
||||
@implementation UIxCalMainActions
|
||||
|
||||
- (NSString *) displayNameForUrl: (NSString *) calendarURL
|
||||
{
|
||||
NSString *rc, *tmp;
|
||||
|
||||
tmp = [calendarURL lastPathComponent];
|
||||
if (tmp)
|
||||
{
|
||||
if ([[tmp pathExtension] caseInsensitiveCompare: @"ics"] == NSOrderedSame)
|
||||
rc = [tmp substringToIndex: [tmp length] - 4];
|
||||
else
|
||||
rc = tmp;
|
||||
}
|
||||
else
|
||||
rc = [self labelForKey: @"Web Calendar"];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (WOResponse *) addWebCalendarAction
|
||||
{
|
||||
WORequest *r;
|
||||
@@ -85,29 +104,10 @@
|
||||
return response;
|
||||
}
|
||||
|
||||
- (NSString *) displayNameForUrl: (NSString *) calendarURL
|
||||
{
|
||||
NSString *rc, *tmp;
|
||||
|
||||
tmp = [calendarURL lastPathComponent];
|
||||
if (tmp)
|
||||
{
|
||||
if ([[tmp pathExtension] caseInsensitiveCompare: @"ics"] == NSOrderedSame)
|
||||
rc = [tmp substringToIndex: [tmp length] - 4];
|
||||
else
|
||||
rc = tmp;
|
||||
}
|
||||
else
|
||||
rc = [self labelForKey: @"Web Calendar"];
|
||||
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (void) saveUrl: (NSURL *) calendarURL
|
||||
forCalendar: (NSString *) calendarName
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
SOGoUserSettings *settings;
|
||||
NSMutableDictionary *calSettings, *webCalendars;
|
||||
|
||||
settings = [[context activeUser] userSettings];
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
- (WOResponse *) reloadWebCalendarsAction
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
SOGoUserSettings *settings;
|
||||
NSMutableDictionary *calSettings, *webCalendars;
|
||||
NSArray *calendarIds;
|
||||
SOGoWebAppointmentFolder *folder;
|
||||
@@ -154,6 +154,4 @@
|
||||
return [self responseWith204];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
{
|
||||
NSString *monthMenuItem;
|
||||
NSNumber *yearMenuItem;
|
||||
NSUserDefaults *ud;
|
||||
SOGoUserSettings *us;
|
||||
NSMutableDictionary *moduleSettings;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSTimeZone.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGObjWeb/SoSecurityManager.h>
|
||||
@@ -34,6 +33,7 @@
|
||||
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
|
||||
@@ -45,17 +45,11 @@
|
||||
|
||||
- (void) checkDefaultModulePreference
|
||||
{
|
||||
NSUserDefaults *userd;
|
||||
NSString *pref;
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
userd = [[context activeUser] userDefaults];
|
||||
pref = [userd stringForKey: @"SOGoUIxDefaultModule"];
|
||||
|
||||
if (pref && [pref isEqualToString: @"Last"])
|
||||
{
|
||||
[userd setObject: @"Calendar" forKey: @"SOGoUIxLastModule"];
|
||||
[userd synchronize];
|
||||
}
|
||||
ud = [[context activeUser] userDefaults];
|
||||
if ([ud rememberLastModule])
|
||||
[ud setLoginModule: @"Calendar"];
|
||||
}
|
||||
|
||||
- (void) _setupContext
|
||||
@@ -71,12 +65,12 @@
|
||||
|
||||
module = [clientObject nameInContainer];
|
||||
|
||||
ud = [activeUser userSettings];
|
||||
moduleSettings = [ud objectForKey: module];
|
||||
us = [activeUser userSettings];
|
||||
moduleSettings = [us objectForKey: module];
|
||||
if (!moduleSettings)
|
||||
{
|
||||
moduleSettings = [NSMutableDictionary dictionary];
|
||||
[ud setObject: moduleSettings forKey: module];
|
||||
[us setObject: moduleSettings forKey: module];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +78,7 @@
|
||||
{
|
||||
static NSMutableArray *monthMenuItems = nil;
|
||||
unsigned int count;
|
||||
|
||||
|
||||
if (!monthMenuItems)
|
||||
{
|
||||
monthMenuItems = [[NSMutableArray alloc] initWithCapacity: 12];
|
||||
@@ -184,19 +178,27 @@
|
||||
else
|
||||
return [self responseWithStatus: 400];
|
||||
|
||||
[ud synchronize];
|
||||
[us synchronize];
|
||||
|
||||
return [self responseWithStatus: 204];
|
||||
}
|
||||
|
||||
- (unsigned int) firstDayOfWeek
|
||||
{
|
||||
return [[context activeUser] firstDayOfWeek];
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
return [ud firstDayOfWeek];
|
||||
}
|
||||
|
||||
- (unsigned int) dayStartHour
|
||||
{
|
||||
return [[context activeUser] dayStartHour];
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
return [ud dayStartHour];
|
||||
}
|
||||
|
||||
- (NSString *) currentView
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
|
||||
#import <NGExtensions/NSCalendarDate+misc.h>
|
||||
|
||||
@@ -86,7 +86,6 @@
|
||||
- (BOOL) showAMPMDates;
|
||||
- (unsigned) dayStartHour;
|
||||
- (unsigned) dayEndHour;
|
||||
- (BOOL) shouldDisplayWeekend;
|
||||
- (BOOL) shouldDisplayRejectedAppointments;
|
||||
|
||||
- (NSCalendarDate *) referenceDateForFormatter;
|
||||
|
||||
+18
-40
@@ -21,9 +21,9 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||
#import <SOGo/NSArray+Utilities.h>
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <SOGo/NSString+Utilities.h>
|
||||
|
||||
#import <NGObjWeb/SoSecurityManager.h>
|
||||
#import <NGObjWeb/SoUser.h>
|
||||
@@ -36,11 +36,12 @@
|
||||
#import <NGExtensions/NSString+misc.h>
|
||||
#import <NGCards/NGCards.h>
|
||||
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
|
||||
#import <SoObjects/SOGo/NSArray+Utilities.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/SOGoObject.h>
|
||||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
#import <Appointments/SOGoAppointmentObject.h>
|
||||
#import <SOGo/NSArray+Utilities.h>
|
||||
#import <SOGo/SOGoObject.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
|
||||
#import <SOGoUI/SOGoAptFormatter.h>
|
||||
|
||||
@@ -56,27 +57,15 @@
|
||||
|
||||
@implementation UIxCalView
|
||||
|
||||
static BOOL shouldDisplayWeekend = NO;
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
static BOOL didInit = NO;
|
||||
NSUserDefaults *ud;
|
||||
|
||||
if (didInit) return;
|
||||
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
shouldDisplayWeekend = [ud boolForKey: @"SOGoShouldDisplayWeekend"];
|
||||
didInit = YES;
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
self = [super init];
|
||||
if (self)
|
||||
{
|
||||
timeZone = [[context activeUser] timeZone];
|
||||
[timeZone retain];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
ASSIGN (timeZone, [ud timeZone]);
|
||||
aptFormatter
|
||||
= [[SOGoAptFormatter alloc] initWithDisplayTimeZone: timeZone];
|
||||
aptTooltipFormatter
|
||||
@@ -355,7 +344,7 @@ static BOOL shouldDisplayWeekend = NO;
|
||||
{
|
||||
SOGoUser *activeUser;
|
||||
NSString *module;
|
||||
NSUserDefaults *ud;
|
||||
SOGoUserSettings *us;
|
||||
NSMutableDictionary *moduleSettings;
|
||||
SOGoAppointmentFolders *clientObject;
|
||||
|
||||
@@ -364,18 +353,18 @@ static BOOL shouldDisplayWeekend = NO;
|
||||
|
||||
module = [clientObject nameInContainer];
|
||||
|
||||
ud = [activeUser userSettings];
|
||||
moduleSettings = [ud objectForKey: module];
|
||||
us = [activeUser userSettings];
|
||||
moduleSettings = [us objectForKey: module];
|
||||
if (!moduleSettings)
|
||||
{
|
||||
moduleSettings = [NSMutableDictionary dictionary];
|
||||
[ud setObject: moduleSettings forKey: module];
|
||||
[us setObject: moduleSettings forKey: module];
|
||||
}
|
||||
if (![theView isEqualToString: (NSString*)[moduleSettings objectForKey: @"View"]])
|
||||
{
|
||||
[moduleSettings setObject: theView
|
||||
forKey: @"View"];
|
||||
[ud synchronize];
|
||||
[us synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,17 +460,6 @@ static BOOL shouldDisplayWeekend = NO;
|
||||
return 23;
|
||||
}
|
||||
|
||||
- (BOOL) shouldDisplayWeekend
|
||||
{
|
||||
return shouldDisplayWeekend;
|
||||
}
|
||||
|
||||
- (BOOL) shouldHideWeekend
|
||||
{
|
||||
return ![self shouldDisplayWeekend];
|
||||
}
|
||||
|
||||
|
||||
/* URLs */
|
||||
|
||||
- (NSString *) appointmentViewURL
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
|
||||
#import <EOControl/EOQualifier.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
|
||||
#include "UIxCalWeekView.h"
|
||||
|
||||
@@ -54,15 +55,17 @@
|
||||
- (NSCalendarDate *) endDate
|
||||
{
|
||||
unsigned offset;
|
||||
|
||||
if ([self shouldDisplayWeekend])
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
if ([ud calendarShouldDisplayWeekend])
|
||||
offset = 7;
|
||||
else
|
||||
offset = 5;
|
||||
|
||||
return [[[self startDate] dateByAddingYears:0 months:0 days:offset
|
||||
hours:0 minutes:0 seconds:0]
|
||||
endOfDay];
|
||||
return [[[self startDate] dateByAddingYears: 0 months: 0 days: offset
|
||||
hours: 0 minutes: 0 seconds: 0]
|
||||
endOfDay];
|
||||
}
|
||||
|
||||
// - (NSArray *) appointments
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserSettings.h>
|
||||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
|
||||
#import "UIxCalendarProperties.h"
|
||||
|
||||
@@ -100,7 +101,7 @@
|
||||
|
||||
- (NSString *) allCalendarSyncTags
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
SOGoUserSettings *settings;
|
||||
NSMutableDictionary *calendarSettings;
|
||||
NSMutableDictionary *syncTags;
|
||||
NSEnumerator *keysList;
|
||||
@@ -174,7 +175,7 @@
|
||||
|
||||
- (NSString *) webCalendarURL
|
||||
{
|
||||
NSUserDefaults *settings;
|
||||
SOGoUserSettings *settings;
|
||||
NSMutableDictionary *calendarSettings;
|
||||
NSMutableDictionary *webCalendars;
|
||||
NSString *rc;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSURL.h>
|
||||
|
||||
#import <NGCards/iCalAlarm.h>
|
||||
@@ -55,12 +54,13 @@
|
||||
#import <Appointments/SOGoAppointmentOccurence.h>
|
||||
#import <Appointments/SOGoTaskObject.h>
|
||||
#import <SOGo/iCalEntityObject+Utilities.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
#import <SOGo/NSArray+Utilities.h>
|
||||
#import <SOGo/NSDictionary+BSJSONAdditions.h>
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <SOGo/NSString+Utilities.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
|
||||
#import "../../Main/SOGo.h"
|
||||
@@ -315,6 +315,8 @@ iRANGE(2);
|
||||
|
||||
- (void) _loadRRules
|
||||
{
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
// We initialize our repeat ivars
|
||||
if ([component hasRecurrenceRules])
|
||||
{
|
||||
@@ -421,7 +423,9 @@ iRANGE(2);
|
||||
|
||||
repeat = @"CUSTOM";
|
||||
date = [[rule untilDate] copy];
|
||||
[date setTimeZone: [[context activeUser] timeZone]];
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
[date setTimeZone: [ud timeZone]];
|
||||
[self setRange1: @"2"];
|
||||
[self setRange2: [date descriptionWithCalendarFormat: dateFormat]];
|
||||
[date release];
|
||||
@@ -825,10 +829,10 @@ iRANGE(2);
|
||||
{
|
||||
NSMutableArray *categoryList;
|
||||
NSArray *categoryLabels;
|
||||
NSUserDefaults *defaults;
|
||||
SOGoUserDefaults *defaults;
|
||||
|
||||
defaults = [[context activeUser] userDefaults];
|
||||
categoryLabels = [defaults arrayForKey: @"CalendarCategories"];
|
||||
categoryLabels = [defaults calendarCategories];
|
||||
if (!categoryLabels)
|
||||
categoryLabels = [[self labelForKey: @"category_labels"]
|
||||
componentsSeparatedByString: @","];
|
||||
@@ -1610,12 +1614,15 @@ RANGE(2);
|
||||
else if (range == 2)
|
||||
{
|
||||
NSCalendarDate *date;
|
||||
SOGoUser *user;
|
||||
|
||||
user = [context activeUser];
|
||||
SOGoUserDefaults *ud;
|
||||
NSDictionary *locale;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
locale = [[WOApplication application]
|
||||
localeForLanguageNamed: [ud language]];
|
||||
date = [NSCalendarDate dateWithString: [self range2]
|
||||
calendarFormat: dateFormat
|
||||
locale: [[WOApplication application] localeForLanguageNamed: [user language]]];
|
||||
locale: locale];
|
||||
[theRule setUntilDate: date];
|
||||
}
|
||||
// No end date.
|
||||
|
||||
@@ -38,12 +38,13 @@
|
||||
#import <NGCards/iCalTimeZone.h>
|
||||
#import <NGCards/iCalDateTime.h>
|
||||
|
||||
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/SOGoContentObject.h>
|
||||
#import <SoObjects/SOGo/SOGoDateFormatter.h>
|
||||
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
|
||||
#import <SoObjects/Appointments/SOGoTaskObject.h>
|
||||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <SOGo/SOGoContentObject.h>
|
||||
#import <SOGo/SOGoDateFormatter.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
#import <Appointments/SOGoAppointmentFolder.h>
|
||||
#import <Appointments/SOGoTaskObject.h>
|
||||
|
||||
#import "UIxComponentEditor.h"
|
||||
#import "UIxTaskEditor.h"
|
||||
@@ -255,22 +256,22 @@
|
||||
{
|
||||
NSCalendarDate *newStartDate, *now;
|
||||
NSTimeZone *timeZone;
|
||||
SOGoUser *user;
|
||||
SOGoUserDefaults *ud;
|
||||
int hour;
|
||||
unsigned int uStart, uEnd;
|
||||
|
||||
newStartDate = [self selectedDate];
|
||||
if (![[self queryParameterForKey: @"hm"] length])
|
||||
{
|
||||
ud = [[context activeUser] userDefaults];
|
||||
timeZone = [ud timeZone];
|
||||
now = [NSCalendarDate calendarDate];
|
||||
timeZone = [[context activeUser] timeZone];
|
||||
[now setTimeZone: timeZone];
|
||||
|
||||
user = [context activeUser];
|
||||
uStart = [user dayStartHour];
|
||||
uStart = [ud dayStartHour];
|
||||
if ([now isDateOnSameDay: newStartDate])
|
||||
{
|
||||
uEnd = [user dayEndHour];
|
||||
uEnd = [ud dayEndHour];
|
||||
hour = [now hourOfDay];
|
||||
if (hour < uStart)
|
||||
newStartDate = [now hour: uStart minute: 0];
|
||||
@@ -291,12 +292,14 @@
|
||||
NSCalendarDate *startDate, *dueDate;
|
||||
NSString *duration;
|
||||
NSTimeZone *timeZone;
|
||||
SOGoUserDefaults *ud;
|
||||
unsigned int minutes;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
timeZone = [ud timeZone];
|
||||
[self todo];
|
||||
if (todo)
|
||||
{
|
||||
timeZone = [[context activeUser] timeZone];
|
||||
startDate = [todo startDate];
|
||||
dueDate = [todo due];
|
||||
hasStartDate = (startDate != nil);
|
||||
@@ -430,14 +433,14 @@
|
||||
NSDictionary *data;
|
||||
NSCalendarDate *startDate, *dueDate;
|
||||
NSTimeZone *timeZone;
|
||||
SOGoUser *user;
|
||||
SOGoUserDefaults *ud;
|
||||
BOOL resetAlarm;
|
||||
|
||||
[self todo];
|
||||
|
||||
result = [self responseWithStatus: 200];
|
||||
user = [context activeUser];
|
||||
timeZone = [user timeZone];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
timeZone = [ud timeZone];
|
||||
startDate = [todo startDate];
|
||||
[startDate setTimeZone: timeZone];
|
||||
dueDate = [todo due];
|
||||
@@ -489,6 +492,9 @@
|
||||
- (void) takeValuesFromRequest: (WORequest *) _rq
|
||||
inContext: (WOContext *) _ctx
|
||||
{
|
||||
SOGoUserDefaults *ud;
|
||||
iCalTimeZone *tz;
|
||||
|
||||
[self todo];
|
||||
|
||||
[super takeValuesFromRequest: _rq inContext: _ctx];
|
||||
@@ -523,9 +529,8 @@
|
||||
|
||||
if ([[self clientObject] isNew])
|
||||
{
|
||||
iCalTimeZone *tz;
|
||||
|
||||
tz = [iCalTimeZone timeZoneForName: [[[context activeUser] timeZone] name]];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
tz = [iCalTimeZone timeZoneForName: [ud timeZoneName]];
|
||||
|
||||
if (hasStartDate || hasDueDate)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#import <NGObjWeb/SoObjects.h>
|
||||
#import <SOGo/NSCalendarDate+SOGo.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserDefaults.h>
|
||||
|
||||
#import "UIxTimeDateControl.h"
|
||||
|
||||
@@ -69,14 +71,14 @@
|
||||
|
||||
- (void) setDate: (NSCalendarDate *) _date
|
||||
{
|
||||
NSTimeZone *timeZone;
|
||||
SOGoUserDefaults *ud;
|
||||
int minuteValue;
|
||||
|
||||
timeZone = [[context activeUser] timeZone];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
if (!_date)
|
||||
_date = [NSCalendarDate date];
|
||||
|
||||
[_date setTimeZone: timeZone];
|
||||
[_date setTimeZone: [ud timeZone]];
|
||||
|
||||
[self _setDate: _date];
|
||||
|
||||
@@ -248,9 +250,9 @@
|
||||
{
|
||||
NSCalendarDate *d;
|
||||
unsigned _year, _month, _day, _hour, _minute, _second;
|
||||
NSTimeZone *timeZone;
|
||||
SOGoUserDefaults *ud;
|
||||
|
||||
timeZone = [[context activeUser] timeZone];
|
||||
ud = [[context activeUser] userDefaults];
|
||||
|
||||
/* call super, so that the form values are applied on the popups */
|
||||
[super takeValuesFromRequest:_rq inContext:_ctx];
|
||||
@@ -269,7 +271,7 @@
|
||||
|
||||
d = [NSCalendarDate dateWithYear: _year month:_month day:_day
|
||||
hour:_hour minute:_minute second:_second
|
||||
timeZone: timeZone];
|
||||
timeZone: [ud timeZone]];
|
||||
[self _setDate: d];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user