Monotone-Parent: 8268efeb15753e2949b09378244938f0b6bb08a8

Monotone-Revision: c0c1c6cf72acfbec9c8a2b4e7eeef2f801f49e54

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-09-29T18:31:20
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2006-09-29 18:31:20 +00:00
parent 7d81972309
commit 14993bccb0
12 changed files with 101 additions and 97 deletions

View File

@ -95,21 +95,14 @@ static NSString *fieldNames[] = {
}
- (NSMutableDictionary *)extractQuickFieldsFromVCardString:(NSString *)_str {
NSArray *vCards;
NGVCard *vCard;
if ((vCards = [NGVCard parseVCardsFromSource:_str]) == nil) {
[self errorWithFormat:@"Could not parse content as a vCard."];
return nil;
}
if ([vCards count] == 0) {
if ((vCard = [NGVCard parseSingleFromSource: _str]) == nil) {
[self errorWithFormat:@"Could not parse content as a vCard."];
return nil;
}
if ([vCards count] > 1)
[self warnWithFormat:@"More than one vCard in content, using first."];
return [self extractQuickFieldsFromVCard:[vCards objectAtIndex:0]];
return [self extractQuickFieldsFromVCard: vCard];
}
- (NSMutableDictionary *)extractQuickFieldsFromContent:(NSString *)_content {

View File

@ -208,20 +208,17 @@ static NSNumber *distantFutureNumber = nil;
- (NSMutableDictionary *)extractQuickFieldsFromContent:(NSString *)_content {
NSAutoreleasePool *pool;
NSDictionary *fields;
NSArray *cals;
id cal;
if ([_content length] == 0)
return nil;
pool = [[NSAutoreleasePool alloc] init];
cals = [CardGroup groupsOfClass: [iCalCalendar class]
fromSource: _content];
if ([cals count] > 0)
{
cal = [cals objectAtIndex: 0];
cal = [iCalCalendar parseSingleFromSource: _content];
fields = nil;
fields = nil;
if (cal)
{
if ([cal isKindOfClass:[iCalEvent class]])
fields = [[self extractQuickFieldsFromEvent:cal] retain];
else if ([cal isKindOfClass:[iCalCalendar class]])
@ -231,6 +228,8 @@ static NSNumber *distantFutureNumber = nil;
cal];
}
}
else
[self logWithFormat:@"ERROR: parsing source didn't return anything"];
[pool release];

View File

@ -47,7 +47,7 @@
iCalRecurrenceRule *rule;
rule = [a objectAtIndex:i];
[ma addObject:[rule iCalRepresentation]];
[ma addObject: [rule versitString]];
}
[cycleInfo setObject:ma forKey:@"rules"];
}
@ -63,7 +63,7 @@
iCalRecurrenceRule *rule;
rule = [a objectAtIndex:i];
[ma addObject:[rule iCalRepresentation]];
[ma addObject: [rule versitString]];
}
[cycleInfo setObject:ma forKey:@"exRules"];
}

View File

@ -30,9 +30,7 @@
#include "SOGoICalHTTPHandler.h"
#include <SoObjects/Appointments/SOGoAppointmentFolder.h>
#include <SoObjects/Appointments/SOGoAppointmentObject.h>
#include <SOGo/SOGoAppointment.h>
#include <NGCards/NGCards.h>
#include <NGCards/iCalRenderer.h>
#include <SaxObjC/SaxObjC.h>
#include "common.h"

View File

@ -837,8 +837,7 @@ static NSNumber *sharedYes = nil;
events = [NSMutableArray arrayWithCapacity:[files count]];
contents = [files objectEnumerator];
while ((content = [contents nextObject]) != nil)
[events addObjectsFromArray: [CardGroup groupsOfClass: [iCalCalendar class]
fromSource: content]];
[events addObject: [iCalCalendar parseSingleFromSource: content]];
return events;
}

View File

@ -70,7 +70,6 @@
- (NSException *)changeParticipationStatus:(NSString *)_status
inContext:(id)_ctx;
- (iCalCalendar *) calendarFromContent: (NSString *) cnt;
- (iCalEvent *) firstEventFromCalendar: (iCalCalendar *) calendar;
@end

