See ChangeLog

Monotone-Parent: 52bbcfeb1dfff49a3bb753faaefd8bf92a5ad7eb
Monotone-Revision: f16d87f59f756ed8514cb53f85c6de0f559d8af2

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2010-03-19T13:08:15
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2010-03-19 13:08:15 +00:00
parent bf275960b4
commit e7b0efaace
6 changed files with 61 additions and 5 deletions

View File

@@ -1,3 +1,11 @@
2010-03-19 Ludovic Marcotte <lmarcotte@inverse.ca>
* Added the SOGoiPhoneForceAllDayTransparency
preference (and its associated code to handle
it in SOGoAppointmentObject.m) to force
transparency on all-day events coming from
the iPhone-OS based devices.
2010-03-18 Ludovic Marcotte <lmarcotte@inverse.ca>
* Replaced SOGoUIxUserCanChangePassword with

View File

@@ -1497,6 +1497,33 @@
[rq setContent: newContent];
}
- (void) _adjustTransparencyInRequest: (WORequest *) rq
{
iCalCalendar *calendar;
NSArray *allEvents;
iCalEvent *event;
int i;
BOOL modified;
calendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]];
allEvents = [calendar events];
modified = NO;
for (i = 0; i < [allEvents count]; i++)
{
event = [allEvents objectAtIndex: i];
if ([event isAllDay] && [event isOpaque])
{
[event setTransparency: @"TRANSPARENT"];
modified = YES;
}
}
if (modified)
[rq setContent: [[calendar versitString] dataUsingEncoding: [rq contentEncoding]]];
}
- (void) _decomposeGroupsInRequest: (WORequest *) rq
{
iCalCalendar *calendar;
@@ -1537,10 +1564,13 @@
// If we see "X-SOGo: NoGroupsDecomposition" in the HTTP headers, we
// simply invoke super's PUTAction.
//
// We also check if we must force transparency on all day events
// from iPhone clients.
//
- (id) PUTAction: (WOContext *) _ctx
{
WORequest *rq;
NSArray *roles;
WORequest *rq;
rq = [_ctx request];
@@ -1550,9 +1580,19 @@
[self _setupResponseCalendarInRequest: rq];
else
{
SOGoUser *user;
user = [SOGoUser userWithLogin: owner];
if (![[rq headersForKey: @"X-SOGo"]
containsObject: @"NoGroupsDecomposition"])
[self _decomposeGroupsInRequest: rq];
if ([[user domainDefaults] iPhoneForceAllDayTransparency]
&& [rq isIPhone])
{
[self _adjustTransparencyInRequest: rq];
}
}
return [super PUTAction: _ctx];

View File

@@ -66,6 +66,8 @@
- (NSArray *) freeBusyDefaultInterval;
- (int) davCalendarStartTimeLimit;
- (BOOL) iPhoneForceAllDayTransparency;
@end
#endif /* SOGODOMAINDEFAULTS_H */

View File

@@ -260,6 +260,11 @@
return [self integerForKey: @"SOGoDAVCalendarStartTimeLimit"];
}
- (BOOL) iPhoneForceAllDayTransparency
{
return [self boolForKey: @"SOGoiPhoneForceAllDayTransparency"];
}
/* overriden methods */
- (NSString *) language
{

View File

@@ -1,6 +1,6 @@
/* WORequest+SOGo.m - this file is part of SOGo
*
* Copyright (C) 2007 Inverse inc.
* Copyright (C) 2007-2010 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*

View File

@@ -1,20 +1,21 @@
/*
Copyright (C) 2006-2010 Inverse inc.
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
SOGo 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
SOGo 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
License along with SOGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/