mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-04 18:09:44 +00:00
merge of '1cad98827a66e18891a4b93bbab5ccce88c61795'
and 'fa7e03f29012a5aa53494584d9d660effeab890f' Monotone-Parent: 1cad98827a66e18891a4b93bbab5ccce88c61795 Monotone-Parent: fa7e03f29012a5aa53494584d9d660effeab890f Monotone-Revision: fc65404103126a45384bce022216f93bcfda9947 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-12T15:40:14 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,18 @@
|
||||
2007-06-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/SOGoUI/SOGoDateFormatter.m ([SOGoDateFormatter
|
||||
-stringForSecondsSinceThe70s:seconds]): new utility method.
|
||||
|
||||
* UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions
|
||||
-eventsListAction]): no longer reduce the end day of one day for
|
||||
all day events since everything has been fixed in
|
||||
OCSiCalFieldExtractor.
|
||||
|
||||
* OGoContentStore/OCSiCalFieldExtractor.m ([OCSiCalFieldExtractor
|
||||
-extractQuickFieldsFromEvent:_event]): reduce the seconds/70 of
|
||||
the end date of all day events of 1 so that they stay on their
|
||||
real last day.
|
||||
|
||||
2007-06-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxCalMonthView.m: no longer retrieve appointments.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
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
|
||||
License along with SOGo; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA.
|
||||
*/
|
||||
@@ -27,25 +27,24 @@
|
||||
|
||||
@implementation OCSiCalFieldExtractor
|
||||
|
||||
static OCSiCalFieldExtractor *extractor = nil;
|
||||
static NSCalendarDate *distantFuture = nil;
|
||||
static NSNumber *distantFutureNumber = nil;
|
||||
static NSCalendarDate *distantFuture = nil;
|
||||
static NSNumber *distantFutureNumber = nil;
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
static BOOL didInit = NO;
|
||||
|
||||
if (didInit) return;
|
||||
didInit = YES;
|
||||
|
||||
distantFuture = [[NSCalendarDate distantFuture] retain];
|
||||
/* INT_MAX due to Postgres constraint */
|
||||
distantFutureNumber = [[NSNumber numberWithUnsignedInt:INT_MAX] retain];
|
||||
if (!distantFuture)
|
||||
{
|
||||
distantFuture = [[NSCalendarDate distantFuture] retain];
|
||||
/* INT_MAX due to Postgres constraint */
|
||||
distantFutureNumber = [[NSNumber numberWithUnsignedInt: INT_MAX] retain];
|
||||
}
|
||||
}
|
||||
|
||||
+ (id) sharedICalFieldExtractor
|
||||
{
|
||||
if (extractor == nil)
|
||||
static OCSiCalFieldExtractor *extractor = nil;
|
||||
|
||||
if (!extractor)
|
||||
extractor = [self new];
|
||||
|
||||
return extractor;
|
||||
@@ -55,99 +54,117 @@ static NSNumber *distantFutureNumber = nil;
|
||||
|
||||
- (NSNumber *) numberForDate: (NSCalendarDate *) _date
|
||||
{
|
||||
if (_date == distantFuture)
|
||||
return distantFutureNumber;
|
||||
|
||||
return [NSNumber numberWithUnsignedInt:[_date timeIntervalSince1970]];
|
||||
return ((_date == distantFuture)
|
||||
? distantFutureNumber
|
||||
: [NSNumber numberWithUnsignedInt: [_date timeIntervalSince1970]]);
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *) extractQuickFieldsFromEvent: (iCalEvent *) _event
|
||||
{
|
||||
NSMutableDictionary *row;
|
||||
NSCalendarDate *startDate, *endDate;
|
||||
NSArray *attendees;
|
||||
NSString *uid, *title, *location, *status;
|
||||
NSNumber *sequence;
|
||||
id organizer;
|
||||
id participants, partmails;
|
||||
NSMutableString *partstates;
|
||||
unsigned i, count;
|
||||
NSCalendarDate *startDate, *endDate;
|
||||
NSArray *attendees;
|
||||
NSString *uid, *title, *location, *status;
|
||||
NSNumber *sequence, *dateNumber;
|
||||
id organizer;
|
||||
id participants, partmails;
|
||||
NSMutableString *partstates;
|
||||
unsigned int i, count;
|
||||
BOOL isAllDay;
|
||||
iCalAccessClass accessClass;
|
||||
|
||||
if (_event == nil)
|
||||
return nil;
|
||||
|
||||
/* extract values */
|
||||
|
||||
startDate = [_event startDate];
|
||||
endDate = [_event endDate];
|
||||
uid = [_event uid];
|
||||
title = [_event summary];
|
||||
location = [_event location];
|
||||
sequence = [_event sequence];
|
||||
accessClass = [_event symbolicAccessClass];
|
||||
status = [[_event status] uppercaseString];
|
||||
|
||||
startDate = [_event startDate];
|
||||
endDate = [_event endDate];
|
||||
uid = [_event uid];
|
||||
title = [_event summary];
|
||||
location = [_event location];
|
||||
sequence = [_event sequence];
|
||||
accessClass = [_event symbolicAccessClass];
|
||||
isAllDay = [_event isAllDay];
|
||||
status = [[_event status] uppercaseString];
|
||||
|
||||
attendees = [_event attendees];
|
||||
partmails = [attendees valueForKey:@"rfc822Email"];
|
||||
partmails = [partmails componentsJoinedByString:@"\n"];
|
||||
participants = [attendees valueForKey:@"cn"];
|
||||
participants = [participants componentsJoinedByString:@"\n"];
|
||||
attendees = [_event attendees];
|
||||
partmails = [attendees valueForKey: @"rfc822Email"];
|
||||
partmails = [partmails componentsJoinedByString: @"\n"];
|
||||
participants = [attendees valueForKey: @"cn"];
|
||||
participants = [participants componentsJoinedByString: @"\n"];
|
||||
|
||||
/* build row */
|
||||
|
||||
row = [NSMutableDictionary dictionaryWithCapacity:8];
|
||||
|
||||
[row setObject: @"vevent" forKey: @"component"];
|
||||
|
||||
|
||||
if ([uid isNotNull])
|
||||
[row setObject:uid forKey:@"uid"];
|
||||
[row setObject:uid forKey: @"uid"];
|
||||
else
|
||||
[self logWithFormat:@"WARNING: could not extract a uid from event!"];
|
||||
[self logWithFormat: @"WARNING: could not extract a uid from event!"];
|
||||
|
||||
[row setObject:[NSNumber numberWithBool: [_event isAllDay]]
|
||||
|
||||
[row setObject: [NSNumber numberWithBool: isAllDay]
|
||||
forKey: @"isallday"];
|
||||
[row setObject:[NSNumber numberWithBool: [_event isRecurrent]]
|
||||
[row setObject: [NSNumber numberWithBool: [_event isRecurrent]]
|
||||
forKey: @"iscycle"];
|
||||
[row setObject:[NSNumber numberWithBool: [_event isOpaque]]
|
||||
[row setObject: [NSNumber numberWithBool: [_event isOpaque]]
|
||||
forKey: @"isopaque"];
|
||||
[row setObject:[NSNumber numberWithInt: [_event priorityNumber]]
|
||||
[row setObject: [NSNumber numberWithInt: [_event priorityNumber]]
|
||||
forKey: @"priority"];
|
||||
|
||||
if ([title isNotNull]) [row setObject: title forKey:@"title"];
|
||||
if ([location isNotNull]) [row setObject: location forKey:@"location"];
|
||||
if ([sequence isNotNull]) [row setObject: sequence forKey:@"sequence"];
|
||||
if ([title isNotNull]) [row setObject: title forKey: @"title"];
|
||||
if ([location isNotNull]) [row setObject: location forKey: @"location"];
|
||||
if ([sequence isNotNull]) [row setObject: sequence forKey: @"sequence"];
|
||||
|
||||
if ([startDate isNotNull])
|
||||
[row setObject: [self numberForDate: startDate] forKey:@"startdate"];
|
||||
[row setObject: [self numberForDate: startDate]
|
||||
forKey: @"startdate"];
|
||||
if ([endDate isNotNull])
|
||||
[row setObject: [self numberForDate: endDate] forKey:@"enddate"];
|
||||
{
|
||||
if (endDate == distantFuture)
|
||||
dateNumber = distantFutureNumber;
|
||||
else
|
||||
{
|
||||
if (isAllDay)
|
||||
i = 1;
|
||||
else
|
||||
i = 0;
|
||||
dateNumber
|
||||
= [NSNumber numberWithUnsignedInt:
|
||||
[endDate timeIntervalSince1970] - i];
|
||||
}
|
||||
[row setObject: dateNumber forKey: @"enddate"];
|
||||
}
|
||||
|
||||
if ([_event isRecurrent]) {
|
||||
NSCalendarDate *date;
|
||||
|
||||
|
||||
date = [_event lastPossibleRecurrenceStartDate];
|
||||
if (!date) {
|
||||
/* this could also be *nil*, but in the end it makes the fetchspecs
|
||||
more complex - thus we set it to a "reasonable" distant future */
|
||||
more complex - thus we set it to a "reasonable" distant future */
|
||||
date = distantFuture;
|
||||
}
|
||||
[row setObject:[self numberForDate:date] forKey:@"cycleenddate"];
|
||||
[row setObject:[_event cycleInfo] forKey:@"cycleinfo"];
|
||||
[row setObject:[self numberForDate:date] forKey: @"cycleenddate"];
|
||||
[row setObject:[_event cycleInfo] forKey: @"cycleinfo"];
|
||||
}
|
||||
|
||||
if ([participants length] > 0)
|
||||
[row setObject: participants forKey:@"participants"];
|
||||
[row setObject: participants forKey: @"participants"];
|
||||
if ([partmails length] > 0)
|
||||
[row setObject: partmails forKey:@"partmails"];
|
||||
[row setObject: partmails forKey: @"partmails"];
|
||||
|
||||
if ([status isNotNull]) {
|
||||
int code = 1;
|
||||
|
||||
if ([status isEqualToString:@"TENTATIVE"])
|
||||
|
||||
if ([status isEqualToString: @"TENTATIVE"])
|
||||
code = 2;
|
||||
else if ([status isEqualToString:@"CANCELLED"])
|
||||
else if ([status isEqualToString: @"CANCELLED"])
|
||||
code = 0;
|
||||
[row setObject:[NSNumber numberWithInt:code] forKey:@"status"];
|
||||
[row setObject:[NSNumber numberWithInt:code] forKey: @"status"];
|
||||
}
|
||||
else {
|
||||
/* confirmed by default */
|
||||
@@ -160,26 +177,26 @@ static NSNumber *distantFutureNumber = nil;
|
||||
organizer = [_event organizer];
|
||||
if (organizer) {
|
||||
NSString *email;
|
||||
|
||||
email = [organizer valueForKey:@"rfc822Email"];
|
||||
|
||||
email = [organizer valueForKey: @"rfc822Email"];
|
||||
if (email)
|
||||
[row setObject:email forKey:@"orgmail"];
|
||||
[row setObject:email forKey: @"orgmail"];
|
||||
}
|
||||
|
||||
|
||||
/* construct partstates */
|
||||
count = [attendees count];
|
||||
partstates = [[NSMutableString alloc] initWithCapacity:count * 2];
|
||||
count = [attendees count];
|
||||
partstates = [[NSMutableString alloc] initWithCapacity:count * 2];
|
||||
for ( i = 0; i < count; i++) {
|
||||
iCalPerson *p;
|
||||
iCalPerson *p;
|
||||
iCalPersonPartStat stat;
|
||||
|
||||
p = [attendees objectAtIndex:i];
|
||||
|
||||
p = [attendees objectAtIndex:i];
|
||||
stat = [p participationStatus];
|
||||
if(i != 0)
|
||||
[partstates appendString:@"\n"];
|
||||
[partstates appendFormat:@"%d", stat];
|
||||
[partstates appendString: @"\n"];
|
||||
[partstates appendFormat: @"%d", stat];
|
||||
}
|
||||
[row setObject:partstates forKey:@"partstates"];
|
||||
[row setObject:partstates forKey: @"partstates"];
|
||||
[partstates release];
|
||||
return row;
|
||||
}
|
||||
@@ -187,35 +204,35 @@ static NSNumber *distantFutureNumber = nil;
|
||||
- (NSMutableDictionary *) extractQuickFieldsFromTodo: (iCalToDo *) _task
|
||||
{
|
||||
NSMutableDictionary *row;
|
||||
NSCalendarDate *startDate, *dueDate;
|
||||
NSArray *attendees;
|
||||
NSString *uid, *title, *location, *status;
|
||||
NSNumber *sequence;
|
||||
id organizer, date;
|
||||
id participants, partmails;
|
||||
NSMutableString *partstates;
|
||||
unsigned i, count, code;
|
||||
NSCalendarDate *startDate, *dueDate;
|
||||
NSArray *attendees;
|
||||
NSString *uid, *title, *location, *status;
|
||||
NSNumber *sequence;
|
||||
id organizer, date;
|
||||
id participants, partmails;
|
||||
NSMutableString *partstates;
|
||||
unsigned i, count, code;
|
||||
iCalAccessClass accessClass;
|
||||
|
||||
if (_task == nil)
|
||||
return nil;
|
||||
|
||||
/* extract values */
|
||||
|
||||
startDate = [_task startDate];
|
||||
dueDate = [_task due];
|
||||
uid = [_task uid];
|
||||
title = [_task summary];
|
||||
location = [_task location];
|
||||
sequence = [_task sequence];
|
||||
accessClass = [_task symbolicAccessClass];
|
||||
status = [[_task status] uppercaseString];
|
||||
|
||||
startDate = [_task startDate];
|
||||
dueDate = [_task due];
|
||||
uid = [_task uid];
|
||||
title = [_task summary];
|
||||
location = [_task location];
|
||||
sequence = [_task sequence];
|
||||
accessClass = [_task symbolicAccessClass];
|
||||
status = [[_task status] uppercaseString];
|
||||
|
||||
attendees = [_task attendees];
|
||||
partmails = [attendees valueForKey:@"rfc822Email"];
|
||||
partmails = [partmails componentsJoinedByString:@"\n"];
|
||||
participants = [attendees valueForKey:@"cn"];
|
||||
participants = [participants componentsJoinedByString:@"\n"];
|
||||
attendees = [_task attendees];
|
||||
partmails = [attendees valueForKey: @"rfc822Email"];
|
||||
partmails = [partmails componentsJoinedByString: @"\n"];
|
||||
participants = [attendees valueForKey: @"cn"];
|
||||
participants = [participants componentsJoinedByString: @"\n"];
|
||||
|
||||
/* build row */
|
||||
|
||||
@@ -224,19 +241,19 @@ static NSNumber *distantFutureNumber = nil;
|
||||
[row setObject: @"vtodo" forKey: @"component"];
|
||||
|
||||
if ([uid isNotNull])
|
||||
[row setObject:uid forKey:@"uid"];
|
||||
[row setObject:uid forKey: @"uid"];
|
||||
else
|
||||
[self logWithFormat:@"WARNING: could not extract a uid from event!"];
|
||||
[self logWithFormat: @"WARNING: could not extract a uid from event!"];
|
||||
|
||||
[row setObject:[NSNumber numberWithBool:[_task isRecurrent]]
|
||||
forKey:@"iscycle"];
|
||||
forKey: @"iscycle"];
|
||||
[row setObject:[NSNumber numberWithInt:[_task priorityNumber]]
|
||||
forKey:@"priority"];
|
||||
forKey: @"priority"];
|
||||
|
||||
if ([title isNotNull]) [row setObject: title forKey:@"title"];
|
||||
if ([location isNotNull]) [row setObject: location forKey:@"location"];
|
||||
if ([sequence isNotNull]) [row setObject: sequence forKey:@"sequence"];
|
||||
|
||||
if ([title isNotNull]) [row setObject: title forKey: @"title"];
|
||||
if ([location isNotNull]) [row setObject: location forKey: @"location"];
|
||||
if ([sequence isNotNull]) [row setObject: sequence forKey: @"sequence"];
|
||||
|
||||
if ([startDate isNotNull])
|
||||
date = [self numberForDate: startDate];
|
||||
else
|
||||
@@ -250,23 +267,23 @@ static NSNumber *distantFutureNumber = nil;
|
||||
[row setObject: date forKey: @"enddate"];
|
||||
|
||||
if ([participants length] > 0)
|
||||
[row setObject:participants forKey:@"participants"];
|
||||
[row setObject:participants forKey: @"participants"];
|
||||
if ([partmails length] > 0)
|
||||
[row setObject:partmails forKey:@"partmails"];
|
||||
[row setObject:partmails forKey: @"partmails"];
|
||||
|
||||
if ([status isNotNull]) {
|
||||
code = 0; /* NEEDS-ACTION */
|
||||
if ([status isEqualToString:@"COMPLETED"])
|
||||
if ([status isEqualToString: @"COMPLETED"])
|
||||
code = 1;
|
||||
else if ([status isEqualToString:@"IN-PROCESS"])
|
||||
else if ([status isEqualToString: @"IN-PROCESS"])
|
||||
code = 2;
|
||||
else if ([status isEqualToString:@"CANCELLED"])
|
||||
else if ([status isEqualToString: @"CANCELLED"])
|
||||
code = 3;
|
||||
[row setObject: [NSNumber numberWithInt: code] forKey:@"status"];
|
||||
[row setObject: [NSNumber numberWithInt: code] forKey: @"status"];
|
||||
}
|
||||
else {
|
||||
/* confirmed by default */
|
||||
[row setObject:[NSNumber numberWithInt:1] forKey:@"status"];
|
||||
[row setObject:[NSNumber numberWithInt:1] forKey: @"status"];
|
||||
}
|
||||
|
||||
[row setObject: [NSNumber numberWithUnsignedInt: accessClass]
|
||||
@@ -275,26 +292,26 @@ static NSNumber *distantFutureNumber = nil;
|
||||
organizer = [_task organizer];
|
||||
if (organizer) {
|
||||
NSString *email;
|
||||
|
||||
email = [organizer valueForKey:@"rfc822Email"];
|
||||
|
||||
email = [organizer valueForKey: @"rfc822Email"];
|
||||
if (email)
|
||||
[row setObject:email forKey:@"orgmail"];
|
||||
[row setObject:email forKey: @"orgmail"];
|
||||
}
|
||||
|
||||
|
||||
/* construct partstates */
|
||||
count = [attendees count];
|
||||
partstates = [[NSMutableString alloc] initWithCapacity:count * 2];
|
||||
count = [attendees count];
|
||||
partstates = [[NSMutableString alloc] initWithCapacity:count * 2];
|
||||
for ( i = 0; i < count; i++) {
|
||||
iCalPerson *p;
|
||||
iCalPerson *p;
|
||||
iCalPersonPartStat stat;
|
||||
|
||||
p = [attendees objectAtIndex:i];
|
||||
|
||||
p = [attendees objectAtIndex:i];
|
||||
stat = [p participationStatus];
|
||||
if(i != 0)
|
||||
[partstates appendString:@"\n"];
|
||||
[partstates appendFormat:@"%d", stat];
|
||||
[partstates appendString: @"\n"];
|
||||
[partstates appendFormat: @"%d", stat];
|
||||
}
|
||||
[row setObject:partstates forKey:@"partstates"];
|
||||
[row setObject:partstates forKey: @"partstates"];
|
||||
[partstates release];
|
||||
return row;
|
||||
}
|
||||
@@ -304,20 +321,20 @@ static NSNumber *distantFutureNumber = nil;
|
||||
NSArray *elements;
|
||||
CardGroup *element;
|
||||
unsigned int count;
|
||||
|
||||
|
||||
elements = [ical allObjects];
|
||||
count = [elements count];
|
||||
if (count)
|
||||
{
|
||||
if (count > 1)
|
||||
[self logWithFormat:
|
||||
@"WARNING: given calendar contains more than one event: %@",
|
||||
ical];
|
||||
[self logWithFormat:
|
||||
@"WARNING: given calendar contains more than one event: %@",
|
||||
ical];
|
||||
element = [elements objectAtIndex: 0];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self logWithFormat:@"ERROR: given calendar contains no elements: %@", ical];
|
||||
[self logWithFormat: @"ERROR: given calendar contains no elements: %@", ical];
|
||||
element = nil;
|
||||
}
|
||||
|
||||
@@ -328,33 +345,33 @@ static NSNumber *distantFutureNumber = nil;
|
||||
NSAutoreleasePool *pool;
|
||||
NSDictionary *fields;
|
||||
id cal;
|
||||
|
||||
|
||||
if ([_content length] == 0)
|
||||
return nil;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
cal = [iCalCalendar parseSingleFromSource: _content];
|
||||
|
||||
|
||||
fields = nil;
|
||||
if (cal)
|
||||
{
|
||||
if ([cal isKindOfClass:[iCalCalendar class]])
|
||||
cal = [self firstElementFromCalendar: cal];
|
||||
cal = [self firstElementFromCalendar: cal];
|
||||
|
||||
if ([cal isKindOfClass:[iCalEvent class]])
|
||||
fields = [[self extractQuickFieldsFromEvent:cal] retain];
|
||||
fields = [[self extractQuickFieldsFromEvent:cal] retain];
|
||||
else if ([cal isKindOfClass:[iCalToDo class]])
|
||||
fields = [[self extractQuickFieldsFromTodo:cal] retain];
|
||||
fields = [[self extractQuickFieldsFromTodo:cal] retain];
|
||||
else if ([cal isNotNull]) {
|
||||
[self logWithFormat:@"ERROR: unexpected iCalendar parse result: %@",
|
||||
cal];
|
||||
[self logWithFormat: @"ERROR: unexpected iCalendar parse result: %@",
|
||||
cal];
|
||||
}
|
||||
}
|
||||
else
|
||||
[self logWithFormat:@"ERROR: parsing source didn't return anything"];
|
||||
[self logWithFormat: @"ERROR: parsing source didn't return anything"];
|
||||
|
||||
[pool release];
|
||||
|
||||
|
||||
return [fields autorelease];
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
- (void)setFullWeekdayNameAndDetails;
|
||||
|
||||
- (NSString *)stringForObjectValue:(id)_obj;
|
||||
- (NSString *) stringForSecondsSinceThe70s: (unsigned int) seconds;
|
||||
|
||||
- (NSString *)shortDayOfWeek:(int)_day;
|
||||
- (NSString *)fullDayOfWeek:(int)_day;
|
||||
|
||||
@@ -58,11 +58,18 @@
|
||||
|
||||
/* operation */
|
||||
|
||||
- (NSString *)stringForObjectValue:(id)_obj {
|
||||
- (NSString *) stringForObjectValue: (id) _obj
|
||||
{
|
||||
return [self performSelector:self->formatAction
|
||||
withObject:_obj];
|
||||
}
|
||||
|
||||
- (NSString *) stringForSecondsSinceThe70s: (unsigned int) seconds
|
||||
{
|
||||
return [self stringForObjectValue:
|
||||
[NSCalendarDate dateWithTimeIntervalSince1970: seconds]];
|
||||
}
|
||||
|
||||
/* Helpers */
|
||||
|
||||
- (NSString *)shortDayOfWeek:(int)_day {
|
||||
|
||||
@@ -317,16 +317,10 @@
|
||||
{
|
||||
newEvent = [NSMutableArray arrayWithArray: oldEvent];
|
||||
interval = [[oldEvent objectAtIndex: 4] intValue];
|
||||
date
|
||||
= [dateFormatter stringForObjectValue:
|
||||
[NSCalendarDate dateWithTimeIntervalSince1970: interval]];
|
||||
date = [dateFormatter stringForSecondsSinceThe70s: interval];
|
||||
[newEvent addObject: date];
|
||||
interval = [[oldEvent objectAtIndex: 5] intValue];
|
||||
if ([[oldEvent objectAtIndex: 7] boolValue])
|
||||
interval -= 86400;
|
||||
date
|
||||
= [dateFormatter stringForObjectValue:
|
||||
[NSCalendarDate dateWithTimeIntervalSince1970: interval]];
|
||||
date = [dateFormatter stringForSecondsSinceThe70s: interval];
|
||||
[newEvent addObject: date];
|
||||
[newEvents addObject: newEvent];
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
NSString *currentTableHour;
|
||||
NSMutableArray *subscriptionUsers;
|
||||
NSMutableArray *hoursToDisplay;
|
||||
NSArray *allAppointments;
|
||||
// NSArray *allAppointments;
|
||||
|
||||
NSString *currentTableUser;
|
||||
NSDictionary *currentAppointment;
|
||||
// NSDictionary *currentAppointment;
|
||||
|
||||
NSString *cssClass;
|
||||
NSString *cssId;
|
||||
@@ -50,8 +50,8 @@
|
||||
- (void) setCurrentTableUser: (NSString *) aTableDay;
|
||||
- (NSString *) currentTableUser;
|
||||
|
||||
- (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment;
|
||||
- (NSDictionary *) currentAppointment;
|
||||
// - (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment;
|
||||
// - (NSDictionary *) currentAppointment;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
allAppointments = nil;
|
||||
// allAppointments = nil;
|
||||
subscriptionUsers = nil;
|
||||
hoursToDisplay = nil;
|
||||
currentTableUser = nil;
|
||||
currentTableHour = nil;
|
||||
dateFormatter = [[SOGoDateFormatter alloc]
|
||||
initWithLocale: [self locale]];
|
||||
// dateFormatter = [[SOGoDateFormatter alloc]
|
||||
// initWithLocale: [self locale]];
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -52,13 +52,10 @@
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
if (allAppointments)
|
||||
[allAppointments release];
|
||||
if (subscriptionUsers)
|
||||
[subscriptionUsers release];
|
||||
if (hoursToDisplay)
|
||||
[hoursToDisplay release];
|
||||
[dateFormatter release];
|
||||
// [allAppointments release];
|
||||
[subscriptionUsers release];
|
||||
[hoursToDisplay release];
|
||||
// [dateFormatter release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -189,69 +186,69 @@
|
||||
|
||||
/* fetching */
|
||||
|
||||
- (NSCalendarDate *) startDate
|
||||
{
|
||||
return [[self selectedDate] beginOfDay];
|
||||
}
|
||||
// - (NSCalendarDate *) startDate
|
||||
// {
|
||||
// return [[self selectedDate] beginOfDay];
|
||||
// }
|
||||
|
||||
- (NSCalendarDate *) endDate
|
||||
{
|
||||
return [[self selectedDate] endOfDay];
|
||||
}
|
||||
// - (NSCalendarDate *) endDate
|
||||
// {
|
||||
// return [[self selectedDate] endOfDay];
|
||||
// }
|
||||
|
||||
- (NSArray *) appointmentsForCurrentUser
|
||||
{
|
||||
NSMutableArray *filteredAppointments;
|
||||
NSEnumerator *aptsEnumerator;
|
||||
NSDictionary *userAppointment;
|
||||
NSCalendarDate *start, *end;
|
||||
int endHour;
|
||||
// - (NSArray *) appointmentsForCurrentUser
|
||||
// {
|
||||
// NSMutableArray *filteredAppointments;
|
||||
// NSEnumerator *aptsEnumerator;
|
||||
// NSDictionary *userAppointment;
|
||||
// NSCalendarDate *start, *end;
|
||||
// int endHour;
|
||||
|
||||
if (!allAppointments)
|
||||
{
|
||||
allAppointments = [self fetchCoreAppointmentsInfos];
|
||||
[allAppointments retain];
|
||||
}
|
||||
// if (!allAppointments)
|
||||
// {
|
||||
// allAppointments = [self fetchCoreAppointmentsInfos];
|
||||
// [allAppointments retain];
|
||||
// }
|
||||
|
||||
start = [[self selectedDate] hour: [self dayStartHour] minute: 0];
|
||||
endHour = [self dayEndHour];
|
||||
if (endHour < 24)
|
||||
end = [[self selectedDate] hour: [self dayEndHour] minute: 59];
|
||||
else
|
||||
end = [[[self selectedDate] tomorrow] hour: 0 minute: 0];
|
||||
// start = [[self selectedDate] hour: [self dayStartHour] minute: 0];
|
||||
// endHour = [self dayEndHour];
|
||||
// if (endHour < 24)
|
||||
// end = [[self selectedDate] hour: [self dayEndHour] minute: 59];
|
||||
// else
|
||||
// end = [[[self selectedDate] tomorrow] hour: 0 minute: 0];
|
||||
|
||||
filteredAppointments = [NSMutableArray new];
|
||||
[filteredAppointments autorelease];
|
||||
// filteredAppointments = [NSMutableArray new];
|
||||
// [filteredAppointments autorelease];
|
||||
|
||||
aptsEnumerator = [allAppointments objectEnumerator];
|
||||
userAppointment = [aptsEnumerator nextObject];
|
||||
while (userAppointment)
|
||||
{
|
||||
if ([[userAppointment objectForKey: @"owner"]
|
||||
isEqualToString: currentTableUser])
|
||||
[filteredAppointments
|
||||
addObject: [self _adjustedAppointment: userAppointment
|
||||
forStart: start andEnd: end]];
|
||||
userAppointment = [aptsEnumerator nextObject];
|
||||
}
|
||||
// aptsEnumerator = [allAppointments objectEnumerator];
|
||||
// userAppointment = [aptsEnumerator nextObject];
|
||||
// while (userAppointment)
|
||||
// {
|
||||
// if ([[userAppointment objectForKey: @"owner"]
|
||||
// isEqualToString: currentTableUser])
|
||||
// [filteredAppointments
|
||||
// addObject: [self _adjustedAppointment: userAppointment
|
||||
// forStart: start andEnd: end]];
|
||||
// userAppointment = [aptsEnumerator nextObject];
|
||||
// }
|
||||
|
||||
return filteredAppointments;
|
||||
}
|
||||
// return filteredAppointments;
|
||||
// }
|
||||
|
||||
- (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment
|
||||
{
|
||||
currentAppointment = newCurrentAppointment;
|
||||
}
|
||||
// - (void) setCurrentAppointment: (NSDictionary *) newCurrentAppointment
|
||||
// {
|
||||
// currentAppointment = newCurrentAppointment;
|
||||
// }
|
||||
|
||||
- (NSDictionary *) currentAppointment
|
||||
{
|
||||
return currentAppointment;
|
||||
}
|
||||
// - (NSDictionary *) currentAppointment
|
||||
// {
|
||||
// return currentAppointment;
|
||||
// }
|
||||
|
||||
- (NSString *) appointmentsClasses
|
||||
{
|
||||
return @"appointments appointmentsFor1Days";
|
||||
}
|
||||
// - (NSString *) appointmentsClasses
|
||||
// {
|
||||
// return @"appointments appointmentsFor1Days";
|
||||
// }
|
||||
|
||||
- (NSString *) currentUserClasses
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<!-- var:foreach
|
||||
list="aptsForCurrentDate"
|
||||
item="appointment"
|
||||
var:component className="UIxCalInlineMonthAptView"
|
||||
var:component className="UIxCalInlineMdsadsadsaonthAptView"
|
||||
appointment="appointment"
|
||||
formatter="monthAptFormatter"
|
||||
tooltipFormatter="aptTooltipFormatter"
|
||||
@@ -92,7 +92,7 @@
|
||||
</td>
|
||||
<td class="day" width="90%">
|
||||
<var:foreach list="allDayApts" item="appointment">
|
||||
<var:component className="UIxCalInlineAptView"
|
||||
<var:component className="UIxCaaaaalInlineAptView"
|
||||
appointment="appointment"
|
||||
formatter="aptFormatter"
|
||||
tooltipFormatter="aptTooltipFormatter"
|
||||
@@ -118,7 +118,7 @@
|
||||
><br /><var:foreach
|
||||
list="aptsForCurrentDate"
|
||||
item="appointment"
|
||||
><var:component className="UIxCalInlineAptView"
|
||||
><var:component className="UIxCalInlineAptxxxxView"
|
||||
appointment="appointment"
|
||||
formatter="monthAptFormatter"
|
||||
tooltipFormatter="aptTooltipFormatter"
|
||||
|
||||
@@ -85,7 +85,7 @@ function contactsListCallback(http) {
|
||||
configureSortableTableHeaders();
|
||||
}
|
||||
else
|
||||
log ("ajax fuckage 1");
|
||||
log ("ajax problem 1");
|
||||
}
|
||||
|
||||
function onContactFoldersContextMenu(event) {
|
||||
@@ -186,7 +186,7 @@ function contactLoadCallback(http) {
|
||||
div.innerHTML = content;
|
||||
}
|
||||
else
|
||||
log ("ajax fuckage 2: " + http.status);
|
||||
log ("ajax problem 2: " + http.status);
|
||||
}
|
||||
|
||||
var rowSelectionCount = 0;
|
||||
@@ -336,11 +336,13 @@ function onHeaderClick(event) {
|
||||
document.contactsListAjaxRequest.aborted = true;
|
||||
document.contactsListAjaxRequest.abort();
|
||||
}
|
||||
url = URLForFolderID(currentContactFolder) + "/" + this.link;
|
||||
if (!this.link.match(/noframe=/))
|
||||
url += "&noframe=1";
|
||||
url = URLForFolderID(currentContactFolder);
|
||||
// // log("url: " + url);
|
||||
// var url = "" + this.href;
|
||||
if (url.indexOf("noframe=", 0) == -1)
|
||||
url += "&noframe=1";
|
||||
document.contactsListAjaxRequest
|
||||
= triggerAjaxRequest(url, contactsListCallback);
|
||||
= triggerAjaxRequest(url, contactsListCallback);
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
@@ -451,7 +453,7 @@ function newAbCallback(http) {
|
||||
appendAddressBook(name, "/" + name);
|
||||
}
|
||||
else
|
||||
log ("ajax fuckage 4:" + http.status);
|
||||
log ("ajax problem 4:" + http.status);
|
||||
}
|
||||
|
||||
function newUserFolderCallback(folderData) {
|
||||
@@ -531,7 +533,7 @@ function deletePersonalAddressBookCallback(http) {
|
||||
document.deletePersonalABAjaxRequest = null;
|
||||
}
|
||||
else
|
||||
log ("ajax fuckage");
|
||||
log ("ajax problem");
|
||||
}
|
||||
|
||||
function configureDragHandles() {
|
||||
|
||||
@@ -4,7 +4,7 @@ DIV#leftPanel
|
||||
position: absolute;
|
||||
top: 5.5em;
|
||||
left: 0px;
|
||||
width: 18.5em;
|
||||
width: 19.25em;
|
||||
bottom: 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -15,13 +15,13 @@ DIV#schedulerTabs
|
||||
top: 0.5em;
|
||||
left: .2em;
|
||||
right: .2em;
|
||||
height: 17em;
|
||||
height: 14em;
|
||||
}
|
||||
|
||||
DIV#tasksListView
|
||||
{
|
||||
position: absolute;
|
||||
top: 20em;
|
||||
top: 17em;
|
||||
bottom: 0px;
|
||||
left: .2em;
|
||||
right: .7em;
|
||||
@@ -84,7 +84,7 @@ UL#calendarList LI
|
||||
UL#tasksList
|
||||
{ position: absolute;
|
||||
width: 100%;
|
||||
top: 3em;
|
||||
top: 2em;
|
||||
left: .25em;
|
||||
right: .25em;
|
||||
bottom: .25em; }
|
||||
@@ -126,7 +126,7 @@ UL#tasksList LI[class~="_selected"].duelater
|
||||
DIV#rightPanel
|
||||
{ position: absolute;
|
||||
top: 5.5em;
|
||||
left: 18.5em;
|
||||
left: 19.25em;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
margin: 0px;
|
||||
@@ -143,7 +143,8 @@ DIV#eventsListView
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
height: 15.5em;
|
||||
overflow: auto; }
|
||||
overflow: hidden;
|
||||
overflow-y: auto; }
|
||||
|
||||
DIV#calendarView
|
||||
{ position: absolute;
|
||||
@@ -163,7 +164,7 @@ DIV#calendarView A
|
||||
#verticalDragHandle
|
||||
{ cursor: e-resize;
|
||||
top: 7.5em;
|
||||
left: 18.5em;
|
||||
left: 19.25em;
|
||||
width: 5px;
|
||||
bottom: 0px; }
|
||||
|
||||
|
||||
@@ -1197,7 +1197,10 @@ function configureSortableTableHeaders() {
|
||||
var headers = document.getElementsByClassName("sortableTableHeader");
|
||||
for (var i = 0; i < headers.length; i++) {
|
||||
var header = headers[i];
|
||||
Event.observe(header, "click", onHeaderClick.bindAsEventListener(header));
|
||||
var anchor = $(header).childNodesWithTag("a")[0];
|
||||
if (anchor)
|
||||
Event.observe(anchor, "click",
|
||||
onHeaderClick.bindAsEventListener(anchor));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user