View File

@ -21,10 +21,10 @@
// $Id: UIxContactSelector.m 394 2004-10-14 08:47:35Z znek $
#import <NGExtensions/NGExtensions.h>
#import <NGCards/iCalPerson.h>
#import <SOGoUI/UIxComponent.h>
#import <SOGo/AgenorUserManager.h>
#import <Scheduler/iCalPerson+UIx.h>
#import "common.h"
@ -134,6 +134,9 @@
NSMutableArray *persons;
NSEnumerator *uids;
NSString *uid;
AgenorUserManager *um;
um = [AgenorUserManager sharedUserManager];
persons = [NSMutableArray new];
[persons autorelease];
@ -145,7 +148,7 @@
uid = [uids nextObject];
while (uid)
{
[persons addObject: [iCalPerson personWithUid: uid]];
[persons addObject: [um iCalPersonWithUid: uid]];
uid = [uids nextObject];
}
}

View File

@ -0,0 +1,46 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
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.
*/
#ifndef UIXMAILPARTICALVIEWER_H
#define UIXMAILPARTICALVIEWER_H
#import "UIxMailPartViewer.h"
@class SOGoDateFormatter;
@class iCalEvent;
@class iCalCalendar;
@interface UIxMailPartICalViewer : UIxMailPartViewer
{
iCalCalendar *inCalendar;
iCalEvent *inEvent;
id attendee;
SOGoDateFormatter *dateFormatter;
id item;
id storedEventObject;
iCalEvent *storedEvent;
}
- (iCalEvent *) authorativeEvent;
@end
#endif /* UIXMAILPARTICALVIEWER_H */

View File

