Fix freebusy data fetching of MS Exchange contacts
parent
e0b0a1d783
commit
b27c868271
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
- [web] fixed JavaScript exception when SOGo is launched from an external link (#3900)
|
- [web] fixed JavaScript exception when SOGo is launched from an external link (#3900)
|
||||||
|
- [web] restored fetching of freebusy information of MS Exchange contacts
|
||||||
|
|
||||||
3.2.3 (2016-11-25)
|
3.2.3 (2016-11-25)
|
||||||
------------------
|
------------------
|
||||||
|
|
|
@ -140,7 +140,7 @@ NSNumber *iCalDistantFutureNumber = nil;
|
||||||
[currentAttendee rfc822Email], @"email",
|
[currentAttendee rfc822Email], @"email",
|
||||||
([[currentAttendee cnWithoutQuotes] length] ? [currentAttendee cnWithoutQuotes] : [currentAttendee rfc822Email]) , @"name",
|
([[currentAttendee cnWithoutQuotes] length] ? [currentAttendee cnWithoutQuotes] : [currentAttendee rfc822Email]) , @"name",
|
||||||
nil];
|
nil];
|
||||||
if ((uid = [currentAttendee uid]))
|
if ((uid = [currentAttendee uidInContext: context]))
|
||||||
{
|
{
|
||||||
[attendeeData setObject: uid forKey: @"uid"];
|
[attendeeData setObject: uid forKey: @"uid"];
|
||||||
}
|
}
|
||||||
|
@ -156,12 +156,12 @@ NSNumber *iCalDistantFutureNumber = nil;
|
||||||
if ([source conformsToProtocol: @protocol (SOGoDNSource)] &&
|
if ([source conformsToProtocol: @protocol (SOGoDNSource)] &&
|
||||||
[[(NSObject <SOGoDNSource>*) source MSExchangeHostname] length])
|
[[(NSObject <SOGoDNSource>*) source MSExchangeHostname] length])
|
||||||
{
|
{
|
||||||
uid = [NSString stringWithFormat: @"%@:%@", [[context activeUser] login],
|
[attendeeData setObject: [NSNumber numberWithInt: 1] forKey: @"isMSExchange"];
|
||||||
[contactData valueForKey: @"c_uid"]];
|
[attendeeData setObject: [contactData valueForKey: @"c_uid"] forKey: @"uid"];
|
||||||
[attendeeData setObject: uid forKey: @"uid"];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[attendeeData setObject: [[currentAttendee partStat] lowercaseString] forKey: @"partstat"];
|
[attendeeData setObject: [[currentAttendee partStat] lowercaseString] forKey: @"partstat"];
|
||||||
[attendeeData setObject: [[currentAttendee role] lowercaseString] forKey: @"role"];
|
[attendeeData setObject: [[currentAttendee role] lowercaseString] forKey: @"role"];
|
||||||
if ([[currentAttendee delegatedTo] length])
|
if ([[currentAttendee delegatedTo] length])
|
||||||
|
|
|
@ -49,7 +49,9 @@
|
||||||
*/
|
*/
|
||||||
Resource.prototype.userResource = function(uid) {
|
Resource.prototype.userResource = function(uid) {
|
||||||
var path = _.compact(this._activeUser.folderURL.split('/'));
|
var path = _.compact(this._activeUser.folderURL.split('/'));
|
||||||
path.splice(path.length - 1, 1, escape(uid));
|
|
||||||
|
if (uid)
|
||||||
|
path.splice(path.length - 1, 1, escape(uid));
|
||||||
|
|
||||||
return new Resource(this._http, this._q, '/' + path.join('/'), this._activeUser);
|
return new Resource(this._http, this._q, '/' + path.join('/'), this._activeUser);
|
||||||
};
|
};
|
||||||
|
|
|
@ -618,8 +618,14 @@
|
||||||
// this.organizer.$image = Component.$gravatar(this.organizer.email, 32);
|
// this.organizer.$image = Component.$gravatar(this.organizer.email, 32);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Load freebusy of attendees
|
if (this.attendees) {
|
||||||
this.updateFreeBusy();
|
_.forEach(this.attendees, function(attendee) {
|
||||||
|
attendee.image = Component.$gravatar(attendee.email, 32);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Load freebusy of attendees
|
||||||
|
this.updateFreeBusy();
|
||||||
|
}
|
||||||
|
|
||||||
this.selected = false;
|
this.selected = false;
|
||||||
};
|
};
|
||||||
|
@ -774,7 +780,6 @@
|
||||||
|
|
||||||
if (this.attendees) {
|
if (this.attendees) {
|
||||||
_.forEach(this.attendees, function(attendee) {
|
_.forEach(this.attendees, function(attendee) {
|
||||||
attendee.image = Component.$gravatar(attendee.email, 32);
|
|
||||||
_this.updateFreeBusyAttendee(attendee);
|
_this.updateFreeBusyAttendee(attendee);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -800,21 +805,37 @@
|
||||||
* @param {Object} card - an Card object instance of the attendee
|
* @param {Object} card - an Card object instance of the attendee
|
||||||
*/
|
*/
|
||||||
Component.prototype.updateFreeBusyAttendee = function(attendee) {
|
Component.prototype.updateFreeBusyAttendee = function(attendee) {
|
||||||
var params, url, days;
|
var resource, uid, params, days;
|
||||||
|
|
||||||
if (attendee.uid) {
|
if (attendee.uid) {
|
||||||
|
uid = attendee.uid;
|
||||||
|
if (attendee.domain)
|
||||||
|
uid += '@' + attendee.domain;
|
||||||
params =
|
params =
|
||||||
{
|
{
|
||||||
sday: this.start.getDayString(),
|
sday: this.start.getDayString(),
|
||||||
eday: this.end.getDayString()
|
eday: this.end.getDayString()
|
||||||
};
|
};
|
||||||
url = ['..', '..', attendee.uid, 'freebusy.ifb'];
|
|
||||||
|
if (attendee.isMSExchange) {
|
||||||
|
// Attendee is not a local user, but her freebusy data is available from an external MS Exchange server;
|
||||||
|
// we query /SOGo/so/<login_user>/freebusy.ifb/ajaxRead?uid=<uid>
|
||||||
|
resource = Component.$$resource.userResource();
|
||||||
|
params.uid = uid;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Attendee is a user;
|
||||||
|
// web query /SOGo/so/<uid>/freebusy.ifb/ajaxRead
|
||||||
|
resource = Component.$$resource.userResource(uid);
|
||||||
|
}
|
||||||
|
|
||||||
days = _.map(this.start.daysUpTo(this.end), function(day) { return day.getDayString(); });
|
days = _.map(this.start.daysUpTo(this.end), function(day) { return day.getDayString(); });
|
||||||
|
|
||||||
if (angular.isUndefined(attendee.freebusy))
|
if (angular.isUndefined(attendee.freebusy))
|
||||||
attendee.freebusy = {};
|
attendee.freebusy = {};
|
||||||
|
|
||||||
// Fetch FreeBusy information
|
// Fetch FreeBusy information
|
||||||
Component.$$resource.fetch(url.join('/'), 'ajaxRead', params).then(function(data) {
|
resource.fetch('freebusy.ifb', 'ajaxRead', params).then(function(data) {
|
||||||
_.forEach(days, function(day) {
|
_.forEach(days, function(day) {
|
||||||
var hour;
|
var hour;
|
||||||
|
|
||||||
|
@ -893,11 +914,13 @@
|
||||||
else {
|
else {
|
||||||
// Single contact
|
// Single contact
|
||||||
attendee = {
|
attendee = {
|
||||||
|
uid: card.c_uid,
|
||||||
|
domain: card.c_domain,
|
||||||
|
isMSExchange: card.ismsexchange,
|
||||||
name: card.c_cn,
|
name: card.c_cn,
|
||||||
email: card.$preferredEmail(),
|
email: card.$preferredEmail(),
|
||||||
role: 'req-participant',
|
role: 'req-participant',
|
||||||
partstat: 'needs-action',
|
partstat: 'needs-action',
|
||||||
uid: card.c_uid,
|
|
||||||
$avatarIcon: card.$avatarIcon
|
$avatarIcon: card.$avatarIcon
|
||||||
};
|
};
|
||||||
if (!_.find(this.attendees, function(o) {
|
if (!_.find(this.attendees, function(o) {
|
||||||
|
|
Loading…
Reference in New Issue