Allow including or not freebusy info from subscribed calendars

pull/68/head
Ludovic Marcotte 2014-12-11 10:01:21 -05:00
parent c8b74686cc
commit 990f782b62
7 changed files with 28 additions and 28 deletions

6
NEWS
View File

@ -1,3 +1,9 @@
2.2.12 (2014-12-xx)
-------------------
New features
- Allow including or not freebusy info from subscribed calendars
2.2.11a (2014-12-10) 2.2.11a (2014-12-10)
-------------------- --------------------

View File

@ -487,14 +487,27 @@ static Class iCalEventK = nil;
inCategory: @"FolderSynchronize"]; inCategory: @"FolderSynchronize"];
} }
//
// If the user is the owner of the calendar, by default we include the freebusy information.
//
// If the user is NOT the owner of the calendar, by default we exclude the freebusy information.
//
- (BOOL) includeInFreeBusy - (BOOL) includeInFreeBusy
{ {
NSNumber *excludeFromFreeBusy; NSNumber *excludeFromFreeBusy;
NSString *userLogin;
BOOL is_owner;
userLogin = [[context activeUser] login];
is_owner = [userLogin isEqualToString: [self ownerInContext: context]];
// Check if the owner (not the active user) has excluded the calendar from her/his free busy data. // Check if the owner (not the active user) has excluded the calendar from her/his free busy data.
excludeFromFreeBusy excludeFromFreeBusy
= [self folderPropertyValueInCategory: @"FreeBusyExclusions" = [self folderPropertyValueInCategory: @"FreeBusyExclusions"
forUser: [SOGoUser userWithLogin: [self ownerInContext: context]]]; forUser: [SOGoUser userWithLogin: userLogin]];
if (!excludeFromFreeBusy && !is_owner)
return NO;
return ![excludeFromFreeBusy boolValue]; return ![excludeFromFreeBusy boolValue];
} }

View File

@ -1,6 +1,5 @@
/* /*
Copyright (C) 2007-2012 Inverse inc. Copyright (C) 2007-2014 Inverse inc.
Copyright (C) 2000-2004 SKYRIX Software AG
This file is part of SOGo This file is part of SOGo

View File

@ -1,6 +1,5 @@
/* /*
Copyright (C) 2007-2012 Inverse inc. Copyright (C) 2007-2014 Inverse inc.
Copyright (C) 2000-2004 SKYRIX Software AG
This file is part of SOGo This file is part of SOGo
@ -339,7 +338,7 @@
for (count = 0; count < max; count++) for (count = 0; count < max; count++)
{ {
calFolder = [folders objectAtIndex: count]; calFolder = [folders objectAtIndex: count];
if (![calFolder isSubscription] && [calFolder includeInFreeBusy]) if ([calFolder includeInFreeBusy])
[infos addObjectsFromArray: [calFolder fetchFreeBusyInfosFrom: startDate [infos addObjectsFromArray: [calFolder fetchFreeBusyInfosFrom: startDate
to: endDate]]; to: endDate]];
} }

View File

@ -1,9 +1,6 @@
/* UIxCalendarProperties.m - this file is part of SOGo /* UIxCalendarProperties.m - this file is part of SOGo
* *
* Copyright (C) 2008-2012 Inverse inc. * Copyright (C) 2008-2014 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,9 +1,6 @@
/* UIxCalendarProperties.m - this file is part of SOGo /* UIxCalendarProperties.m - this file is part of SOGo
* *
* Copyright (C) 2008-2012 Inverse inc. * Copyright (C) 2008-2014 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
* *
* This file is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -181,15 +178,6 @@
[calendar setShowCalendarTasks: new]; [calendar setShowCalendarTasks: new];
} }
- (BOOL) userIsOwner
{
NSString *userLogin;
userLogin = [[context activeUser] login];
return ([userLogin isEqualToString: [calendar ownerInContext: context]]);
}
- (BOOL) isPublicAccessEnabled - (BOOL) isPublicAccessEnabled
{ {
// NOTE: This method is the same found in Common/UIxAclEditor.m // NOTE: This method is the same found in Common/UIxAclEditor.m

View File

@ -113,16 +113,14 @@
><div id="colorButton" class="colorBox" var:data-color="calendarColor"><!-- space --></div ><div id="colorButton" class="colorBox" var:data-color="calendarColor"><!-- space --></div
><input type="hidden" name="calendarColor" id="calendarColor" var:value="calendarColor" ><input type="hidden" name="calendarColor" id="calendarColor" var:value="calendarColor"
/></span></div> /></span></div>
<var:if condition="userIsOwner" <div
><div
><label><input type="checkbox" const:class="checkBox" ><label><input type="checkbox" const:class="checkBox"
name="includeInFreeBusy" name="includeInFreeBusy"
id="includeInFreeBusy" id="includeInFreeBusy"
var:checked="includeInFreeBusy" var:checked="includeInFreeBusy"
/><var:string label:value="Include in free-busy" /><var:string label:value="Include in free-busy"
/></label /></label
></div ></div>
></var:if>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend><var:string label:value="Synchronization"/></legend> <legend><var:string label:value="Synchronization"/></legend>