From e7b0efaacef2878b6f5332166bb84c5e790e2876 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Fri, 19 Mar 2010 13:08:15 +0000 Subject: [PATCH 1/2] 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 --- ChangeLog | 8 ++++ .../Appointments/SOGoAppointmentObject.m | 42 ++++++++++++++++++- SoObjects/SOGo/SOGoDomainDefaults.h | 2 + SoObjects/SOGo/SOGoDomainDefaults.m | 5 +++ SoObjects/SOGo/WORequest+SOGo.m | 2 +- UI/Contacts/UIxContactsListView.m | 7 ++-- 6 files changed, 61 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b01b1e6cb..5f1071dac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-03-19 Ludovic Marcotte + + * 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 * Replaced SOGoUIxUserCanChangePassword with diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index 9628f25db..acac8c257 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -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]; diff --git a/SoObjects/SOGo/SOGoDomainDefaults.h b/SoObjects/SOGo/SOGoDomainDefaults.h index 78de03b78..76ed304fb 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.h +++ b/SoObjects/SOGo/SOGoDomainDefaults.h @@ -66,6 +66,8 @@ - (NSArray *) freeBusyDefaultInterval; - (int) davCalendarStartTimeLimit; +- (BOOL) iPhoneForceAllDayTransparency; + @end #endif /* SOGODOMAINDEFAULTS_H */ diff --git a/SoObjects/SOGo/SOGoDomainDefaults.m b/SoObjects/SOGo/SOGoDomainDefaults.m index fc77834d0..2d5f17f6c 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.m +++ b/SoObjects/SOGo/SOGoDomainDefaults.m @@ -260,6 +260,11 @@ return [self integerForKey: @"SOGoDAVCalendarStartTimeLimit"]; } +- (BOOL) iPhoneForceAllDayTransparency +{ + return [self boolForKey: @"SOGoiPhoneForceAllDayTransparency"]; +} + /* overriden methods */ - (NSString *) language { diff --git a/SoObjects/SOGo/WORequest+SOGo.m b/SoObjects/SOGo/WORequest+SOGo.m index 7d239f521..824cb8bc5 100644 --- a/SoObjects/SOGo/WORequest+SOGo.m +++ b/SoObjects/SOGo/WORequest+SOGo.m @@ -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 * diff --git a/UI/Contacts/UIxContactsListView.m b/UI/Contacts/UIxContactsListView.m index 2a5a45ba2..dd521162b 100644 --- a/UI/Contacts/UIxContactsListView.m +++ b/UI/Contacts/UIxContactsListView.m @@ -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. */ From d1e5ed23652cf4b6791ce5524585d9d0ccc00aa6 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 22 Mar 2010 15:06:13 +0000 Subject: [PATCH 2/2] Fix for contacts web module when in a popup window. Monotone-Parent: f16d87f59f756ed8514cb53f85c6de0f559d8af2 Monotone-Revision: c650aab7e4429bb8a2b8885d4161d881a1f9f2e7 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-03-22T15:06:13 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/ContactsUI.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UI/WebServerResources/ContactsUI.css b/UI/WebServerResources/ContactsUI.css index e0003bf2d..86084f388 100644 --- a/UI/WebServerResources/ContactsUI.css +++ b/UI/WebServerResources/ContactsUI.css @@ -304,20 +304,20 @@ BODY.popup DIV#rightPanel { top: 4em; } BODY.popup DIV#dragHandle -{ top: 6em; } +{ top: 7em; } BODY.popup DIV#contactsListContent -{ height: 8em; +{ height: 7em; top: 34px; } BODY.popup DIV#contactFoldersList { top: 50px; } BODY.popup DIV#rightDragHandle -{ top: 10em; } +{ top: 10.2em; } BODY.popup DIV#contactView -{ top: 10em; } +{ top: 10.2em; } BODY.popup DIV#filterPanel { position: relative;