@ -19,41 +19,22 @@
02111-1307, USA.
*/
#include "UIxMailPartViewer.h"
/*
UIxMailPartICalViewer
Show plain/calendar mail parts.
*/
@class SOGoDateFormatter;
@class iCalEvent, iCalCalendar;
#import <SOGoUI/SOGoDateFormatter.h>
#import <SOGo/SOGoUser.h>
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
#import <SoObjects/Appointments/SOGoAppointmentObject.h>
#import <SoObjects/Mailer/SOGoMailObject.h>
#import <NGCards/NGCards.h>
#import <NGImap4/NGImap4EnvelopeAddress.h>
#import "common.h"
@interface UIxMailPartICalViewer : UIxMailPartViewer
{
iCalCalendar *inCalendar;
iCalEvent *inEvent;
id attendee;
SOGoDateFormatter *dateFormatter;
id item;
id storedEventObject;
iCalEvent *storedEvent;
}
- (iCalEvent *)authorativeEvent;
@end
#include <SOGoUI/SOGoDateFormatter.h>
#include <SOGo/SOGoAppointment.h>
#include <SOGo/SOGoUser.h>
#include <SoObjects/Appointments/SOGoAppointmentFolder.h>
#include <SoObjects/Appointments/SOGoAppointmentObject.h>
#include <SoObjects/Mailer/SOGoMailObject.h>
#include <NGCards/NGCards.h>
#include <NGImap4/NGImap4EnvelopeAddress.h>
#include "common.h"
#import "UIxMailPartICalViewer.h"
@implementation UIxMailPartICalViewer
@ -101,28 +82,18 @@
/* accessors */
- (iCalCalendar *)inCalendar {
NSString *iCalString;
if (self->inCalendar != nil)
return [self->inCalendar isNotNull] ? self->inCalendar : nil;
if ((iCalString = [self flatContentAsString]) == nil) {
[self errorWithFormat:@"Could not retrieve content string for part!"];
self->inCalendar = [[NSNull null] retain];
return nil;
}
self->inCalendar =
[[iCalCalendar parseCalendarFromSource:iCalString] retain];
if (self->inCalendar == nil) {
[self warnWithFormat:@"Could not parse a vcalendar string."];
self->inCalendar = [[NSNull null] retain];
return nil;
}
else
return self->inCalendar;
- (iCalCalendar *) inCalendar
{
if (!inCalendar)
{
inCalendar
= [iCalCalendar parseSingleFromSource: [self flatContentAsString]];
[inCalendar retain];
}
return inCalendar;
}
- (BOOL)couldParseCalendar {
return [[self inCalendar] isNotNull];
}

View File

@ -10,7 +10,6 @@ SchedulerUI_LANGUAGES = English French German
SchedulerUI_OBJC_FILES = \
SchedulerUIProduct.m \
iCalPerson+UIx.m \
NSCalendarDate+Scheduler.m \
\
UIxCalMainView.m \
@ -31,18 +30,14 @@ SchedulerUI_OBJC_FILES = \
UIxCalDayOverview.m \
UIxCalDayChartview.m \
UIxCalDayListview.m \
UIxCalDayPrintview.m \
UIxCalWeekOverview.m \
UIxCalWeekChartview.m \
UIxCalWeekListview.m \
UIxCalWeekColumnsview.m \
UIxCalWeekPrintview.m \
UIxCalMonthOverview.m \
UIxCalMonthPrintview.m \
UIxCalYearOverview.m \
UIxCalInlineMonthOverview.m \
UIxAppointmentView.m \
UIxAppointmentPrintview.m \
UIxAppointmentEditor.m \
UIxCalSelectTab.m \
UIxCalDateLabel.m \
@ -53,6 +48,10 @@ SchedulerUI_OBJC_FILES = \
UIxCalInlineAptView.m \
UIxCalScheduleOverview.m \
UIxCalParticipationStatusView.m \
# UIxCalDayPrintview.m \
# UIxCalWeekPrintview.m \
# UIxCalMonthPrintview.m \
# UIxAppointmentPrintview.m \
SchedulerUI_RESOURCE_FILES += \
Version \

View File

@ -88,15 +88,14 @@
@end
#include "common.h"
#include <NGCards/NGCards.h>
#include <NGExtensions/NGCalendarDateRange.h>
#include <SOGoUI/SOGoDateFormatter.h>
#include <SOGo/AgenorUserManager.h>
#include <Appointments/SOGoAppointmentFolder.h>
#include <Appointments/SOGoAppointmentObject.h>
#include "iCalPerson+UIx.h"
#include "UIxComponent+Agenor.h"
#import "common.h"
#import <NGCards/NGCards.h>
#import <NGExtensions/NGCalendarDateRange.h>
#import <SOGoUI/SOGoDateFormatter.h>
#import <SOGo/AgenorUserManager.h>
#import <Appointments/SOGoAppointmentFolder.h>
#import <Appointments/SOGoAppointmentObject.h>
#import "UIxComponent+Agenor.h"
@interface NSDate(UsedPrivates)
- (NSString *)icalString; // TODO: this is in NGCards
@ -849,7 +848,7 @@
SOGoAppointmentObject *clientObject;
clientObject = [self clientObject];
calendar = [clientObject calendarFromContent: _iCalString];
calendar = [iCalCalendar parseSingleFromSource: _iCalString];
appointment = [clientObject firstEventFromCalendar: calendar];
return appointment;
@ -876,12 +875,11 @@
/* access */
- (BOOL)isMyApt {
if (organizer == nil)
return YES; // assume this is safe to do, right?
- (BOOL) isMyApt
{
// TODO: this should check a set of emails against the SoUser
return [[organizer rfc822Email] isEqualToString:[self emailForUser]];
return (![[organizer email] length]
|| [[organizer rfc822Email] isEqualToString: [self emailForUser]]);
}
- (BOOL)canAccessApt {

View File

@ -178,14 +178,13 @@
return nil;
}
calendar = [clientObject calendarFromContent: iCalString];
calendar = [iCalCalendar parseSingleFromSource: iCalString];
appointment = [clientObject firstEventFromCalendar: calendar];
[appointment retain];
return appointment;
}
/* hrefs */
- (NSString *)attributesTabLink {