From 814ac534bacb2a1be481611ef695a118c6b58576 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 11 Jun 2007 21:43:37 +0000 Subject: [PATCH] Monotone-Parent: ecbcc7654a8bfbced8f7532153b5f1320869d3b4 Monotone-Revision: 0a31b59516c9806b4aca1f194ea55dabe3a452d2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-11T21:43:37 Monotone-Branch: ca.inverse.sogo --- UI/Scheduler/GNUmakefile | 1 - UI/Scheduler/UIxCalInlineAptView.h | 44 --- UI/Scheduler/UIxCalInlineAptView.m | 287 ------------------ UI/Scheduler/UIxCalListingActions.m | 10 +- UI/Scheduler/UIxCalMonthView.h | 2 - .../SchedulerUI/UIxCalInlineAptView.wox | 32 -- 6 files changed, 5 insertions(+), 371 deletions(-) delete mode 100644 UI/Scheduler/UIxCalInlineAptView.h delete mode 100644 UI/Scheduler/UIxCalInlineAptView.m delete mode 100644 UI/Templates/SchedulerUI/UIxCalInlineAptView.wox diff --git a/UI/Scheduler/GNUmakefile b/UI/Scheduler/GNUmakefile index 830b6972f..98e2b9edd 100644 --- a/UI/Scheduler/GNUmakefile +++ b/UI/Scheduler/GNUmakefile @@ -41,7 +41,6 @@ SchedulerUI_OBJC_FILES = \ UIxCalDateLabel.m \ UIxDatePicker.m \ UIxTimeDateControl.m \ - UIxCalInlineAptView.m \ UIxCalInlineMonthAptView.m \ UIxCalParticipationStatusView.m \ UIxCalMonthOverview.m diff --git a/UI/Scheduler/UIxCalInlineAptView.h b/UI/Scheduler/UIxCalInlineAptView.h deleted file mode 100644 index f35ad15ef..000000000 --- a/UI/Scheduler/UIxCalInlineAptView.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright (C) 2000-2004 SKYRIX Software AG - - This file is part of OGo - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - 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 - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. - */ -// $Id: UIxCalInlineAptView.h 1031 2007-03-07 22:52:32Z wolfgang $ - -#ifndef UIXCALINLINEAPTVIEW_H -#define UIXCALINLINEAPTVIEW_H - -#import - -@interface UIxCalInlineAptView : WOComponent -{ - NSDictionary *appointment; - id formatter; - id tooltipFormatter; - id url; - id style; - id queryDictionary; - id referenceDate; - int dayStartHour; - int dayEndHour; - BOOL canAccess; -} - -@end - -#endif /* UIXCALINLINEAPTVIEW_H */ diff --git a/UI/Scheduler/UIxCalInlineAptView.m b/UI/Scheduler/UIxCalInlineAptView.m deleted file mode 100644 index 6ff1719eb..000000000 --- a/UI/Scheduler/UIxCalInlineAptView.m +++ /dev/null @@ -1,287 +0,0 @@ -/* - Copyright (C) 2000-2004 SKYRIX Software AG - - This file is part of OGo - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - 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 - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. - */ -// $Id: UIxCalInlineAptView.m 1052 2007-05-09 19:35:09Z wolfgang $ - -#import - -#import - -#import -#import -#import - -#import -#import -#import -#import - -#import "UIxCalInlineAptView.h" - -@implementation UIxCalInlineAptView - -- (id) init -{ - if ((self = [super init])) - { - dayStartHour = 0; - dayEndHour = 24; - appointment = nil; - } - - return self; -} - -- (void) dealloc -{ - [appointment release]; - [formatter release]; - [tooltipFormatter release]; - [url release]; - [style release]; - [queryDictionary release]; - [referenceDate release]; - [super dealloc]; -} - -- (void) setAppointment: (NSDictionary *) _appointment -{ - ASSIGN(appointment, _appointment); -} - -- (NSDictionary *) appointment -{ - return appointment; -} - -- (void) setDayStartHour: (unsigned int) anHour -{ - dayStartHour = anHour; -} - -- (void) setDayEndHour: (unsigned int) anHour -{ - dayEndHour = anHour; -} - -- (void) setFormatter: (id) _formatter -{ - ASSIGN(formatter, _formatter); -} - -- (id) formatter -{ - return formatter; -} - -- (void) setTooltipFormatter: (id) _tooltipFormatter -{ - ASSIGN(tooltipFormatter, _tooltipFormatter); -} - -- (id) tooltipFormatter -{ - return tooltipFormatter; -} - -- (void) setUrl: (id) _url -{ - ASSIGN(url, _url); -} - -- (id) url -{ - return url; -} - -- (void) setStyle: (id) _style -{ - NSMutableString *ms; - NSNumber *prio; - NSString *s; - NSString *email; - - if (_style) - ms = [NSMutableString stringWithString: _style]; - else - ms = (NSMutableString *)[NSMutableString string]; - - if ((prio = [appointment valueForKey:@"priority"])) { - [ms appendFormat:@" apt_prio%@", prio]; - } - email = [[context activeUser] primaryEmail]; - s = [appointment valueForKey:@"orgmail"]; - if ([s isNotNull]) - { - if ([s rangeOfString: email].length > 0) - [ms appendString:@" apt_organizer"]; - else - [ms appendString:@" apt_other"]; - } - s = [appointment valueForKey:@"partmails"]; - if ([s isNotNull]) - { - if ([s rangeOfString:email].length > 0) - [ms appendString:@" apt_participant"]; - else - [ms appendString:@" apt_nonparticipant"]; - } - ASSIGNCOPY(style, ms); -} - -- (id)style { - return style; -} - -- (void) setQueryDictionary: (id) _queryDictionary -{ - ASSIGN(queryDictionary, _queryDictionary); -} - -- (id) queryDictionary -{ - return queryDictionary; -} - -- (void) setReferenceDate: (id) _referenceDate -{ - ASSIGN(referenceDate, _referenceDate); -} - -- (id) referenceDate -{ - return referenceDate; -} - -- (void) setCanAccess: (BOOL) _canAccess -{ - canAccess = _canAccess; -} - -- (BOOL) canAccess -{ - return canAccess; -} - -- (NSString *) displayClasses -{ - NSTimeInterval secondsStart, secondsEnd, delta; - NSCalendarDate *startDate; - int deltaStart, deltaLength; - - startDate = [appointment objectForKey: @"startDate"]; - secondsStart = [startDate timeIntervalSince1970]; - secondsEnd = [[appointment objectForKey: @"endDate"] timeIntervalSince1970]; - delta = (secondsEnd - [startDate timeIntervalSince1970]) / 60; - deltaLength = delta / 15; - if (((int) delta % 15) > 0) - deltaLength += 1; - - deltaStart = (([startDate hourOfDay] * 60 + [startDate minuteOfHour] - - dayStartHour * 60) / 15); - - return [NSString stringWithFormat: @"appointment starts%d lasts%d", - deltaStart, deltaLength, [startDate dayOfWeek]]; -} - -- (NSString *) innerDisplayClasses -{ - return [NSString stringWithFormat: @"appointmentInside ownerIs%@", - [appointment objectForKey: @"owner"]]; -} - -- (NSString *) displayStyle -{ - NSCalendarDate *startDate, *endDate, *dayStart, *dayEnd; - int sSeconds, eSeconds, deltaMinutes; - unsigned int height; - NSTimeZone *uTZ; - - uTZ = [referenceDate timeZone]; - dayStart = [referenceDate beginOfDay]; - dayEnd = [referenceDate endOfDay]; - - sSeconds = [[appointment objectForKey: @"startdate"] intValue]; - eSeconds = [[appointment objectForKey: @"enddate"] intValue]; - startDate = [NSCalendarDate dateWithTimeIntervalSince1970: sSeconds]; - [startDate setTimeZone: uTZ]; - if ([startDate earlierDate: dayStart] == startDate) - startDate = dayStart; - endDate = [NSCalendarDate dateWithTimeIntervalSince1970: eSeconds]; - [endDate setTimeZone: uTZ]; - if ([endDate earlierDate: dayEnd] == dayEnd) - endDate = dayEnd; - - deltaMinutes = (([endDate hourOfDay] - [startDate hourOfDay]) * 60 - + [endDate minuteOfHour] - [startDate minuteOfHour]); - height = ceil(deltaMinutes / 15) * 25; - - return [NSString stringWithFormat: @"height: %d%%;", height]; -} - -/* helpers */ - -- (NSString *) startHour -{ - NSCalendarDate *start; - - start = [appointment objectForKey: @"startDate"]; - - return [NSString stringWithFormat: @"%.2d:%.2d", - [start hourOfDay], [start minuteOfHour]]; -} - -- (NSString *) title -{ - return [formatter stringForObjectValue: appointment - referenceDate: [self referenceDate]]; -} - -- (NSString *) tooltip -{ - return [tooltipFormatter stringForObjectValue: appointment - referenceDate: [self referenceDate]]; -} - -- (BOOL) _userIsInTheCard: (NSString *) email -{ - NSString *orgMailString, *partMailsString; - NSArray *partMails; - BOOL userIsInTheCard; - - orgMailString = [appointment objectForKey: @"orgmail"]; - if ([orgMailString isNotNull] && [orgMailString isEqualToString: email]) - userIsInTheCard = YES; - else - { - partMailsString = [appointment objectForKey: @"partmails"]; - if ([partMailsString isNotNull]) - { - partMails = [partMailsString componentsSeparatedByString: @"\n"]; - userIsInTheCard = [partMails containsObject: email]; - } - else - userIsInTheCard = NO; - } - - return userIsInTheCard; -} - -@end diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 02987da45..1ed0316b8 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -44,20 +44,20 @@ @implementation UIxCalListingActions -- (id) init +- (id) initWithRequest: (WORequest *) newRequest { NSDictionary *locale; - if ((self = [super init])) + if ((self = [super initWithRequest: newRequest])) { componentsData = [NSMutableDictionary new]; startDate = nil; endDate = nil; - request = nil; + ASSIGN (request, newRequest); locale = [[self context] valueForKey: @"locale"]; dateFormatter = [[SOGoDateFormatter alloc] initWithLocale: locale]; [dateFormatter setFullWeekdayNameAndDetails]; - } + } return self; } @@ -65,6 +65,7 @@ - (void) dealloc { [dateFormatter release]; + [request release]; [componentsData release]; [startDate release]; [endDate release]; @@ -151,7 +152,6 @@ userLogin = [user login]; userTZ = [user timeZone]; - request = [context request]; param = [request formValueForKey: @"filterpopup"]; if ([param length] > 0) [self _setupDatesWithPopup: param andUserTZ: userTZ]; diff --git a/UI/Scheduler/UIxCalMonthView.h b/UI/Scheduler/UIxCalMonthView.h index 82a9f132e..48190556c 100644 --- a/UI/Scheduler/UIxCalMonthView.h +++ b/UI/Scheduler/UIxCalMonthView.h @@ -46,8 +46,6 @@ NSArray *currentTableColumn; } -- (id ) defaultAction; - - (NSDictionary *) monthBeforePrevMonthQueryParameters; - (NSDictionary *) prevMonthQueryParameters; - (NSDictionary *) nextMonthQueryParameters; diff --git a/UI/Templates/SchedulerUI/UIxCalInlineAptView.wox b/UI/Templates/SchedulerUI/UIxCalInlineAptView.wox deleted file mode 100644 index 7d769af30..000000000 --- a/UI/Templates/SchedulerUI/UIxCalInlineAptView.wox +++ /dev/null @@ -1,32 +0,0 @@ - - -
-

-
-
-