mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-23 23:22:45 +00:00
Monotone-Parent: 64bb41288f025d8a85a54ff9d3fa322dc9a6f5bd
Monotone-Revision: da1c467c5b7518e5169cbac4376ede2064795635 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-28T17:22:44 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
2006-09-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/SOGoAppointmentFolder.m
|
||||
([SOGoAppointmentFolder -doCalendarQuery:context]): added a
|
||||
hackish test to detect whether the request concernes VEVENT's or
|
||||
anything else. Return events only in the former case.
|
||||
([SOGoAppointmentFolder
|
||||
-fetchOverviewInfosFrom:_startDateto:_endDate]): retrieve the
|
||||
c_name quickfield so that the calendar list can identify the
|
||||
appointments with their complete "filename".
|
||||
|
||||
* OGoContentStore/OCSiCalFieldExtractor.m: use CardGroup's
|
||||
groupsOfClass:fromSource: to parse the given vcalendar.
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "SOGoAppointmentFolder.h"
|
||||
#include <SOGo/SOGoCustomGroupFolder.h>
|
||||
#include <SOGo/SOGoAppointment.h>
|
||||
#include <SOGo/AgenorUserManager.h>
|
||||
#include <GDLContentStore/GCSFolder.h>
|
||||
#include <SaxObjC/SaxObjC.h>
|
||||
@@ -207,7 +206,7 @@ static NSNumber *sharedYes = nil;
|
||||
- (id) doCalendarQuery: (id) context
|
||||
{
|
||||
WOResponse *r;
|
||||
NSString *baseURL;
|
||||
NSString *baseURL, *content;
|
||||
NSArray *apts;
|
||||
NSEnumerator *appointments;
|
||||
NSDictionary *appointment;
|
||||
@@ -233,14 +232,22 @@ static NSNumber *sharedYes = nil;
|
||||
[r appendContentString:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"];
|
||||
[r appendContentString: @"<D:multistatus xmlns:D=\"DAV:\""
|
||||
@" xmlns:C=\"urn:ietf:params:xml:ns:caldav\">\r\n"];
|
||||
appointments = [apts objectEnumerator];
|
||||
appointment = [appointments nextObject];
|
||||
while (appointment)
|
||||
|
||||
content = [[NSString alloc] initWithData: [[context request] content]
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[content autorelease];
|
||||
if ([content indexOfString: @"VEVENT"] != NSNotFound
|
||||
|| [content indexOfString: @"vevent"] != NSNotFound)
|
||||
{
|
||||
[self appendAppointment: appointment
|
||||
withBaseURL: baseURL
|
||||
toREPORTResponse: r];
|
||||
appointments = [apts objectEnumerator];
|
||||
appointment = [appointments nextObject];
|
||||
while (appointment)
|
||||
{
|
||||
[self appendAppointment: appointment
|
||||
withBaseURL: baseURL
|
||||
toREPORTResponse: r];
|
||||
appointment = [appointments nextObject];
|
||||
}
|
||||
}
|
||||
[r appendContentString:@"</D:multistatus>\r\n"];
|
||||
|
||||
@@ -580,7 +587,7 @@ static NSNumber *sharedYes = nil;
|
||||
static NSArray *infos = nil; // TODO: move to a plist file
|
||||
if (infos == nil) {
|
||||
infos = [[NSArray alloc] initWithObjects:
|
||||
@"title",
|
||||
@"c_name", @"title",
|
||||
@"location", @"orgmail", @"status", @"ispublic",
|
||||
@"isallday", @"priority",
|
||||
@"partmails", @"partstates",
|
||||
@@ -829,19 +836,9 @@ static NSNumber *sharedYes = nil;
|
||||
|
||||
events = [NSMutableArray arrayWithCapacity:[files count]];
|
||||
contents = [files objectEnumerator];
|
||||
while ((content = [contents nextObject]) != nil) {
|
||||
SOGoAppointment *event;
|
||||
|
||||
event = [[SOGoAppointment alloc] initWithICalString:content];
|
||||
if (![event isNotNull]) {
|
||||
[self errorWithFormat:@"(%s): could not parse an iCal file!",
|
||||
__PRETTY_FUNCTION__];
|
||||
continue;
|
||||
}
|
||||
|
||||
[events addObject:event];
|
||||
[event release];
|
||||
}
|
||||
while ((content = [contents nextObject]) != nil)
|
||||
[events addObjectsFromArray: [CardGroup groupsOfClass: [iCalCalendar class]
|
||||
fromSource: content]];
|
||||
|
||||
return events;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user