mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-23 15:32:37 +00:00
Monotone-Parent: 5f2a3e7eefe739c0e656450e9cc85846e27c80b8
Monotone-Revision: 3239b46c1626108a2b1a3d6cab30ae4c9bd6a731 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-13T22:38:05 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
8041818572
commit
d5d78c5f79
20 files changed
+415
-102
No files matched your search
@@ -34,6 +34,7 @@ libSOGo_HEADER_FILES = \
|
||||
SOGoDateFormatter.h \
|
||||
SOGoPermissions.h \
|
||||
SOGoDAVRendererTypes.h \
|
||||
iCalEntityObject+Utilities.h \
|
||||
NSArray+Utilities.h \
|
||||
NSDictionary+URL.h \
|
||||
NSDictionary+Utilities.h \
|
||||
@@ -68,6 +69,7 @@ libSOGo_OBJC_FILES = \
|
||||
LDAPSource.m \
|
||||
SOGoDAVRendererTypes.m \
|
||||
AgenorUserDefaults.m \
|
||||
iCalEntityObject+Utilities.m \
|
||||
NSArray+Utilities.m \
|
||||
NSDictionary+URL.m \
|
||||
NSDictionary+Utilities.m \
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
/* content */
|
||||
|
||||
- (BOOL) isNew;
|
||||
- (void) setContentString: (NSString *) newContent;
|
||||
- (NSString *) contentAsString;
|
||||
- (NSException *) saveContentString: (NSString *) _str
|
||||
baseVersion: (unsigned int) _baseVersion;
|
||||
|
||||
@@ -138,6 +138,11 @@
|
||||
return content;
|
||||
}
|
||||
|
||||
- (void) setContentString: (NSString *) newContent
|
||||
{
|
||||
ASSIGN (content, newContent);
|
||||
}
|
||||
|
||||
- (NSException *) saveContentString: (NSString *) newContent
|
||||
baseVersion: (unsigned int) newBaseVersion
|
||||
{
|
||||
@@ -147,12 +152,11 @@
|
||||
|
||||
ex = nil;
|
||||
|
||||
ASSIGN (content, newContent);
|
||||
[self setContentString: newContent];
|
||||
folder = [container ocsFolder];
|
||||
if (folder)
|
||||
{
|
||||
ex = [folder writeContent: newContent
|
||||
toName: nameInContainer
|
||||
ex = [folder writeContent: content toName: nameInContainer
|
||||
baseVersion: newBaseVersion];
|
||||
if (ex)
|
||||
[self errorWithFormat:@"write failed: %@", ex];
|
||||
|
||||
@@ -41,7 +41,10 @@
|
||||
@class NSUserDefaults;
|
||||
@class NSTimeZone;
|
||||
@class WOContext;
|
||||
@class SOGoAppointmentFolder;
|
||||
@class SOGoAppointmentFolders;
|
||||
@class SOGoDateFormatter;
|
||||
@class WOContext;
|
||||
|
||||
extern NSString *SOGoWeekStartHideWeekNumbers;
|
||||
extern NSString *SOGoWeekStartJanuary1;
|
||||
@@ -117,7 +120,10 @@ extern NSString *SOGoWeekStartFirstFullWeek;
|
||||
/* folders */
|
||||
|
||||
- (id) homeFolderInContext: (id) _ctx;
|
||||
// - (id) schedulingCalendarInContext: (id) _ctx;
|
||||
|
||||
- (SOGoAppointmentFolders *) calendarsFolderInContext: (WOContext *) context;
|
||||
- (SOGoAppointmentFolder *)
|
||||
personalCalendarFolderInContext: (WOContext *) context;
|
||||
|
||||
- (NSArray *) rolesForObject: (NSObject *) object
|
||||
inContext: (WOContext *) context;
|
||||
|
||||
@@ -551,6 +551,21 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
|
||||
return folder;
|
||||
}
|
||||
|
||||
- (SOGoAppointmentFolders *) calendarsFolderInContext: (WOContext *) context
|
||||
{
|
||||
return [[self homeFolderInContext: context] lookupName: @"Calendar"
|
||||
inContext: context
|
||||
acquire: NO];
|
||||
}
|
||||
|
||||
- (SOGoAppointmentFolder *)
|
||||
personalCalendarFolderInContext: (WOContext *) context
|
||||
{
|
||||
return [[self calendarsFolderInContext: context] lookupName: @"personal"
|
||||
inContext: context
|
||||
acquire: NO];
|
||||
}
|
||||
|
||||
// - (id) schedulingCalendarInContext: (id) _ctx
|
||||
// {
|
||||
// /* Note: watch out for cyclic references */
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/* iCalEntityObject+Utilities.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef ICALENTITYOBJECT_UTILITIES_H
|
||||
#define ICALENTITYOBJECT_UTILITIES_H
|
||||
|
||||
#import <NGCards/iCalEntityObject.h>
|
||||
|
||||
@class iCalPerson;
|
||||
@class SOGoUser;
|
||||
|
||||
@interface iCalEntityObject (SOGoAddition)
|
||||
|
||||
- (iCalPerson *) findParticipant: (SOGoUser *) user;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* ICALENTITYOBJECT_UTILITIES_H */
|
||||
@@ -0,0 +1,51 @@
|
||||
/* iCalEntityObject+Utilities.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2007 Inverse groupe conseil
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
|
||||
#import <NGCards/iCalPerson.h>
|
||||
|
||||
#import "SOGoUser.h"
|
||||
|
||||
#import "iCalEntityObject+Utilities.h"
|
||||
|
||||
@implementation iCalEntityObject (SOGoAddition)
|
||||
|
||||
- (iCalPerson *) findParticipant: (SOGoUser *) user
|
||||
{
|
||||
iCalPerson *participant, *currentParticipant;
|
||||
NSEnumerator *participants;
|
||||
|
||||
participant = nil;
|
||||
participants = [[self participants] objectEnumerator];
|
||||
currentParticipant = [participants nextObject];
|
||||
while (currentParticipant && !participant)
|
||||
if ([user hasEmail: [currentParticipant rfc822Email]])
|
||||
participant = currentParticipant;
|
||||
else
|
||||
currentParticipant = [participants nextObject];
|
||||
|
||||
return participant;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user