From: znek Date: Tue, 12 Jul 2005 15:21:18 +0000 (+0000) Subject: better baseURL generation X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=140a0da7b865b051b75ba46e5a7f1e7276ad4d98;p=scalable-opengroupware.org better baseURL generation git-svn-id: http://svn.opengroupware.org/SOGo/trunk@730 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SoObjects/Appointments/ChangeLog b/SOGo/SoObjects/Appointments/ChangeLog index 5cee0021..a3a68373 100644 --- a/SOGo/SoObjects/Appointments/ChangeLog +++ b/SOGo/SoObjects/Appointments/ChangeLog @@ -1,3 +1,10 @@ +2005-07-12 Marcus Mueller + + * SOGoAppointmentObject.m: tries ambitiously to detect the baseURL in + -homePageURLForPerson: now. This code doesn't really belong here + but currently there's no appropriate controller for dealing with it + around. Also removed mail notification testing code. (v0.9.40) + 2005-07-12 Helge Hess * fixed compilation (v0.9.39) diff --git a/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m b/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m index 92b216bb..b232e9f0 100644 --- a/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SOGo/SoObjects/Appointments/SOGoAppointmentObject.m @@ -472,12 +472,26 @@ static NSTimeZone *MET = nil; NSString *uid; if (!um) { - um = [[AgenorUserManager sharedUserManager] retain]; - baseURL = @"http://agenor.opengroupware.org/foo/so"; + WOContext *ctx; + NSArray *traversalObjects; + + um = [[AgenorUserManager sharedUserManager] retain]; + + /* generate URL from traversal stack */ + ctx = [[WOApplication application] context]; + traversalObjects = [ctx objectTraversalStack]; + if ([traversalObjects count] >= 1) { + baseURL = [[[traversalObjects objectAtIndex:0] baseURLInContext:ctx] + retain]; + } + else { + [self warnWithFormat:@"Unable to create baseURL from context!"]; + baseURL = @"http://localhost/"; + } } uid = [um getUIDForEmail:[_person rfc822Email]]; if (!uid) return nil; - return [NSString stringWithFormat:@"%@/%@", baseURL, uid]; + return [NSString stringWithFormat:@"%@%@", baseURL, uid]; } - (NSTimeZone *)viewTimeZoneForPerson:(iCalPerson *)_person { @@ -543,7 +557,6 @@ static NSTimeZone *MET = nil; attendee = [_attendees objectAtIndex:i]; /* construct recipient */ -#if 1 cn = [attendee cn]; if (cn) { recipient = [NSString stringWithFormat:@"%@ <%@>", @@ -553,9 +566,6 @@ static NSTimeZone *MET = nil; else { recipient = [attendee rfc822Email]; } -#else - recipient = @"Marcus Mueller "; -#endif /* construct message content */ p = [app pageWithName:pageName]; @@ -607,15 +617,9 @@ static NSTimeZone *MET = nil; [body release]; /* send the damn thing */ -#if 1 [sendmail sendMimePart:msg toRecipients:[NSArray arrayWithObject:[attendee rfc822Email]] sender:[organizer rfc822Email]]; -#else - [sendmail sendMimePart:msg - toRecipients:[NSArray arrayWithObject:@"mm@skyrix.com"] - sender:[organizer rfc822Email]]; -#endif } } diff --git a/SOGo/SoObjects/Appointments/Version b/SOGo/SoObjects/Appointments/Version index 73ad775e..c492133d 100644 --- a/SOGo/SoObjects/Appointments/Version +++ b/SOGo/SoObjects/Appointments/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=39 +SUBMINOR_VERSION:=40 # v0.9.32 requires libGDLContentStore v4.5.26 # v0.9.28 requires libNGiCal v4.5.47