Fix client-side event status filter 'owner too' so group calendar shows events when a group member is an owner

This commit is contained in:
nathangray 2020-03-31 10:14:41 -06:00
parent 038c1c811c
commit d9ecc966bb
2 changed files with 9 additions and 7 deletions

View File

@ -696,8 +696,9 @@ var et2_calendar_event = /** @class */ (function (_super) {
return pass;
}
// Show also events just owned by selected user
if (filter == 'owner') {
return owner == event.owner;
// Group members can be owner too, those get handled when we check group memberships below
if (filter == 'owner' && owner == event.owner) {
return true;
}
// Get the relevant participant
var participant = event.participants[owner];

View File

@ -898,9 +898,10 @@ export class et2_calendar_event extends et2_valueWidget implements et2_IDetached
}
// Show also events just owned by selected user
if(filter == 'owner')
// Group members can be owner too, those get handled when we check group memberships below
if(filter == 'owner' && owner == event.owner)
{
return owner == event.owner;
return true;
}
// Get the relevant participant
@ -923,9 +924,9 @@ export class et2_calendar_event extends et2_valueWidget implements et2_IDetached
if((isNaN(parseInt(owner)) || parseInt(owner) < 0) && options && typeof options.find == "function")
{
let resource = options.find(function (element)
{
return element.id == owner;
}) || {};
{
return element.id == owner;
}) || {};
if(resource && resource.resources)
{
let matching_participant = resource.resources.filter(id => typeof event.participants[id] != "undefined");