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)
--------------------

View File

@ -487,15 +487,28 @@ static Class iCalEventK = nil;
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
{
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.
excludeFromFreeBusy
= [self folderPropertyValueInCategory: @"FreeBusyExclusions"
forUser: [SOGoUser userWithLogin: [self ownerInContext: context]]];
forUser: [SOGoUser userWithLogin: userLogin]];
if (!excludeFromFreeBusy && !is_owner)
return NO;
return ![excludeFromFreeBusy boolValue];
}

View File

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

View File

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

View File

@ -1,9 +1,6 @@
/* UIxCalendarProperties.m - this file is part of SOGo
*
* Copyright (C) 2008-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
* Copyright (C) 2008-2014 Inverse inc.
*
* 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

View File

@ -1,9 +1,6 @@
/* UIxCalendarProperties.m - this file is part of SOGo
*
* Copyright (C) 2008-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
* Copyright (C) 2008-2014 Inverse inc.
*
* 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
@ -181,15 +178,6 @@
[calendar setShowCalendarTasks: new];
}
- (BOOL) userIsOwner
{
NSString *userLogin;
userLogin = [[context activeUser] login];
return ([userLogin isEqualToString: [calendar ownerInContext: context]]);
}
- (BOOL) isPublicAccessEnabled
{
// 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
><input type="hidden" name="calendarColor" id="calendarColor" var:value="calendarColor"
/></span></div>
<var:if condition="userIsOwner"
><div
<div
><label><input type="checkbox" const:class="checkBox"
name="includeInFreeBusy"
id="includeInFreeBusy"
var:checked="includeInFreeBusy"
/><var:string label:value="Include in free-busy"
/></label
></div
></var:if>
></div>
</fieldset>
<fieldset>
<legend><var:string label:value="Synchronization"/></legend>